NEW TRIBES ENHANCEMENT (Huns, Egipteans, Spartans & Vikings) #327

NEW TRIBES ENHANCEMENT (Huns, Egipteans, Spartans & Vikings) #327

Please be advised, is not fully tested so if you activate on install maybe is not fully working
This commit is contained in:
novgorodschi catalin
2026-07-14 09:25:26 +03:00
parent 60a2d3b206
commit 25c8925ef6
315 changed files with 8609 additions and 615 deletions
+4 -4
View File
@@ -19,14 +19,14 @@
## --------------------------------------------------------------------------- ##
#################################################################################
global $session, $technology, $village, $database, $generator, $building, $bid19, $id;
global $session, $technology, $village, $database, $generator, $building, $bid19, $id, $unitsbytype;
$tribe = (int)$session->tribe;
$units = ($tribe !== 4) ? range(($tribe-1)*10+1, ($tribe-1)*10+4) : range(31, 40);
$units = ($tribe !== 4) ? range(($tribe-1)*10+1, $tribe*10) : range(31, 40);
foreach ($units as $i) {
// SKIP INVALID UNITS
if ($tribe !== 4 && ($i == 4 || $i == 23 || $i == 24)) continue;
// doar infanteria tribului (generic: acopera si triburile 6-9)
if ($tribe !== 4 && !in_array($i, $unitsbytype['infantry'])) continue;
if (!($technology->getTech($i) || $i % 10 == 1)) continue;
$unitData = ${'u'.$i};
+5 -3
View File
@@ -19,15 +19,17 @@
## --------------------------------------------------------------------------- ##
#################################################################################
global $session, $technology, $village, $database, $generator, $building, $bid20, $bid41, $id;
global $session, $technology, $village, $database, $generator, $building, $bid20, $bid41, $id, $unitsbytype;
$tribe = (int)$session->tribe;
$start = ($tribe - 1) * 10 + 4 - ($tribe == 3 ? 1 : 0) + ($tribe == 2 ? 1 : 0);
$end = $tribe * 10 - 4;
$start = ($tribe - 1) * 10 + 1;
$end = $tribe * 10;
$success = 0;
$horseTrough = $building->getTypeLevel(41);
for ($i = $start; $i <= $end; $i++) {
// doar cavaleria tribului (generic: acopera si triburile 6-9)
if (!in_array($i, $unitsbytype['cavalry'])) continue;
if (!$technology->getTech($i)) continue;
$unitData = ${'u'.$i};
+6 -3
View File
@@ -47,9 +47,12 @@ $trainlist = $technology->getTrainingList(3);
$success = 0;
$tribe = (int)$session->tribe;
if ($tribe!== 4) {
$starts = [1=>7, 2=>17, 3=>27, 5=>47];
$start = $starts[$tribe]?? 7;
for ($i = $start; $i <= $start+1; $i++) {
global $unitsbytype;
// unitatile de asediu ale tribului (generic: acopera si triburile 6-9)
$siegeUnits = array_values(array_filter($unitsbytype['siege'], function($u) use ($tribe) {
return $u > ($tribe - 1) * 10 && $u <= $tribe * 10;
}));
foreach ($siegeUnits as $i) {
if (!$technology->getTech($i)) continue;
$unitData = ${'u'.$i};
$name = $technology->getUnitName($i);
+119
View File
@@ -0,0 +1,119 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : ACADEMY HUNS UNITS ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $technology, $generator, $village, $session, $building, $bid22, $id;
$acares = $technology->grabAcademyRes();
$success = $fail = 0;
$level = (int)$village->resarray['f'.$id];
?>
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr><td><?php echo ACADEMY;?></td><td><?php echo ACTION;?></td></tr></thead>
<tbody>
<?php for ($i = 52; $i <= 59; $i++):
if (!($technology->meetRRequirement($i) &&!$technology->getTech($i) &&!$technology->isResearch($i,1))) { $fail++; continue; }
$success++;
$res = ${'r'.$i};
$name = $technology->getUnitName($i);
$time = $generator->getTimeFormat(round($res['time'] * ($bid22[$level]['attri']/100) / SPEED));
$total_required = (int)($res['wood']+$res['clay']+$res['iron']+$res['crop']);
$showNpc = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $total_required;
?>
<tr>
<td class="desc">
<div class="tit"><img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>" title="<?php echo htmlspecialchars($name);?>"/><a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a></div>
<div class="details">
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo (int)$res['wood'];?>|
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo (int)$res['clay'];?>|
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo (int)$res['iron'];?>|
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo (int)$res['crop'];?>|
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $time;?>
<?php if ($showNpc):?>|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$res['wood'];?>&r2=<?php echo (int)$res['clay'];?>&r3=<?php echo (int)$res['iron'];?>&r4=<?php echo (int)$res['crop'];?>" title="<?php echo NPC_TRADE; ?>"><img class="npc" src="img/x.gif"/></a><?php endif;?>
<?php
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span>";
elseif ($res['crop']>$village->maxcrop) echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span>";
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) {
if ($village->getProd("crop")>0){ $t=$technology->calculateAvaliable(22,$res); echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$t[0]." at ".$t[1]."</span>"; }
else echo "<br><span class=\"none\">".CROP_NEGATIVE."</span>";
}
?>
</div>
</td>
<td class="<?php echo ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore||$res['crop']>$village->maxcrop||$res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop||count($acares)>0)?'none':'act';?>">
<?php
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<div class=\"none\">".EXPAND_WAREHOUSE."</div>";
elseif ($res['crop']>$village->maxcrop) echo "<div class=\"none\">".EXPAND_GRANARY."</div>";
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) echo "<div class=\"none\">".TOO_FEW_RESOURCES."</div>";
elseif (count($acares)>0) echo RESEARCH_IN_PROGRESS;
elseif ($session->access!=BANNED) echo "<a class=\"research\" href=\"build.php?id=".(int)$id."&amp;a=".$i."&amp;c=".$session->mchecker."\">".RESEARCH."</a>";
else echo "<a class=\"research\" href=\"banned.php\">".RESEARCH."</a>";
?>
</td>
</tr>
<?php endfor; if ($success===0):?>
<tr><td colspan="2"><div class="none" align="center"><?php echo RESEARCH_AVAILABLE;?></div></td></tr>
<?php endif;?>
</tbody>
</table>
<?php if ($fail>0):?>
<p class="switch"><a id="researchFutureLink" href="#" onclick="document.getElementById('researchFuture').classList.toggle('hide'); this.textContent = this.textContent == '<?php echo SHOW_MORE;?>'? '<?php echo HIDE_MORE;?>' : '<?php echo SHOW_MORE;?>'; return false;"><?php echo SHOW_MORE;?></a></p>
<table id="researchFuture" class="build_details hide" cellspacing="1" cellpadding="1">
<thead><tr><td colspan="2"><?php echo PREREQUISITES;?></td></tr></thead>
<tbody>
<?php if (!$technology->meetRRequirement(52) &&!$technology->getTech(52)):?>
<tr><td class="desc"><div class="tit"><img class="unit u52" src="img/x.gif" alt="<?php echo U52; ?>"/><a onclick="return Popup(52,1);" href="#"><?php echo U52; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 1</span><br><a href="#" onclick="return Popup(15,4);"><?php echo MAINBUILDING;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(53) &&!$technology->getTech(53)):?>
<tr><td class="desc"><div class="tit"><img class="unit u53" src="img/x.gif" alt="<?php echo U53; ?>"/><a onclick="return Popup(53,1);" href="#"><?php echo U53; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 3</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(54) &&!$technology->getTech(54)):?>
<tr><td class="desc"><div class="tit"><img class="unit u54" src="img/x.gif" alt="<?php echo U54; ?>"/><a onclick="return Popup(54,1);" href="#"><?php echo U54; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(55) &&!$technology->getTech(55)):?>
<tr><td class="desc"><div class="tit"><img class="unit u55" src="img/x.gif" alt="<?php echo U55; ?>"/><a onclick="return Popup(55,1);" href="#"><?php echo U55; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(56) &&!$technology->getTech(56)):?>
<tr><td class="desc"><div class="tit"><img class="unit u56" src="img/x.gif" alt="<?php echo U56; ?>"/><a onclick="return Popup(56,1);" href="#"><?php echo U56; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(57) &&!$technology->getTech(57)):?>
<tr><td class="desc"><div class="tit"><img class="unit u57" src="img/x.gif" alt="<?php echo U57; ?>"/><a onclick="return Popup(57,1);" href="#"><?php echo U57; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(58) &&!$technology->getTech(58)):?>
<tr><td class="desc"><div class="tit"><img class="unit u58" src="img/x.gif" alt="<?php echo U58; ?>"/><a onclick="return Popup(58,1);" href="#"><?php echo U58; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(59) &&!$technology->getTech(59)):?>
<tr><td class="desc"><div class="tit"><img class="unit u59" src="img/x.gif" alt="<?php echo U59; ?>"/><a onclick="return Popup(59,1);" href="#"><?php echo U59; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(16,4);"><?php echo RALLYPOINT;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 20</span></td></tr>
<?php endif;?>
</tbody>
</table>
<?php endif;?>
<?php if (count($acares)>0):?>
<table cellpadding="1" cellspacing="1" class="under_progress">
<thead><tr><td><?php echo RESEARCHING;?></td><td><?php echo DURATION;?></td><td><?php echo COMPLETE;?></td></tr></thead>
<tbody>
<?php foreach ($acares as $aca): $unit=(int)substr($aca['tech'],1,2); $name=$technology->getUnitName($unit); $date=$generator->procMtime($aca['timestamp']);?>
<tr><td class="desc"><img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><?php echo htmlspecialchars($name);?></td><td class="dur"><span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($aca['timestamp']-time());?></span></td><td class="fin"><span><?php echo $date[1];?></span><span> <?php echo TZ_HRS; ?></span></td></tr>
<?php endforeach;?>
</tbody>
</table>
<?php endif;?>
+119
View File
@@ -0,0 +1,119 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : ACADEMY EGIPTEAN UNITS ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $technology, $generator, $village, $session, $building, $bid22, $id;
$acares = $technology->grabAcademyRes();
$success = $fail = 0;
$level = (int)$village->resarray['f'.$id];
?>
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr><td><?php echo ACADEMY;?></td><td><?php echo ACTION;?></td></tr></thead>
<tbody>
<?php for ($i = 62; $i <= 69; $i++):
if (!($technology->meetRRequirement($i) &&!$technology->getTech($i) &&!$technology->isResearch($i,1))) { $fail++; continue; }
$success++;
$res = ${'r'.$i};
$name = $technology->getUnitName($i);
$time = $generator->getTimeFormat(round($res['time'] * ($bid22[$level]['attri']/100) / SPEED));
$total_required = (int)($res['wood']+$res['clay']+$res['iron']+$res['crop']);
$showNpc = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $total_required;
?>
<tr>
<td class="desc">
<div class="tit"><img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>" title="<?php echo htmlspecialchars($name);?>"/><a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a></div>
<div class="details">
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo (int)$res['wood'];?>|
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo (int)$res['clay'];?>|
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo (int)$res['iron'];?>|
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo (int)$res['crop'];?>|
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $time;?>
<?php if ($showNpc):?>|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$res['wood'];?>&r2=<?php echo (int)$res['clay'];?>&r3=<?php echo (int)$res['iron'];?>&r4=<?php echo (int)$res['crop'];?>" title="<?php echo NPC_TRADE; ?>"><img class="npc" src="img/x.gif"/></a><?php endif;?>
<?php
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span>";
elseif ($res['crop']>$village->maxcrop) echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span>";
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) {
if ($village->getProd("crop")>0){ $t=$technology->calculateAvaliable(22,$res); echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$t[0]." at ".$t[1]."</span>"; }
else echo "<br><span class=\"none\">".CROP_NEGATIVE."</span>";
}
?>
</div>
</td>
<td class="<?php echo ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore||$res['crop']>$village->maxcrop||$res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop||count($acares)>0)?'none':'act';?>">
<?php
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<div class=\"none\">".EXPAND_WAREHOUSE."</div>";
elseif ($res['crop']>$village->maxcrop) echo "<div class=\"none\">".EXPAND_GRANARY."</div>";
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) echo "<div class=\"none\">".TOO_FEW_RESOURCES."</div>";
elseif (count($acares)>0) echo RESEARCH_IN_PROGRESS;
elseif ($session->access!=BANNED) echo "<a class=\"research\" href=\"build.php?id=".(int)$id."&amp;a=".$i."&amp;c=".$session->mchecker."\">".RESEARCH."</a>";
else echo "<a class=\"research\" href=\"banned.php\">".RESEARCH."</a>";
?>
</td>
</tr>
<?php endfor; if ($success===0):?>
<tr><td colspan="2"><div class="none" align="center"><?php echo RESEARCH_AVAILABLE;?></div></td></tr>
<?php endif;?>
</tbody>
</table>
<?php if ($fail>0):?>
<p class="switch"><a id="researchFutureLink" href="#" onclick="document.getElementById('researchFuture').classList.toggle('hide'); this.textContent = this.textContent == '<?php echo SHOW_MORE;?>'? '<?php echo HIDE_MORE;?>' : '<?php echo SHOW_MORE;?>'; return false;"><?php echo SHOW_MORE;?></a></p>
<table id="researchFuture" class="build_details hide" cellspacing="1" cellpadding="1">
<thead><tr><td colspan="2"><?php echo PREREQUISITES;?></td></tr></thead>
<tbody>
<?php if (!$technology->meetRRequirement(62) &&!$technology->getTech(62)):?>
<tr><td class="desc"><div class="tit"><img class="unit u62" src="img/x.gif" alt="<?php echo U62; ?>"/><a onclick="return Popup(62,1);" href="#"><?php echo U62; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 1</span><br><a href="#" onclick="return Popup(13,4);"><?php echo ARMOURY;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(63) &&!$technology->getTech(63)):?>
<tr><td class="desc"><div class="tit"><img class="unit u63" src="img/x.gif" alt="<?php echo U63; ?>"/><a onclick="return Popup(63,1);" href="#"><?php echo U63; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 3</span><br><a href="#" onclick="return Popup(12,4);"><?php echo BLACKSMITH;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(64) &&!$technology->getTech(64)):?>
<tr><td class="desc"><div class="tit"><img class="unit u64" src="img/x.gif" alt="<?php echo U64; ?>"/><a onclick="return Popup(64,1);" href="#"><?php echo U64; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(65) &&!$technology->getTech(65)):?>
<tr><td class="desc"><div class="tit"><img class="unit u65" src="img/x.gif" alt="<?php echo U65; ?>"/><a onclick="return Popup(65,1);" href="#"><?php echo U65; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(66) &&!$technology->getTech(66)):?>
<tr><td class="desc"><div class="tit"><img class="unit u66" src="img/x.gif" alt="<?php echo U66; ?>"/><a onclick="return Popup(66,1);" href="#"><?php echo U66; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(67) &&!$technology->getTech(67)):?>
<tr><td class="desc"><div class="tit"><img class="unit u67" src="img/x.gif" alt="<?php echo U67; ?>"/><a onclick="return Popup(67,1);" href="#"><?php echo U67; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(68) &&!$technology->getTech(68)):?>
<tr><td class="desc"><div class="tit"><img class="unit u68" src="img/x.gif" alt="<?php echo U68; ?>"/><a onclick="return Popup(68,1);" href="#"><?php echo U68; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(69) &&!$technology->getTech(69)):?>
<tr><td class="desc"><div class="tit"><img class="unit u69" src="img/x.gif" alt="<?php echo U69; ?>"/><a onclick="return Popup(69,1);" href="#"><?php echo U69; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(16,4);"><?php echo RALLYPOINT;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 20</span></td></tr>
<?php endif;?>
</tbody>
</table>
<?php endif;?>
<?php if (count($acares)>0):?>
<table cellpadding="1" cellspacing="1" class="under_progress">
<thead><tr><td><?php echo RESEARCHING;?></td><td><?php echo DURATION;?></td><td><?php echo COMPLETE;?></td></tr></thead>
<tbody>
<?php foreach ($acares as $aca): $unit=(int)substr($aca['tech'],1,2); $name=$technology->getUnitName($unit); $date=$generator->procMtime($aca['timestamp']);?>
<tr><td class="desc"><img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><?php echo htmlspecialchars($name);?></td><td class="dur"><span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($aca['timestamp']-time());?></span></td><td class="fin"><span><?php echo $date[1];?></span><span> <?php echo TZ_HRS; ?></span></td></tr>
<?php endforeach;?>
</tbody>
</table>
<?php endif;?>
+119
View File
@@ -0,0 +1,119 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : ACADEMY SPARTAN UNITS ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $technology, $generator, $village, $session, $building, $bid22, $id;
$acares = $technology->grabAcademyRes();
$success = $fail = 0;
$level = (int)$village->resarray['f'.$id];
?>
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr><td><?php echo ACADEMY;?></td><td><?php echo ACTION;?></td></tr></thead>
<tbody>
<?php for ($i = 72; $i <= 79; $i++):
if (!($technology->meetRRequirement($i) &&!$technology->getTech($i) &&!$technology->isResearch($i,1))) { $fail++; continue; }
$success++;
$res = ${'r'.$i};
$name = $technology->getUnitName($i);
$time = $generator->getTimeFormat(round($res['time'] * ($bid22[$level]['attri']/100) / SPEED));
$total_required = (int)($res['wood']+$res['clay']+$res['iron']+$res['crop']);
$showNpc = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $total_required;
?>
<tr>
<td class="desc">
<div class="tit"><img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>" title="<?php echo htmlspecialchars($name);?>"/><a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a></div>
<div class="details">
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo (int)$res['wood'];?>|
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo (int)$res['clay'];?>|
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo (int)$res['iron'];?>|
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo (int)$res['crop'];?>|
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $time;?>
<?php if ($showNpc):?>|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$res['wood'];?>&r2=<?php echo (int)$res['clay'];?>&r3=<?php echo (int)$res['iron'];?>&r4=<?php echo (int)$res['crop'];?>" title="<?php echo NPC_TRADE; ?>"><img class="npc" src="img/x.gif"/></a><?php endif;?>
<?php
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span>";
elseif ($res['crop']>$village->maxcrop) echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span>";
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) {
if ($village->getProd("crop")>0){ $t=$technology->calculateAvaliable(22,$res); echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$t[0]." at ".$t[1]."</span>"; }
else echo "<br><span class=\"none\">".CROP_NEGATIVE."</span>";
}
?>
</div>
</td>
<td class="<?php echo ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore||$res['crop']>$village->maxcrop||$res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop||count($acares)>0)?'none':'act';?>">
<?php
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<div class=\"none\">".EXPAND_WAREHOUSE."</div>";
elseif ($res['crop']>$village->maxcrop) echo "<div class=\"none\">".EXPAND_GRANARY."</div>";
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) echo "<div class=\"none\">".TOO_FEW_RESOURCES."</div>";
elseif (count($acares)>0) echo RESEARCH_IN_PROGRESS;
elseif ($session->access!=BANNED) echo "<a class=\"research\" href=\"build.php?id=".(int)$id."&amp;a=".$i."&amp;c=".$session->mchecker."\">".RESEARCH."</a>";
else echo "<a class=\"research\" href=\"banned.php\">".RESEARCH."</a>";
?>
</td>
</tr>
<?php endfor; if ($success===0):?>
<tr><td colspan="2"><div class="none" align="center"><?php echo RESEARCH_AVAILABLE;?></div></td></tr>
<?php endif;?>
</tbody>
</table>
<?php if ($fail>0):?>
<p class="switch"><a id="researchFutureLink" href="#" onclick="document.getElementById('researchFuture').classList.toggle('hide'); this.textContent = this.textContent == '<?php echo SHOW_MORE;?>'? '<?php echo HIDE_MORE;?>' : '<?php echo SHOW_MORE;?>'; return false;"><?php echo SHOW_MORE;?></a></p>
<table id="researchFuture" class="build_details hide" cellspacing="1" cellpadding="1">
<thead><tr><td colspan="2"><?php echo PREREQUISITES;?></td></tr></thead>
<tbody>
<?php if (!$technology->meetRRequirement(72) &&!$technology->getTech(72)):?>
<tr><td class="desc"><div class="tit"><img class="unit u72" src="img/x.gif" alt="<?php echo U72; ?>"/><a onclick="return Popup(72,1);" href="#"><?php echo U72; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 1</span><br><a href="#" onclick="return Popup(13,4);"><?php echo ARMOURY;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(73) &&!$technology->getTech(73)):?>
<tr><td class="desc"><div class="tit"><img class="unit u73" src="img/x.gif" alt="<?php echo U73; ?>"/><a onclick="return Popup(73,1);" href="#"><?php echo U73; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(12,4);"><?php echo BLACKSMITH;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(74) &&!$technology->getTech(74)):?>
<tr><td class="desc"><div class="tit"><img class="unit u74" src="img/x.gif" alt="<?php echo U74; ?>"/><a onclick="return Popup(74,1);" href="#"><?php echo U74; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 1</span><br><a href="#" onclick="return Popup(12,4);"><?php echo BLACKSMITH;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(75) &&!$technology->getTech(75)):?>
<tr><td class="desc"><div class="tit"><img class="unit u75" src="img/x.gif" alt="<?php echo U75; ?>"/><a onclick="return Popup(75,1);" href="#"><?php echo U75; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 1</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 3</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(76) &&!$technology->getTech(76)):?>
<tr><td class="desc"><div class="tit"><img class="unit u76" src="img/x.gif" alt="<?php echo U76; ?>"/><a onclick="return Popup(76,1);" href="#"><?php echo U76; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(77) &&!$technology->getTech(77)):?>
<tr><td class="desc"><div class="tit"><img class="unit u77" src="img/x.gif" alt="<?php echo U77; ?>"/><a onclick="return Popup(77,1);" href="#"><?php echo U77; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(78) &&!$technology->getTech(78)):?>
<tr><td class="desc"><div class="tit"><img class="unit u78" src="img/x.gif" alt="<?php echo U78; ?>"/><a onclick="return Popup(78,1);" href="#"><?php echo U78; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(79) &&!$technology->getTech(79)):?>
<tr><td class="desc"><div class="tit"><img class="unit u79" src="img/x.gif" alt="<?php echo U79; ?>"/><a onclick="return Popup(79,1);" href="#"><?php echo U79; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(16,4);"><?php echo RALLYPOINT;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 20</span></td></tr>
<?php endif;?>
</tbody>
</table>
<?php endif;?>
<?php if (count($acares)>0):?>
<table cellpadding="1" cellspacing="1" class="under_progress">
<thead><tr><td><?php echo RESEARCHING;?></td><td><?php echo DURATION;?></td><td><?php echo COMPLETE;?></td></tr></thead>
<tbody>
<?php foreach ($acares as $aca): $unit=(int)substr($aca['tech'],1,2); $name=$technology->getUnitName($unit); $date=$generator->procMtime($aca['timestamp']);?>
<tr><td class="desc"><img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><?php echo htmlspecialchars($name);?></td><td class="dur"><span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($aca['timestamp']-time());?></span></td><td class="fin"><span><?php echo $date[1];?></span><span> <?php echo TZ_HRS; ?></span></td></tr>
<?php endforeach;?>
</tbody>
</table>
<?php endif;?>
+119
View File
@@ -0,0 +1,119 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : ACADEMY VIKINGS UNITS ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $technology, $generator, $village, $session, $building, $bid22, $id;
$acares = $technology->grabAcademyRes();
$success = $fail = 0;
$level = (int)$village->resarray['f'.$id];
?>
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr><td><?php echo ACADEMY;?></td><td><?php echo ACTION;?></td></tr></thead>
<tbody>
<?php for ($i = 82; $i <= 89; $i++):
if (!($technology->meetRRequirement($i) &&!$technology->getTech($i) &&!$technology->isResearch($i,1))) { $fail++; continue; }
$success++;
$res = ${'r'.$i};
$name = $technology->getUnitName($i);
$time = $generator->getTimeFormat(round($res['time'] * ($bid22[$level]['attri']/100) / SPEED));
$total_required = (int)($res['wood']+$res['clay']+$res['iron']+$res['crop']);
$showNpc = $session->userinfo['gold']>=3 && $building->getTypeLevel(17)>=1 && $village->atotal >= $total_required;
?>
<tr>
<td class="desc">
<div class="tit"><img class="unit u<?php echo $i;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>" title="<?php echo htmlspecialchars($name);?>"/><a href="#" onClick="return Popup(<?php echo $i;?>,1);"><?php echo htmlspecialchars($name);?></a></div>
<div class="details">
<img class="r1" src="img/x.gif" title="<?php echo LUMBER;?>"/><?php echo (int)$res['wood'];?>|
<img class="r2" src="img/x.gif" title="<?php echo CLAY;?>"/><?php echo (int)$res['clay'];?>|
<img class="r3" src="img/x.gif" title="<?php echo IRON;?>"/><?php echo (int)$res['iron'];?>|
<img class="r4" src="img/x.gif" title="<?php echo CROP;?>"/><?php echo (int)$res['crop'];?>|
<img class="clock" src="img/x.gif" title="<?php echo DURATION;?>"/><?php echo $time;?>
<?php if ($showNpc):?>|<a href="build.php?gid=17&t=3&r1=<?php echo (int)$res['wood'];?>&r2=<?php echo (int)$res['clay'];?>&r3=<?php echo (int)$res['iron'];?>&r4=<?php echo (int)$res['crop'];?>" title="<?php echo NPC_TRADE; ?>"><img class="npc" src="img/x.gif"/></a><?php endif;?>
<?php
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<br><span class=\"none\">".EXPAND_WAREHOUSE1."</span>";
elseif ($res['crop']>$village->maxcrop) echo "<br><span class=\"none\">".EXPAND_GRANARY1."</span>";
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) {
if ($village->getProd("crop")>0){ $t=$technology->calculateAvaliable(22,$res); echo "<br><span class=\"none\">".ENOUGH_RESOURCES." ".$t[0]." at ".$t[1]."</span>"; }
else echo "<br><span class=\"none\">".CROP_NEGATIVE."</span>";
}
?>
</div>
</td>
<td class="<?php echo ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore||$res['crop']>$village->maxcrop||$res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop||count($acares)>0)?'none':'act';?>">
<?php
if ($res['wood']>$village->maxstore||$res['clay']>$village->maxstore||$res['iron']>$village->maxstore) echo "<div class=\"none\">".EXPAND_WAREHOUSE."</div>";
elseif ($res['crop']>$village->maxcrop) echo "<div class=\"none\">".EXPAND_GRANARY."</div>";
elseif ($res['wood']>$village->awood||$res['clay']>$village->aclay||$res['iron']>$village->airon||$res['crop']>$village->acrop) echo "<div class=\"none\">".TOO_FEW_RESOURCES."</div>";
elseif (count($acares)>0) echo RESEARCH_IN_PROGRESS;
elseif ($session->access!=BANNED) echo "<a class=\"research\" href=\"build.php?id=".(int)$id."&amp;a=".$i."&amp;c=".$session->mchecker."\">".RESEARCH."</a>";
else echo "<a class=\"research\" href=\"banned.php\">".RESEARCH."</a>";
?>
</td>
</tr>
<?php endfor; if ($success===0):?>
<tr><td colspan="2"><div class="none" align="center"><?php echo RESEARCH_AVAILABLE;?></div></td></tr>
<?php endif;?>
</tbody>
</table>
<?php if ($fail>0):?>
<p class="switch"><a id="researchFutureLink" href="#" onclick="document.getElementById('researchFuture').classList.toggle('hide'); this.textContent = this.textContent == '<?php echo SHOW_MORE;?>'? '<?php echo HIDE_MORE;?>' : '<?php echo SHOW_MORE;?>'; return false;"><?php echo SHOW_MORE;?></a></p>
<table id="researchFuture" class="build_details hide" cellspacing="1" cellpadding="1">
<thead><tr><td colspan="2"><?php echo PREREQUISITES;?></td></tr></thead>
<tbody>
<?php if (!$technology->meetRRequirement(82) &&!$technology->getTech(82)):?>
<tr><td class="desc"><div class="tit"><img class="unit u82" src="img/x.gif" alt="<?php echo U82; ?>"/><a onclick="return Popup(82,1);" href="#"><?php echo U82; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 1</span><br><a href="#" onclick="return Popup(15,4);"><?php echo MAINBUILDING;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(83) &&!$technology->getTech(83)):?>
<tr><td class="desc"><div class="tit"><img class="unit u83" src="img/x.gif" alt="<?php echo U83; ?>"/><a onclick="return Popup(83,1);" href="#"><?php echo U83; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 3</span><br><a href="#" onclick="return Popup(12,4);"><?php echo BLACKSMITH;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(84) &&!$technology->getTech(84)):?>
<tr><td class="desc"><div class="tit"><img class="unit u84" src="img/x.gif" alt="<?php echo U84; ?>"/><a onclick="return Popup(84,1);" href="#"><?php echo U84; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(12,4);"><?php echo BLACKSMITH;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(85) &&!$technology->getTech(85)):?>
<tr><td class="desc"><div class="tit"><img class="unit u85" src="img/x.gif" alt="<?php echo U85; ?>"/><a onclick="return Popup(85,1);" href="#"><?php echo U85; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 5</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 5</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(86) &&!$technology->getTech(86)):?>
<tr><td class="desc"><div class="tit"><img class="unit u86" src="img/x.gif" alt="<?php echo U86; ?>"/><a onclick="return Popup(86,1);" href="#"><?php echo U86; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(20,4);"><?php echo STABLE;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(87) &&!$technology->getTech(87)):?>
<tr><td class="desc"><div class="tit"><img class="unit u87" src="img/x.gif" alt="<?php echo U87; ?>"/><a onclick="return Popup(87,1);" href="#"><?php echo U87; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 1</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(88) &&!$technology->getTech(88)):?>
<tr><td class="desc"><div class="tit"><img class="unit u88" src="img/x.gif" alt="<?php echo U88; ?>"/><a onclick="return Popup(88,1);" href="#"><?php echo U88; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 15</span><br><a href="#" onclick="return Popup(21,4);"><?php echo WORKSHOP;?></a> <span><?php echo LEVEL;?> 10</span></td></tr>
<?php endif;?>
<?php if (!$technology->meetRRequirement(89) &&!$technology->getTech(89)):?>
<tr><td class="desc"><div class="tit"><img class="unit u89" src="img/x.gif" alt="<?php echo U89; ?>"/><a onclick="return Popup(89,1);" href="#"><?php echo U89; ?></a></div></td><td class="cond"><a href="#" onclick="return Popup(16,4);"><?php echo RALLYPOINT;?></a> <span><?php echo LEVEL;?> 10</span><br><a href="#" onclick="return Popup(22,4);"><?php echo ACADEMY;?></a> <span><?php echo LEVEL;?> 20</span></td></tr>
<?php endif;?>
</tbody>
</table>
<?php endif;?>
<?php if (count($acares)>0):?>
<table cellpadding="1" cellspacing="1" class="under_progress">
<thead><tr><td><?php echo RESEARCHING;?></td><td><?php echo DURATION;?></td><td><?php echo COMPLETE;?></td></tr></thead>
<tbody>
<?php foreach ($acares as $aca): $unit=(int)substr($aca['tech'],1,2); $name=$technology->getUnitName($unit); $date=$generator->procMtime($aca['timestamp']);?>
<tr><td class="desc"><img class="unit u<?php echo $unit;?>" src="img/x.gif" alt="<?php echo htmlspecialchars($name);?>"/><?php echo htmlspecialchars($name);?></td><td class="dur"><span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($aca['timestamp']-time());?></span></td><td class="fin"><span><?php echo $date[1];?></span><span> <?php echo TZ_HRS; ?></span></td></tr>
<?php endforeach;?>
</tbody>
</table>
<?php endif;?>
+2 -1
View File
@@ -21,8 +21,9 @@
global $session, $technology, $village, $database, $building, $bid29, $generator, $id;
global $unitsbytype;
$start = ($session->tribe - 1) * 10 + 1;
$end = ($session->tribe - 1) * 10 + 4;
$end = $session->tribe * 10;
$level = (int)$village->resarray['f'.$id];
for ($i = $start; $i <= $end; $i++):
+3 -2
View File
@@ -21,8 +21,9 @@
global $session, $technology, $village, $database, $building, $bid30, $bid41, $generator, $id;
$start = ($session->tribe - 1) * 10 + 3;
$end = ($session->tribe - 1) * 10 + 6;
global $unitsbytype;
$start = ($session->tribe - 1) * 10 + 1;
$end = $session->tribe * 10;
$level = (int)$village->resarray['f'.$id];
$horseDrinking = $building->getTypeLevel(41);
$success = 0;
+20
View File
@@ -47,6 +47,26 @@
24 => U24,
25 => U25,
26 => U26,
51 => U51,
53 => U53,
54 => U54,
55 => U55,
56 => U56,
61 => U61,
62 => U62,
63 => U63,
65 => U65,
66 => U66,
71 => U71,
72 => U72,
73 => U73,
75 => U75,
76 => U76,
81 => U81,
83 => U83,
84 => U84,
85 => U85,
86 => U86,
];
?>
+26 -4
View File
@@ -1,8 +1,22 @@
<?php
#################################################################################
# T4 hero adventures tab (37_adventures.tpl) - Phase 6 #
# POST: t4action=startadv, advid. Countdown spans reuse the existing #
# $session->timer JS convention (same as 37.tpl's training timer). #
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : HERO T4 ADVENTURES PAGE ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
$t4Adventures = new HeroAdventure();
@@ -57,7 +71,15 @@ $t4Now = time();
<?php if (count($t4Offers)) { ?>
<?php foreach ($t4Offers as $t4Offer) { ?>
<tr>
<td><?php echo ((int) $t4Offer['difficulty'] === 1) ? HERO_ADV_DIFF_HARD : HERO_ADV_DIFF_NORMAL; ?></td>
<td>
<?php if ((int)$t4Offer['difficulty'] === 1): ?>
<img src="img/hero/dangerGreat.gif" alt="hard" title="<?php echo HERO_ADV_DIFF_HARD; ?>" style="vertical-align:middle; margin-right:4px; width:16px; height:16px;">
<?php echo HERO_ADV_DIFF_HARD; ?>
<?php else: ?>
<img src="img/hero/danger.gif" alt="normal" title="<?php echo HERO_ADV_DIFF_NORMAL; ?>" style="vertical-align:middle; margin-right:4px; width:16px; height:16px;">
<?php echo HERO_ADV_DIFF_NORMAL; ?>
<?php endif; ?>
</td>
<td><?php echo $generator->getTimeFormat((int) $t4Offer['duration']); ?></td>
<td><span id="timer<?php echo ++$session->timer; ?>"><?php echo $generator->getTimeFormat(max(0, $t4Offer['expire'] - $t4Now)); ?></span></td>
<td style="width:140px;text-align:center;">
+17 -5
View File
@@ -1,10 +1,22 @@
<?php
#################################################################################
# T4 hero auction tab (37_auction.tpl) - Phase 6 #
# POST actions: #
# t4action=bid (aucid, maxbid) #
# t4action=sell (rowid, qty, price, duration) #
# bid_max is only ever shown for the viewer's OWN bids (getMyBids). #
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : HERO T4 AUCTION PAGE ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
$t4Auction = new HeroAuction();
+17 -4
View File
@@ -1,9 +1,22 @@
<?php
#################################################################################
# T4 hero inventory & equipment tab (37_items.tpl) - Phase 6 #
# Inline POST handling (same convention as 37_hero.tpl's rename form): #
# t4action=equip|unequip|useitem, rowid, qty #
# Law tablets target the CURRENT village ($village->wid). #
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : HERO T4 ITEMS PAGE ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
$t4Msg = '';
+1 -1
View File
@@ -152,7 +152,7 @@ foreach ($heroes as $hero_datarow) {
</table>
<?php
} elseif (!$reviving) {
if (in_array($hero_datarow['unit'], [1, 11, 21])) {
if (in_array($hero_datarow['unit'], [1, 11, 21, 51, 61, 71, 81])) {
// basic unit of the tribe - available without research
echo $renderReviveRow($hero_datarow, $name, $wood, $clay, $iron, $crop, $training_time, $id);
} else {
+18 -3
View File
@@ -1,10 +1,25 @@
<?php
#################################################################################
# T4 hero mansion tab navigation (37_t4nav.tpl) - Phase 6 #
# Included by 37.tpl with $t4tab set to 'hero'|'items'|'adventures'|'auction'. #
# Silver balance shown on the right; reuses existing anchor styling. #
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : HERO T4 NAV BAR ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
$t4HeroItems = new HeroItems();
$t4Silver = $t4HeroItems->getSilver($session->uid);
$t4Tabs = [
+24
View File
@@ -67,6 +67,26 @@ $unitData = [
24 => $u24 ?? [],
25 => $u25 ?? [],
26 => $u26 ?? [],
51 => $u51 ?? [],
53 => $u53 ?? [],
54 => $u54 ?? [],
55 => $u55 ?? [],
56 => $u56 ?? [],
61 => $u61 ?? [],
62 => $u62 ?? [],
63 => $u63 ?? [],
65 => $u65 ?? [],
66 => $u66 ?? [],
71 => $u71 ?? [],
72 => $u72 ?? [],
73 => $u73 ?? [],
75 => $u75 ?? [],
76 => $u76 ?? [],
81 => $u81 ?? [],
83 => $u83 ?? [],
84 => $u84 ?? [],
85 => $u85 ?? [],
86 => $u86 ?? [],
];
// The single source of truth for "which units belong to each tribe", used
@@ -79,6 +99,10 @@ $tribeUnits = [
1 => [1, 2, 3, 5, 6],
2 => [11, 12, 13, 15, 16],
3 => [21, 22, 24, 25, 26],
6 => [51, 53, 54, 55, 56],
7 => [61, 62, 63, 65, 66],
8 => [71, 72, 73, 75, 76],
9 => [81, 83, 84, 85, 86],
];
// The 2 pre-existing bugs, explicitly identified on the unit (see note above).
+21 -48
View File
@@ -3,11 +3,11 @@
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : GREATWORKSHOP ##
## Filename : STONEWALL ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Refactored by : Shadow ##
## Redesign by : Shadow ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
@@ -19,59 +19,32 @@
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $building, $technology, $generator, $session, $id;
global $village, $building, $bid42, $id, $loopsame, $doublebuild, $master;
include("next.tpl");
$level = (int)$village->resarray['f'.$id];
$current = $level > 0 ? (int)$bid42[$level]['attri'] : 0;
?>
<div id="build" class="gid42">
<a href="#" onClick="return Popup(42,4);" class="build_logo">
<img class="building g42" src="img/x.gif" alt="<?php echo GREATWORKSHOP; ?>" title="<?php echo GREATWORKSHOP;?>" />
</a>
<h1><?php echo GREATWORKSHOP;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc"><?php echo GREATWORKSHOP_DESC;?></p>
<h1><?php echo STONEWALL;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc"><?php echo STONEWALL_DESC;?></p>
<?php if ($building->getTypeLevel(42) > 0):?>
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
<input type="hidden" name="ft" value="t3" />
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr><td><?php echo NAME;?></td><td><?php echo QUANTITY;?></td><td><?php echo MAX;?></td></tr></thead>
<tbody>
<?php include("42_train.tpl");?>
</tbody>
</table>
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="<?php echo TRAIN; ?>" /></p>
</form>
<?php else:?>
<b><?php echo TRAINING_COMMENCE_GREATWORKSHOP;?></b><br />
<?php endif;?>
<?php
$trainlist = $technology->getTrainingList(7);
if (!empty($trainlist)): $TrainCount = 0; $NextFinished = '';
?>
<table cellpadding="1" cellspacing="1" class="under_progress">
<thead><tr><td><?php echo TRAINING;?></td><td><?php echo DURATION;?></td><td><?php echo FINISHED;?></td></tr></thead>
<tbody>
<?php foreach ($trainlist as $train): $TrainCount++;?>
<tr>
<td class="desc"><img class="unit u<?php echo $train['unit'];?>" src="img/x.gif" alt="<?php echo $train['name'];?>" title="<?php echo $train['name'];?>" /><?php echo $train['amt'];?> <?php echo $train['name'];?></td>
<td class="dur">
<?php if ($TrainCount == 1): $NextFinished = $generator->getTimeFormat($train['timestamp2'] - time());?>
<span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($train['timestamp'] - time());?></span>
<?php else:?>
<?php echo $generator->getTimeFormat($train['eachtime'] * $train['amt']);?>
<?php endif;?>
</td>
<td class="fin"><?php $time = $generator->procMTime($train['timestamp']); if($time[0]!="today") echo "on ".$time[0]." at "; echo $time[1];?></td>
</tr>
<?php endforeach;?>
<tr class="next"><td colspan="3"><?php echo UNIT_FINISHED;?> <span id="timer<?php echo ++$session->timer;?>"><?php echo $NextFinished;?></span></td></tr>
</tbody>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo DEFENCE_NOW;?></th>
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
</tr>
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
$next = $level + 1 + $loopsame + $doublebuild + $master;
$next = $next > 20 ? 20 : $next;
?>
<tr>
<th><?php echo DEFENCE_LEVEL;?> <?php echo $next;?>:</th>
<td><b><?php echo (int)$bid42[$next]['attri'];?></b> <?php echo PERCENT;?></td>
</tr>
<?php endif;?>
</table>
<?php endif;?>
<?php include("upgrade.tpl");?>
</div>
+50
View File
@@ -0,0 +1,50 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : MAKESHIFTWALL ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $building, $bid43, $id, $loopsame, $doublebuild, $master;
include("next.tpl");
$level = (int)$village->resarray['f'.$id];
$current = $level > 0 ? (int)$bid43[$level]['attri'] : 0;
?>
<div id="build" class="gid43">
<h1><?php echo MAKESHIFTWALL;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc"><?php echo MAKESHIFTWALL_DESC;?></p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo DEFENCE_NOW;?></th>
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
</tr>
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
$next = $level + 1 + $loopsame + $doublebuild + $master;
$next = $next > 20 ? 20 : $next;
?>
<tr>
<th><?php echo DEFENCE_LEVEL;?> <?php echo $next;?>:</th>
<td><b><?php echo (int)$bid43[$next]['attri'];?></b> <?php echo PERCENT;?></td>
</tr>
<?php endif;?>
</table>
<?php include("upgrade.tpl");?>
</div>
+48
View File
@@ -0,0 +1,48 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : COMMANDCENTER ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $id;
$level = (int)$village->resarray['f'.$id];
?>
<div id="build" class="gid44">
<h1><?php echo COMMANDCENTER;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc">
<a href="#" onClick="return Popup(44,4, 'gid');" class="build_logo">
<img class="building g44" src="img/x.gif" alt="<?php echo COMMANDCENTER; ?>" title="<?php echo COMMANDCENTER;?>" />
</a>
<?php echo COMMANDCENTER_DESC;?>
</p>
<?php if ($village->capital == 1):?>
<p class="act"><?php echo CAPITAL;?></p>
<?php endif;?>
<?php include("25_menu.tpl"); ?>
<?php if ($level >= 10):?>
<?php include("44_train.tpl");?>
<?php else:?>
<div class="c"><?php echo COMMANDCENTER_TRAIN_DESC;?></div>
<?php endif;?>
<?php include("upgrade.tpl");?>
</div>
+57
View File
@@ -0,0 +1,57 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : COMMANDCENTER CULTURE POINTS ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $database, $session, $id;
$level = (int)$village->resarray['f'.$id];
$isNatar = (int)$database->getVillageField($village->wid, 'natar') == 1;
$villageCp = $isNatar ? 0 : (int)$database->getVillageField($village->wid, 'cp');
$accountCp = (int)$database->getVSumField($session->uid, 'cp');
$totalVillages = count($database->getProfileVillages($session->uid));
$mode = CP;
$nextCpNeeded = ${'cp'.$mode}[$totalVillages + 1];
?>
<div id="build" class="gid44">
<h1><?php echo COMMANDCENTER;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc">
<a href="#" onClick="return Popup(44,4, 'gid');" class="build_logo">
<img class="building g44" src="img/x.gif" alt="<?php echo COMMANDCENTER; ?>" title="<?php echo COMMANDCENTER;?>" />
</a>
<?php echo COMMANDCENTER_DESC;?>
</p>
<?php include("25_menu.tpl"); ?>
<p><?php echo COMMANDCENTER_CULTURE_DESC;?></p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo PRODUCTION_POINTS;?></th>
<td><b><?php echo $villageCp;?></b> <?php echo POINTS_DAY;?></td>
</tr>
<tr>
<th><?php echo PRODUCTION_ALL_POINTS;?></th>
<td><b><?php echo $accountCp;?></b> <?php echo POINTS_DAY;?></td>
</tr>
</table>
<p><?php echo VILLAGES_PRODUCED;?> <b><?php echo $session->cp;?></b> <?php echo POINTS_NEED;?> <b><?php echo $nextCpNeeded;?></b> <?php echo POINTS;?>.</p>
</div>
+39
View File
@@ -0,0 +1,39 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : COMMANDCENTER LOYALTY ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $database, $id;
$level = (int)$village->resarray['f'.$id];
$loyalty = floor((float)$database->getVillageField($village->wid, 'loyalty'));
?>
<div id="build" class="gid44">
<h1><?php echo COMMANDCENTER;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc">
<a href="#" onClick="return Popup(44,4, 'gid');" class="build_logo">
<img class="building g44" src="img/x.gif" alt="<?php echo COMMANDCENTER; ?>" title="<?php echo COMMANDCENTER;?>" />
</a>
<?php echo COMMANDCENTER_DESC;?>
</p>
<?php include("25_menu.tpl"); ?>
<p><?php echo COMMANDCENTER_LOYALTY_DESC;?> <b><?php echo $loyalty;?></b> <?php echo PERCENT;?>.</p>
</div>
+75
View File
@@ -0,0 +1,75 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : COMMANDCENTER EXPANSION ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $database, $generator, $id;
$level = (int)$village->resarray['f'.$id];
$slots = [
(int)$database->getVillageField($village->wid, 'exp1'),
(int)$database->getVillageField($village->wid, 'exp2'),
(int)$database->getVillageField($village->wid, 'exp3'),
];
?>
<div id="build" class="gid44">
<h1><?php echo COMMANDCENTER;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc">
<a href="#" onClick="return Popup(44,4, 'gid');" class="build_logo">
<img class="building g44" src="img/x.gif" alt="<?php echo COMMANDCENTER; ?>" title="<?php echo COMMANDCENTER;?>" />
</a>
<?php echo COMMANDCENTER_DESC;?>
</p>
<?php include("25_menu.tpl"); ?>
<table cellpadding="1" cellspacing="1" id="expansion">
<thead>
<tr><th colspan="6"><a name="h2"></a><?php echo CONQUERED_BY_VILLAGE;?></th></tr>
<tr>
<td colspan="2"><?php echo VILLAGE;?></td>
<td><?php echo PLAYER;?></td>
<td><?php echo INHABITANTS;?></td>
<td><?php echo COORDINATES;?></td>
<td><?php echo DATE;?></td>
</tr>
</thead>
<tbody>
<?php $hasSlots = false; foreach ($slots as $idx => $slotId): if ($slotId == 0) continue; $hasSlots = true;
$coor = $database->getCoor($slotId);
$vname = $database->getVillageField($slotId, 'name');
$owner = $database->getVillageField($slotId, 'owner');
$pop = $database->getVillageField($slotId, 'pop');
$vcreated = $database->getVillageField($slotId, 'created');
$ownername = $database->getUserField($owner, 'username', 0);
?>
<tr>
<td class="ra"><?php echo $idx+1;?>.</td>
<td class="vil"><a href="karte.php?d=<?php echo $slotId;?>&c=<?php echo $generator->getMapCheck($slotId);?>"><?php echo htmlspecialchars($vname);?></a></td>
<td class="pla"><a href="spieler.php?uid=<?php echo $owner;?>"><?php echo htmlspecialchars($ownername);?></a></td>
<td class="ha"><?php echo (int)$pop;?></td>
<td class="aligned_coords"><div class="cox">(<?php echo $coor['x'];?></div><div class="pi">|</div><div class="coy"><?php echo $coor['y'];?>)</div></td>
<td class="dat"><?php echo date('d.m.Y', $vcreated);?></td>
</tr>
<?php endforeach; if (!$hasSlots):?>
<tr><td colspan="6" class="none"><?php echo NONE_CONQUERED_BY_VILLAGE;?></td></tr>
<?php endif;?>
</tbody>
</table>
</div>
+73
View File
@@ -0,0 +1,73 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : COMMANDCENTER TRAINING UNITS ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. 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><?php echo NAME; ?></td>
<td><?php echo QUANTITY; ?></td>
<td><?php echo 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 = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, round(${'u'.$i}['time'] * ($bid44[$village->resarray['f'.$id]]['attri'] / 100) / SPEED));
echo $generator->getTimeFormat($dur);
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'u'.$i}['wood']."&r2=".${'u'.$i}['clay']."&r3=".${'u'.$i}['iron']."&r4=".${'u'.$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="<?php echo TRAIN; ?>" />
</p>
</form>
<?php
}
else echo '<div class="c">'.COMMANDCENTER_TRAIN_DESC.'</div>';
include ("25_progress.tpl");
?>
+54
View File
@@ -0,0 +1,54 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : WATERWORKS ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $building, $bid45, $id, $loopsame, $doublebuild, $master;
include("next.tpl");
$level = (int)$village->resarray['f'.$id];
$current = $level > 0 ? (int)round($bid45[$level]['attri'] * 100) : 0;
?>
<div id="build" class="gid45">
<a href="#" onClick="return Popup(45,4);" class="build_logo">
<img class="building g45" src="img/x.gif" alt="<?php echo WATERWORKS; ?>" title="<?php echo WATERWORKS;?>" />
</a>
<h1><?php echo WATERWORKS;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc"><?php echo WATERWORKS_DESC;?></p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo CURRENT_BONUS;?></th>
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
</tr>
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
$next = $level + 1 + $loopsame + $doublebuild + $master;
$next = $next > 20 ? 20 : $next;
$nextBonus = (int)round($bid45[$next]['attri'] * 100);
?>
<tr>
<th><?php echo BONUS_LEVEL;?> <?php echo $next;?>:</th>
<td><b><?php echo $nextBonus;?></b> <?php echo PERCENT;?></td>
</tr>
<?php endif;?>
</table>
<?php include("upgrade.tpl");?>
</div>
+101
View File
@@ -0,0 +1,101 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : HOSPITAL ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $building, $database, $technology, $bid46, $id, $loopsame, $doublebuild, $master;
include("next.tpl");
$level = (int)$village->resarray['f'.$id];
$current = $level > 0 ? (int)round($bid46[$level]['attri'] * 100) : 100;
?>
<div id="build" class="gid46">
<a href="#" onClick="return Popup(46,4);" class="build_logo">
<img class="building g46" src="img/x.gif" alt="<?php echo HOSPITAL; ?>" title="<?php echo HOSPITAL;?>" />
</a>
<h1><?php echo HOSPITAL;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc"><?php echo HOSPITAL_DESC;?></p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo HEALING_TIME_NOW;?></th>
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
</tr>
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
$next = $level + 1 + $loopsame + $doublebuild + $master;
$next = $next > 20 ? 20 : $next;
$nextFactor = (int)round($bid46[$next]['attri'] * 100);
?>
<tr>
<th><?php echo HEALING_TIME_LEVEL;?> <?php echo $next;?>:</th>
<td><b><?php echo $nextFactor;?></b> <?php echo PERCENT;?></td>
</tr>
<?php endif;?>
</table>
<?php
// ==================== RANITI + VINDECARE ====================
$woundedRows = $database->getWounded($village->wid);
$healingRows = $database->getHealing($village->wid);
$hasWounded = false;
if (!empty($woundedRows)) {
for ($wi = 1; $wi <= 90; $wi++) {
if (!empty($woundedRows['u'.$wi])) { $hasWounded = true; break; }
}
}
?>
<h4 class="hosp"><?php echo WOUNDED_TROOPS; ?></h4>
<?php if ($hasWounded && $level > 0): ?>
<form method="post" action="build.php?id=<?php echo (int)$id; ?>">
<table cellpadding="1" cellspacing="1" id="hospital_wounded">
<?php for ($wi = 1; $wi <= 90; $wi++): if (empty($woundedRows['u'.$wi])) continue; ?>
<tr>
<td class="ico"><img class="unit u<?php echo $wi; ?>" src="img/x.gif" alt="" /></td>
<td class="desc"><?php echo $technology->getUnitName($wi); ?></td>
<td class="val"><b><?php echo (int)$woundedRows['u'.$wi]; ?></b></td>
<td class="val"><input class="text" type="text" name="hamt[<?php echo $wi; ?>]" value="0" maxlength="6" /></td>
<td><button type="submit" name="hunit" value="<?php echo $wi; ?>" class="trav_buttons"><?php echo HEAL_BUTTON; ?></button></td>
</tr>
<?php endfor; ?>
</table>
<input type="hidden" name="ft" value="heal" />
</form>
<p class="c"><?php echo HEAL_COST_HINT; ?></p>
<?php else: ?>
<p class="none"><?php echo NO_WOUNDED; ?></p>
<?php endif; ?>
<?php if (!empty($healingRows)): ?>
<h4 class="hosp"><?php echo HEALING_IN_PROGRESS; ?></h4>
<table cellpadding="1" cellspacing="1" id="hospital_healing">
<?php foreach ($healingRows as $hr):
$doneAt = (int)$hr['timestamp2'] + ((int)$hr['amt'] - 1) * (int)$hr['eachtime']; ?>
<tr>
<td class="ico"><img class="unit u<?php echo (int)$hr['unit']; ?>" src="img/x.gif" alt="" /></td>
<td class="desc"><?php echo (int)$hr['amt']; ?> x <?php echo $technology->getUnitName((int)$hr['unit']); ?></td>
<td class="val"><?php echo date("H:i:s", $doneAt); ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<?php include("upgrade.tpl");?>
</div>
+50
View File
@@ -0,0 +1,50 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : DEFENSIVEWALL ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $building, $bid47, $id, $loopsame, $doublebuild, $master;
include("next.tpl");
$level = (int)$village->resarray['f'.$id];
$current = $level > 0 ? (int)$bid47[$level]['attri'] : 0;
?>
<div id="build" class="gid47">
<h1><?php echo DEFENSIVEWALL;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc"><?php echo DEFENSIVEWALL_DESC;?></p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo DEFENCE_NOW;?></th>
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
</tr>
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
$next = $level + 1 + $loopsame + $doublebuild + $master;
$next = $next > 20 ? 20 : $next;
?>
<tr>
<th><?php echo DEFENCE_LEVEL;?> <?php echo $next;?>:</th>
<td><b><?php echo (int)$bid47[$next]['attri'];?></b> <?php echo PERCENT;?></td>
</tr>
<?php endif;?>
</table>
<?php include("upgrade.tpl");?>
</div>
+101
View File
@@ -0,0 +1,101 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : BIGHOSPITAL ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $building, $database, $technology, $bid48, $id, $loopsame, $doublebuild, $master;
include("next.tpl");
$level = (int)$village->resarray['f'.$id];
$current = $level > 0 ? (int)round($bid48[$level]['attri'] * 100) : 100;
?>
<div id="build" class="gid48">
<a href="#" onClick="return Popup(48,4);" class="build_logo">
<img class="building g48" src="img/x.gif" alt="<?php echo BIGHOSPITAL; ?>" title="<?php echo BIGHOSPITAL;?>" />
</a>
<h1><?php echo BIGHOSPITAL;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc"><?php echo BIGHOSPITAL_DESC;?></p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo HEALING_TIME_NOW;?></th>
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
</tr>
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
$next = $level + 1 + $loopsame + $doublebuild + $master;
$next = $next > 20 ? 20 : $next;
$nextFactor = (int)round($bid48[$next]['attri'] * 100);
?>
<tr>
<th><?php echo HEALING_TIME_LEVEL;?> <?php echo $next;?>:</th>
<td><b><?php echo $nextFactor;?></b> <?php echo PERCENT;?></td>
</tr>
<?php endif;?>
</table>
<?php
// ==================== RANITI + VINDECARE ====================
$woundedRows = $database->getWounded($village->wid);
$healingRows = $database->getHealing($village->wid);
$hasWounded = false;
if (!empty($woundedRows)) {
for ($wi = 1; $wi <= 90; $wi++) {
if (!empty($woundedRows['u'.$wi])) { $hasWounded = true; break; }
}
}
?>
<h4 class="hosp"><?php echo WOUNDED_TROOPS; ?></h4>
<?php if ($hasWounded && $level > 0): ?>
<form method="post" action="build.php?id=<?php echo (int)$id; ?>">
<table cellpadding="1" cellspacing="1" id="hospital_wounded">
<?php for ($wi = 1; $wi <= 90; $wi++): if (empty($woundedRows['u'.$wi])) continue; ?>
<tr>
<td class="ico"><img class="unit u<?php echo $wi; ?>" src="img/x.gif" alt="" /></td>
<td class="desc"><?php echo $technology->getUnitName($wi); ?></td>
<td class="val"><b><?php echo (int)$woundedRows['u'.$wi]; ?></b></td>
<td class="val"><input class="text" type="text" name="hamt[<?php echo $wi; ?>]" value="0" maxlength="6" /></td>
<td><button type="submit" name="hunit" value="<?php echo $wi; ?>" class="trav_buttons"><?php echo HEAL_BUTTON; ?></button></td>
</tr>
<?php endfor; ?>
</table>
<input type="hidden" name="ft" value="heal" />
</form>
<p class="c"><?php echo HEAL_COST_HINT; ?></p>
<?php else: ?>
<p class="none"><?php echo NO_WOUNDED; ?></p>
<?php endif; ?>
<?php if (!empty($healingRows)): ?>
<h4 class="hosp"><?php echo HEALING_IN_PROGRESS; ?></h4>
<table cellpadding="1" cellspacing="1" id="hospital_healing">
<?php foreach ($healingRows as $hr):
$doneAt = (int)$hr['timestamp2'] + ((int)$hr['amt'] - 1) * (int)$hr['eachtime']; ?>
<tr>
<td class="ico"><img class="unit u<?php echo (int)$hr['unit']; ?>" src="img/x.gif" alt="" /></td>
<td class="desc"><?php echo (int)$hr['amt']; ?> x <?php echo $technology->getUnitName((int)$hr['unit']); ?></td>
<td class="val"><?php echo date("H:i:s", $doneAt); ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php endif; ?>
<?php include("upgrade.tpl");?>
</div>
+77
View File
@@ -0,0 +1,77 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : GREATWORKSHOP ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Refactored by : Shadow ##
## Redesign by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $building, $technology, $generator, $session, $id;
include("next.tpl");
$level = (int)$village->resarray['f'.$id];
?>
<div id="build" class="gid49">
<a href="#" onClick="return Popup(49,4);" class="build_logo">
<img class="building g49" src="img/x.gif" alt="<?php echo GREATWORKSHOP; ?>" title="<?php echo GREATWORKSHOP;?>" />
</a>
<h1><?php echo GREATWORKSHOP;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc"><?php echo GREATWORKSHOP_DESC;?></p>
<?php if ($building->getTypeLevel(49) > 0):?>
<form method="POST" name="snd" action="build.php">
<input type="hidden" name="id" value="<?php echo (int)$id;?>" />
<input type="hidden" name="ft" value="t3" />
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr><td><?php echo NAME;?></td><td><?php echo QUANTITY;?></td><td><?php echo MAX;?></td></tr></thead>
<tbody>
<?php include("49_train.tpl");?>
</tbody>
</table>
<p><input type="image" id="btn_train" class="dynamic_img" value="ok" name="s1" src="img/x.gif" alt="<?php echo TRAIN; ?>" /></p>
</form>
<?php else:?>
<b><?php echo TRAINING_COMMENCE_GREATWORKSHOP;?></b><br />
<?php endif;?>
<?php
$trainlist = $technology->getTrainingList(7);
if (!empty($trainlist)): $TrainCount = 0; $NextFinished = '';
?>
<table cellpadding="1" cellspacing="1" class="under_progress">
<thead><tr><td><?php echo TRAINING;?></td><td><?php echo DURATION;?></td><td><?php echo FINISHED;?></td></tr></thead>
<tbody>
<?php foreach ($trainlist as $train): $TrainCount++;?>
<tr>
<td class="desc"><img class="unit u<?php echo $train['unit'];?>" src="img/x.gif" alt="<?php echo $train['name'];?>" title="<?php echo $train['name'];?>" /><?php echo $train['amt'];?> <?php echo $train['name'];?></td>
<td class="dur">
<?php if ($TrainCount == 1): $NextFinished = $generator->getTimeFormat($train['timestamp2'] - time());?>
<span id="timer<?php echo ++$session->timer;?>"><?php echo $generator->getTimeFormat($train['timestamp'] - time());?></span>
<?php else:?>
<?php echo $generator->getTimeFormat($train['eachtime'] * $train['amt']);?>
<?php endif;?>
</td>
<td class="fin"><?php $time = $generator->procMTime($train['timestamp']); if($time[0]!="today") echo "on ".$time[0]." at "; echo $time[1];?></td>
</tr>
<?php endforeach;?>
<tr class="next"><td colspan="3"><?php echo UNIT_FINISHED;?> <span id="timer<?php echo ++$session->timer;?>"><?php echo $NextFinished;?></span></td></tr>
</tbody>
</table>
<?php endif;?>
<?php include("upgrade.tpl");?>
</div>
@@ -19,9 +19,10 @@
## --------------------------------------------------------------------------- ##
#################################################################################
global $session, $technology, $village, $generator, $database, $building, $bid42, $id;
global $session, $technology, $village, $generator, $database, $building, $bid49, $id;
$success = 0;
global $unitsbytype;
$start = ($session->tribe - 1) * 10 + 7;
$end = $start + 1; // ram + catapult
@@ -39,7 +40,7 @@ for ($i = $start; $i <= $end; $i++) {
$dur = $database->getArtifactsValueInfluence(
$session->uid, $village->wid, 5,
round($unit['time'] * ($bid42[$village->resarray['f'.$id]]['attri'] / 100) / SPEED)
round($unit['time'] * ($bid49[$village->resarray['f'.$id]]['attri'] / 100) / SPEED)
);
$max = $technology->maxUnit($i, true);
?>
+50
View File
@@ -0,0 +1,50 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename : BARRICADE ##
## Type : BUILDING TEMPLATE ##
## --------------------------------------------------------------------------- ##
## Created by : Shadow ##
## Designed by : Shadow ##
## --------------------------------------------------------------------------- ##
## Contact : cata7007@gmail.com ##
## Project : TravianZ ##
## Test Server : https://travianz.org ##
## GitHub : https://github.com/Shadowss/TravianZ ##
## --------------------------------------------------------------------------- ##
## License : TravianZ Project ##
## Copyright : TravianZ (c) 2010-2026. All rights reserved. ##
## --------------------------------------------------------------------------- ##
#################################################################################
global $village, $building, $bid50, $id, $loopsame, $doublebuild, $master;
include("next.tpl");
$level = (int)$village->resarray['f'.$id];
$current = $level > 0 ? (int)$bid50[$level]['attri'] : 0;
?>
<div id="build" class="gid50">
<h1><?php echo BARRICADE;?> <span class="level"><?php echo LEVEL;?> <?php echo $level;?></span></h1>
<p class="build_desc"><?php echo BARRICADE_DESC;?></p>
<table cellpadding="1" cellspacing="1" id="build_value">
<tr>
<th><?php echo DEFENCE_NOW;?></th>
<td><b><?php echo $current;?></b> <?php echo PERCENT;?></td>
</tr>
<?php if (!$building->isMax($village->resarray['f'.$id.'t'], $id)):
$next = $level + 1 + $loopsame + $doublebuild + $master;
$next = $next > 20 ? 20 : $next;
?>
<tr>
<th><?php echo DEFENCE_LEVEL;?> <?php echo $next;?>:</th>
<td><b><?php echo (int)$bid50[$next]['attri'];?></b> <?php echo PERCENT;?></td>
</tr>
<?php endif;?>
</table>
<?php include("upgrade.tpl");?>
</div>
+55 -7
View File
@@ -61,10 +61,18 @@ $horsedrinkingtrough = $building->getTypeLevel(41);
$herosmansion = $building->getTypeLevel(37);
$greatwarehouse = $building->getTypeLevel(38);
$greatgranary = $building->getTypeLevel(39);
$greatworkshop = $building->getTypeLevel(42);
$greatworkshop = $building->getTypeLevel(49);
$stonewall = $building->getTypeLevel(42);
$makeshiftwall = $building->getTypeLevel(43);
$commandcenter = $building->getTypeLevel(44);
$waterworks = $building->getTypeLevel(45);
$hospital = $building->getTypeLevel(46);
$defensivewall = $building->getTypeLevel(47);
$bighospital = $building->getTypeLevel(48);
$barricade = $building->getTypeLevel(50);
$typesArray = [];
for ($i = 1; $i <= 42; $i++) {
for ($i = 1; $i <= 50; $i++) {
$typesArray[] = $i;
}
@@ -116,7 +124,11 @@ $horsedrinkingtrough1 = getTypeCount(41);
$herosmansion1 = getTypeCount(37);
$greatwarehouse1 = getTypeCount(38);
$greatgranary1 = getTypeCount(39);
$greatworkshop1 = getTypeCount(42);
$greatworkshop1 = getTypeCount(49);
$commandcenter1 = getTypeCount(44);
$waterworks1 = getTypeCount(45);
$hospital1 = getTypeCount(46);
$bighospital1 = getTypeCount(48);
?>
<div id="build" class="gid0"><h1><?php echo CONSTRUCT_NEW_BUILDING;?></h1>
@@ -146,6 +158,18 @@ if($wall == 0 && $wall1 == 0) {
if($session->tribe == 5 && $id == 40) {
include("avaliable/citywall.tpl");
}
if($session->tribe == 6 && $id == 40) {
include("avaliable/makeshiftwall.tpl");
}
if($session->tribe == 7 && $id == 40) {
include("avaliable/stonewall.tpl");
}
if($session->tribe == 8 && $id == 40) {
include("avaliable/defensivewall.tpl");
}
if($session->tribe == 9 && $id == 40) {
include("avaliable/barricade.tpl");
}
}
if((($warehouse == 0 && $warehouse1 == 0) || $warehouse == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40) {
include("avaliable/warehouse.tpl");
@@ -184,13 +208,13 @@ if($granary >= 1 && $warehouse >= 1 && $mainbuilding >= 3 && $market == 0 && $ma
include("avaliable/marketplace.tpl");
}
if($mainbuilding >= 5 && $residence == 0 && $residence1 == 0 && $id != 39 && $id != 40 && $palace == 0 && $palace1 == 0) {
include("avaliable/residence.tpl");
if($session->tribe != 6) include("avaliable/residence.tpl");
}
if($academy == 0 && $academy1 == 0 && $mainbuilding >= 3 && $barrack >= 3 && $id != 39 && $id != 40) {
include("avaliable/academy.tpl");
}
if($palace == 0 && $palace1 == 0 && !$building->isCastleBuilt() && $village->natar == 0 && $embassy >= 1 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $residence == 0 && $residence1 == 0) {
include("avaliable/palace.tpl");
if($session->tribe != 6) include("avaliable/palace.tpl");
}
if($blacksmith == 0 && $blacksmith1 == 0 && $academy >= 3 && $mainbuilding >= 3 && $id != 39 && $id != 40) {
include("avaliable/blacksmith.tpl");
@@ -234,6 +258,18 @@ if($session->tribe == 1 && $horsedrinkingtrough == 0 && $horsedrinkingtrough1 ==
if($session->tribe == 2 && $village->capital == 1 && $brewery == 0 && $brewery1 == 0 && $rallypoint >= 10 && $granary == 20 && $id != 39 && $id != 40) {
include("avaliable/brewery.tpl");
}
if($session->tribe == 6 && $commandcenter == 0 && $commandcenter1 == 0 && $mainbuilding >= 5 && $residence == 0 && $residence1 == 0 && $palace == 0 && $palace1 == 0 && $id != 39 && $id != 40) {
include("avaliable/commandcenter.tpl");
}
if($session->tribe == 7 && $waterworks == 0 && $waterworks1 == 0 && $herosmansion >= 10 && $id != 39 && $id != 40) {
include("avaliable/waterworks.tpl");
}
if($session->tribe != 8 && $session->tribe != 9 && $hospital == 0 && $hospital1 == 0 && $mainbuilding >= 10 && $academy >= 15 && $id != 39 && $id != 40) {
include("avaliable/hospital.tpl");
}
if(($session->tribe == 8 || $session->tribe == 9) && $bighospital == 0 && $bighospital1 == 0 && $mainbuilding >= 10 && $academy >= 15 && $id != 39 && $id != 40) {
include("avaliable/bighospital.tpl");
}
if($greatbarracks == 0 && $greatbarracks1 == 0 && $barrack == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
include("avaliable/greatbarracks.tpl");
}
@@ -274,13 +310,13 @@ if($market == 0 && ($mainbuilding <= 2 || $granary <= 0 || $warehouse <= 0)) {
include("soon/marketplace.tpl");
}
if($residence == 0 && $mainbuilding <= 4) {
include("soon/residence.tpl");
if($session->tribe != 6) include("soon/residence.tpl");
}
if($academy == 0 && ($mainbuilding <= 2 || $barrack <= 2)) {
include("soon/academy.tpl");
}
if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4 && !$building->isCastleBuilt() && $village->natar == 0) {
include("soon/palace.tpl");
if($session->tribe != 6) include("soon/palace.tpl");
}
if($blacksmith == 0 && ($academy <= 2 || $mainbuilding <= 2)) {
include("soon/blacksmith.tpl");
@@ -324,6 +360,18 @@ if($session->tribe == 1 && $horsedrinkingtrough == 0 && $rallypoint <= 9 && $ral
if($brewery == 0 && $village->capital == 1 && $rallypoint <= 9 && $rallypoint >= 5 || $granary <= 19 && $granary >= 10 && $session->tribe == 2) {
include("soon/brewery.tpl");
}
if($session->tribe == 6 && $commandcenter == 0 && $commandcenter1 == 0 && $mainbuilding < 5 && $residence == 0 && $residence1 == 0 && $palace == 0 && $palace1 == 0) {
include("soon/commandcenter.tpl");
}
if($session->tribe == 7 && $waterworks == 0 && $waterworks1 == 0 && $herosmansion < 10) {
include("soon/waterworks.tpl");
}
if($session->tribe != 8 && $session->tribe != 9 && $hospital == 0 && $hospital1 == 0 && ($mainbuilding < 10 || $academy < 15) && $academy >= 5) {
include("soon/hospital.tpl");
}
if(($session->tribe == 8 || $session->tribe == 9) && $bighospital == 0 && $bighospital1 == 0 && ($mainbuilding < 10 || $academy < 15) && $academy >= 5) {
include("soon/bighospital.tpl");
}
if($greatbarracks == 0 && $barrack >= 18 && $village->capital == 0) {
include("soon/greatbarracks.tpl");
}
+16
View File
@@ -0,0 +1,16 @@
<h2><?php echo BARRICADE ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo BARRICADE_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(50,4);">
<img class="building g50" src="img/x.gif" alt="<?php echo BARRICADE; ?>" title="<?php echo BARRICADE; ?>" /></a>
</td>
</tr>
<tr>
<?php
$_GET['bid'] = 50;
include("availupgrade.tpl");
?>
</tr></tbody>
</table>
+16
View File
@@ -0,0 +1,16 @@
<h2><?php echo BIGHOSPITAL ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo BIGHOSPITAL_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(48,4);">
<img class="building g48" src="img/x.gif" alt="<?php echo BIGHOSPITAL; ?>" title="<?php echo BIGHOSPITAL; ?>" /></a>
</td>
</tr>
<tr>
<?php
$_GET['bid'] = 48;
include("availupgrade.tpl");
?>
</tr></tbody>
</table>
@@ -0,0 +1,16 @@
<h2><?php echo COMMANDCENTER ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo COMMANDCENTER_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(44,4);">
<img class="building g44" src="img/x.gif" alt="<?php echo COMMANDCENTER; ?>" title="<?php echo COMMANDCENTER; ?>" /></a>
</td>
</tr>
<tr>
<?php
$_GET['bid'] = 44;
include("availupgrade.tpl");
?>
</tr></tbody>
</table>
@@ -0,0 +1,16 @@
<h2><?php echo DEFENSIVEWALL ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo DEFENSIVEWALL_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(47,4);">
<img class="building g47" src="img/x.gif" alt="<?php echo DEFENSIVEWALL; ?>" title="<?php echo DEFENSIVEWALL; ?>" /></a>
</td>
</tr>
<tr>
<?php
$_GET['bid'] = 47;
include("availupgrade.tpl");
?>
</tr></tbody>
</table>
+3 -3
View File
@@ -3,13 +3,13 @@
<tbody><tr>
<td class="desc"><?php echo GREATWORKSHOP_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(42,4);">
<img class="building g42" src="img/x.gif" alt="<?php echo GREATWORKSHOP; ?>" title="<?php echo GREATWORKSHOP; ?>" /></a>
<a href="#" onClick="return Popup(49,4);">
<img class="building g49" src="img/x.gif" alt="<?php echo GREATWORKSHOP; ?>" title="<?php echo GREATWORKSHOP; ?>" /></a>
</td>
</tr>
<tr>
<?php
$_GET['bid'] = 42;
$_GET['bid'] = 49;
include("availupgrade.tpl");
?>
</tr></tbody>
+16
View File
@@ -0,0 +1,16 @@
<h2><?php echo HOSPITAL ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo HOSPITAL_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(46,4);">
<img class="building g46" src="img/x.gif" alt="<?php echo HOSPITAL; ?>" title="<?php echo HOSPITAL; ?>" /></a>
</td>
</tr>
<tr>
<?php
$_GET['bid'] = 46;
include("availupgrade.tpl");
?>
</tr></tbody>
</table>
@@ -0,0 +1,16 @@
<h2><?php echo MAKESHIFTWALL ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo MAKESHIFTWALL_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(43,4);">
<img class="building g43" src="img/x.gif" alt="<?php echo MAKESHIFTWALL; ?>" title="<?php echo MAKESHIFTWALL; ?>" /></a>
</td>
</tr>
<tr>
<?php
$_GET['bid'] = 43;
include("availupgrade.tpl");
?>
</tr></tbody>
</table>
+16
View File
@@ -0,0 +1,16 @@
<h2><?php echo STONEWALL ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo STONEWALL_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(42,4);">
<img class="building g42" src="img/x.gif" alt="<?php echo STONEWALL; ?>" title="<?php echo STONEWALL; ?>" /></a>
</td>
</tr>
<tr>
<?php
$_GET['bid'] = 42;
include("availupgrade.tpl");
?>
</tr></tbody>
</table>
+16
View File
@@ -0,0 +1,16 @@
<h2><?php echo WATERWORKS ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo WATERWORKS_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(45,4);">
<img class="building g45" src="img/x.gif" alt="<?php echo WATERWORKS; ?>" title="<?php echo WATERWORKS; ?>" /></a>
</td>
</tr>
<tr>
<?php
$_GET['bid'] = 45;
include("availupgrade.tpl");
?>
</tr></tbody>
</table>
+18
View File
@@ -0,0 +1,18 @@
<h2><?php echo BARRICADE ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo BARRICADE_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(50,4);">
<img class="building g50" src="img/x.gif" alt="<?php echo BARRICADE ?>" title="<?php echo BARRICADE ?>" /></a>
</td>
</tr>
<tr>
<td class="requ"><?php echo PREREQUISITES ?></td>
</tr>
<tr>
<td>
<?php echo TRIBE9; ?>
</td>
</tr></tbody>
</table>
+18
View File
@@ -0,0 +1,18 @@
<h2><?php echo BIGHOSPITAL ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo BIGHOSPITAL_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(48,4);">
<img class="building g48" src="img/x.gif" alt="<?php echo BIGHOSPITAL ?>" title="<?php echo BIGHOSPITAL ?>" /></a>
</td>
</tr>
<tr>
<td class="requ"><?php echo PREREQUISITES ?></td>
</tr>
<tr>
<td>
<a href="#" onClick="return Popup(15,4);"><?php echo MAINBUILDING ?></a> <span><?php echo LEVEL ?> 10</span>, <a href="#" onClick="return Popup(22,4);"><?php echo ACADEMY ?></a> <span><?php echo LEVEL ?> 15</span>
</td>
</tr></tbody>
</table>
+18
View File
@@ -0,0 +1,18 @@
<h2><?php echo COMMANDCENTER ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo COMMANDCENTER_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(44,4);">
<img class="building g44" src="img/x.gif" alt="<?php echo COMMANDCENTER ?>" title="<?php echo COMMANDCENTER ?>" /></a>
</td>
</tr>
<tr>
<td class="requ"><?php echo PREREQUISITES ?></td>
</tr>
<tr>
<td>
<a href="#" onClick="return Popup(15,4);"><?php echo MAINBUILDING ?></a> <span><?php echo LEVEL ?> 5</span>, <strike><?php echo RESIDENCE ?></strike>, <strike><?php echo PALACE ?></strike>
</td>
</tr></tbody>
</table>
+18
View File
@@ -0,0 +1,18 @@
<h2><?php echo DEFENSIVEWALL ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo DEFENSIVEWALL_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(47,4);">
<img class="building g47" src="img/x.gif" alt="<?php echo DEFENSIVEWALL ?>" title="<?php echo DEFENSIVEWALL ?>" /></a>
</td>
</tr>
<tr>
<td class="requ"><?php echo PREREQUISITES ?></td>
</tr>
<tr>
<td>
<?php echo TRIBE8; ?>
</td>
</tr></tbody>
</table>
+2 -2
View File
@@ -3,8 +3,8 @@
<tbody><tr>
<td class="desc"><?php echo GREATWORKSHOP_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(42,4);">
<img class="building g42" src="img/x.gif" alt="<?php echo GREATWORKSHOP ?>" title="<?php echo GREATWORKSHOP ?>" /></a>
<a href="#" onClick="return Popup(49,4);">
<img class="building g49" src="img/x.gif" alt="<?php echo GREATWORKSHOP ?>" title="<?php echo GREATWORKSHOP ?>" /></a>
</td>
</tr>
<tr>
+18
View File
@@ -0,0 +1,18 @@
<h2><?php echo HOSPITAL ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo HOSPITAL_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(46,4);">
<img class="building g46" src="img/x.gif" alt="<?php echo HOSPITAL ?>" title="<?php echo HOSPITAL ?>" /></a>
</td>
</tr>
<tr>
<td class="requ"><?php echo PREREQUISITES ?></td>
</tr>
<tr>
<td>
<a href="#" onClick="return Popup(15,4);"><?php echo MAINBUILDING ?></a> <span><?php echo LEVEL ?> 10</span>, <a href="#" onClick="return Popup(22,4);"><?php echo ACADEMY ?></a> <span><?php echo LEVEL ?> 15</span>
</td>
</tr></tbody>
</table>
+18
View File
@@ -0,0 +1,18 @@
<h2><?php echo MAKESHIFTWALL ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo MAKESHIFTWALL_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(43,4);">
<img class="building g43" src="img/x.gif" alt="<?php echo MAKESHIFTWALL ?>" title="<?php echo MAKESHIFTWALL ?>" /></a>
</td>
</tr>
<tr>
<td class="requ"><?php echo PREREQUISITES ?></td>
</tr>
<tr>
<td>
<?php echo TRIBE6; ?>
</td>
</tr></tbody>
</table>
+18
View File
@@ -0,0 +1,18 @@
<h2><?php echo STONEWALL ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo STONEWALL_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(42,4);">
<img class="building g42" src="img/x.gif" alt="<?php echo STONEWALL ?>" title="<?php echo STONEWALL ?>" /></a>
</td>
</tr>
<tr>
<td class="requ"><?php echo PREREQUISITES ?></td>
</tr>
<tr>
<td>
<?php echo TRIBE7; ?>
</td>
</tr></tbody>
</table>
+18
View File
@@ -0,0 +1,18 @@
<h2><?php echo WATERWORKS ?></h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc"><?php echo WATERWORKS_DESC ?></td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(45,4);">
<img class="building g45" src="img/x.gif" alt="<?php echo WATERWORKS ?>" title="<?php echo WATERWORKS ?>" /></a>
</td>
</tr>
<tr>
<td class="requ"><?php echo PREREQUISITES ?></td>
</tr>
<tr>
<td>
<a href="#" onClick="return Popup(37,4);"><?php echo HEROSMANSION ?></a> <span><?php echo LEVEL ?> 10</span>
</td>
</tr></tbody>
</table>