NPC button no longer appears if combined resources are not enough

This commit is contained in:
AL-Kateb
2017-12-31 18:19:05 +00:00
parent 0696b3127b
commit 5466aa2af1
26 changed files with 169 additions and 68 deletions
+1 -1
View File
@@ -35,4 +35,4 @@ GameEngine/Admin/Mods/constant_format.tpl
# These 2 files change frequently on the server but not in the repository code.
Templates/text.tpl
var/log/access.log
var/log/access.log
+2 -1
View File
@@ -19,7 +19,7 @@ class Village {
public $type;
public $coor = array();
public $awood,$aclay,$airon,$acrop,$pop,$maxstore,$maxcrop;
public $awood,$aclay,$airon,$acrop,$pop,$maxstore,$maxcrop,$atotal;
public $wid,$vname,$capital,$natar,$master;
public $resarray = array();
public $unitarray,$techarray,$unitall,$researching,$abarray = array();
@@ -103,6 +103,7 @@ class Village {
$this->aclay = $this->infoarray['clay'];
$this->airon = $this->infoarray['iron'];
$this->acrop = $this->infoarray['crop'];
$this->atotal = (int)($this->awood + $this->aclay + $this->airon + $this->acrop);
$this->pop = $this->infoarray['pop'];
$this->maxstore = $this->infoarray['maxstore'];
$this->maxcrop = $this->infoarray['maxcrop'];
+4 -1
View File
@@ -20,7 +20,10 @@
if($abdata['b'.$j] != 20) {
echo "<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'ab'.$i}[$abdata['b'.$j]+1]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'ab'.$i}[$abdata['b'.$j]+1]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'ab'.$i}[$abdata['b'.$j]+1]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'ab'.$i}[$abdata['b'.$j]+1]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'ab'.$i}[$abdata['b'.$j]+1]['time']*($bid12[$building->getTypeLevel(12)]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)(${'ab'.$i}[$abdata['b'.$j]+1]['wood'] + ${'ab'.$i}[$abdata['b'.$j]+1]['clay'] + ${'ab'.$i}[$abdata['b'.$j]+1]['iron'] + ${'ab'.$i}[$abdata['b'.$j]+1]['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'ab'.$i}[$abdata['b'.$j]+1]['wood']."&r2=".${'ab'.$i}[$abdata['b'.$j]+1]['clay']."&r3=".${'ab'.$i}[$abdata['b'.$j]+1]['iron']."&r4=".${'ab'.$i}[$abdata['b'.$j]+1]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
}
+4 -1
View File
@@ -20,7 +20,10 @@
if($abdata['a'.$j] != 20) {
echo "<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'ab'.$i}[$abdata['a'.$j]+1]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'ab'.$i}[$abdata['a'.$j]+1]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'ab'.$i}[$abdata['a'.$j]+1]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'ab'.$i}[$abdata['a'.$j]+1]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'ab'.$i}[$abdata['a'.$j]+1]['time']*($bid13[$building->getTypeLevel(13)]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)(${'ab'.$i}['wood'] + ${'ab'.$i}['clay'] + ${'ab'.$i}['iron'] + ${'ab'.$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=".${'ab'.$i}[$abdata['a'.$j]+1]['wood']."&r2=".${'ab'.$i}[$abdata['a'.$j]+1]['clay']."&r3=".${'ab'.$i}[$abdata['a'.$j]+1]['iron']."&r4=".${'ab'.$i}[$abdata['a'.$j]+1]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
}
+4 -1
View File
@@ -40,7 +40,10 @@ $dur=round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 1
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- 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'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div>
+4 -1
View File
@@ -36,7 +36,10 @@ for($i=15;$i<=16;$i++) {
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- 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'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div></td>
+5 -1
View File
@@ -36,7 +36,11 @@ for($i=23;$i<=26;$i++) {
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- 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'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div></td>
+6 -2
View File
@@ -36,9 +36,13 @@ for($i=35;$i<=36;$i++) {
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- 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'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
}
echo "</div></td>
<td class=\"val\">
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
+5 -1
View File
@@ -66,7 +66,11 @@
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- 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'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div></td>
+4 -1
View File
@@ -17,7 +17,10 @@ for($i=2;$i<=9;$i++) {
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$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=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
+5 -1
View File
@@ -17,7 +17,11 @@ for($i=12;$i<=19;$i++) {
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$i}['crop']);
echo "Total required is $total_required and total available is " . $village->atotal;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
+3 -1
View File
@@ -17,7 +17,9 @@ for($i=22;$i<=29;$i++) {
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$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=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
+3 -1
View File
@@ -17,7 +17,9 @@ for($i=32;$i<=39;$i++) {
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$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=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
+3 -1
View File
@@ -17,7 +17,9 @@ for($i=42;$i<=49;$i++) {
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)(${'r'.$i}['wood'] + ${'r'.$i}['clay'] + ${'r'.$i}['iron'] + ${'r'.$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=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
+6 -2
View File
@@ -16,7 +16,9 @@
echo "<tr><td class=\"desc\"><div class=\"tit\">".$cel[$i]['name']." (".$cel[$i]['attri']." ".CULTURE_POINTS.")</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />".$cel[$i]['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />".$cel[$i]['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />".$cel[$i]['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$cel[$i]['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
echo $generator->getTimeFormat(round($cel[$i]['time'] * ($bid24[$building->getTypeLevel(24)]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($cel[$i]['wood'] + $cel[$i]['clay'] + $cel[$i]['iron'] + $cel[$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=".$cel[$i]['wood']."&r2=".$cel[$i]['clay']."&r3=".$cel[$i]['iron']."&r4=".$cel[$i]['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if($inuse > $time){
@@ -47,7 +49,9 @@
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"".LUMBER."\" />29700|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"".CLAY."\" />33250|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"".IRON."\" />32000|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />6700|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"".DURATION."\" />";
echo $generator->getTimeFormat(round($gc[$level]/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)(29700 + 33250 + 32000 + 6700);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
echo "|<a href=\"build.php?gid=17&t=3&r1=29700&r2=33250&r3=32000&r4=6700\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if($inuse > $time){
+4 -1
View File
@@ -66,7 +66,10 @@ $dur=round(${'u'.$i}['time'] * ($bid25[$village->resarray['f'.$id]]['attri'] / 1
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 0) {
//-- 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>
+5 -1
View File
@@ -66,7 +66,11 @@ $dur=round(${'u'.$i}['time'] * ($bid26[$village->resarray['f'.$id]]['attri'] / 1
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
//-- 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>
+5 -1
View File
@@ -39,7 +39,11 @@ $dur=round(${'u'.$i}['time'] * ($bid29[$village->resarray['f'.$id]]['attri'] / 1
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- 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'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div>
+5 -1
View File
@@ -39,7 +39,11 @@ $dur=round(${'u'.$i}['time'] * ($bid30[$village->resarray['f'.$id]]['attri'] * (
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- 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'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div>
+6 -2
View File
@@ -133,7 +133,9 @@
<img class="clock" src="img/x.gif" alt="Duration" title="<?php echo DURATION; ?>" />
<?php echo $training_time; ?>
<?php
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($wood + $clay + $iron + $crop);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$wood."&r2=".$clay."&r3=".$iron."&r4=".$crop."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
?>
@@ -169,7 +171,9 @@
<img class="clock" src="img/x.gif" alt="Duration" title="<?php echo DURATION; ?>" />
<?php echo $training_time; ?>
<?php
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($wood + $clay + $iron + $crop);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$wood."&r2=".$clay."&r3=".$iron."&r4=".$crop."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
?>
+47 -16
View File
@@ -64,7 +64,10 @@ if($session->tribe == 1) {
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
$output.=$generator->getTimeFormat(round($u1['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u1['wood'] + $u1['clay'] + $u1['iron'] + $u1['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u1['wood']."&r2=".$u1['clay']."&r3=".$u1['iron']."&r4=".$u1['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
$output.="</div>
@@ -101,7 +104,9 @@ if($session->tribe == 1) {
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
$output.=$generator->getTimeFormat(round($u2['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u2['wood'] + $u2['clay'] + $u2['iron'] + $u2['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u2['wood']."&r2=".$u2['clay']."&r3=".$u2['iron']."&r4=".$u2['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -139,7 +144,9 @@ if($session->tribe == 1) {
$output.= $generator->getTimeFormat(round($u3['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u3['wood'] + $u3['clay'] + $u3['iron'] + $u3['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u3['wood']."&r2=".$u3['clay']."&r3=".$u3['iron']."&r4=".$u3['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -175,7 +182,9 @@ if($session->tribe == 1) {
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u5['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u5['wood'] + $u5['clay'] + $u5['iron'] + $u5['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u5['wood']."&r2=".$u5['clay']."&r3=".$u5['iron']."&r4=".$u5['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -212,7 +221,9 @@ if($session->tribe == 1) {
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u6['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u6['wood'] + $u6['clay'] + $u6['iron'] + $u6['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u6['wood']."&r2=".$u6['clay']."&r3=".$u6['iron']."&r4=".$u6['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -252,7 +263,9 @@ $output.="<tr>
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u11['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u11['wood'] + $u11['clay'] + $u11['iron'] + $u11['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u11['wood']."&r2=".$u11['clay']."&r3=".$u11['iron']."&r4=".$u11['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -289,8 +302,10 @@ $output.="<tr>
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u12['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u12['wood']."&r2=".$u12['clay']."&r3=".$u12['iron']."&r4=".$u12['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u12['wood'] + $u12['clay'] + $u12['iron'] + $u12['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u12['wood']."&r2=".$u12['clay']."&r3=".$u12['iron']."&r4=".$u12['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
$output .= "
@@ -328,7 +343,9 @@ $output.="<tr>
$generator->getTimeFormat(round($u13['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u13['wood'] + $u13['clay'] + $u13['iron'] + $u13['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u13['wood']."&r2=".$u13['clay']."&r3=".$u13['iron']."&r4=".$u13['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -365,7 +382,9 @@ $output.="<tr>
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u15['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u15['wood'] + $u15['clay'] + $u15['iron'] + $u15['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u15['wood']."&r2=".$u15['clay']."&r3=".$u15['iron']."&r4=".$u15['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -403,7 +422,9 @@ $output.="<tr>
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u16['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u16['wood'] + $u16['clay'] + $u16['iron'] + $u16['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u16['wood']."&r2=".$u16['clay']."&r3=".$u16['iron']."&r4=".$u16['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -443,7 +464,9 @@ $output.="<tr>
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u21['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u21['wood'] + $u21['clay'] + $u21['iron'] + $u21['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u21['wood']."&r2=".$u21['clay']."&r3=".$u21['iron']."&r4=".$u21['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -480,7 +503,9 @@ $output.="<tr>
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u22['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u22['wood'] + $u22['clay'] + $u22['iron'] + $u22['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u22['wood']."&r2=".$u22['clay']."&r3=".$u22['iron']."&r4=".$u22['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -518,7 +543,9 @@ $output.="<tr>
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u24['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u24['wood'] + $u24['clay'] + $u24['iron'] + $u24['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u24['wood']."&r2=".$u24['clay']."&r3=".$u24['iron']."&r4=".$u24['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -555,7 +582,9 @@ $output.="<tr>
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u25['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u25['wood'] + $u25['clay'] + $u25['iron'] + $u25['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u25['wood']."&r2=".$u25['clay']."&r3=".$u25['iron']."&r4=".$u25['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
@@ -593,7 +622,9 @@ $output.="<tr>
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
$generator->getTimeFormat(round($u26['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($u26['wood'] + $u26['clay'] + $u26['iron'] + $u26['crop']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $village->atotal >= $total_required) {
$output .= "|<a href=\"build.php?gid=17&t=3&r1=".$u26['wood']."&r2=".$u26['clay']."&r3=".$u26['iron']."&r4=".$u26['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
+5 -1
View File
@@ -38,7 +38,11 @@ $dur=round(${'u'.$i}['time'] * ($bid42[$village->resarray['f'.$id]]['attri'] / 1
}
$dur=$generator->getTimeFormat($dur);
echo ($dur=="0:00:00")? "0:00:01":$dur;
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
//-- 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'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
echo "</div>
+9 -4
View File
@@ -1,4 +1,5 @@
<?php
$bid = $village->resarray['f'.$id.'t'];
$bindicate = $building->canBuild($id,$bid);
if($bindicate == 1) {
@@ -17,15 +18,19 @@ if($bindicate == 1) {
if ($master == 1 && $loopsame == 1) {
$loopsame = 0;
}
//-- If available resources combined are not enough, remove NPC button
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
$mastertime = $uprequire['time'];
?>
<?php
$total_available = (int)($village->awood + $village->aclay + $village->airon + $village->acrop);
$total_required = (int)($uprequire['wood'] + $uprequire['clay'] + $uprequire['iron'] + $uprequire['crop']);
?>
<p id="contract"><b><?php echo COSTS_UPGRADING_LEVEL;?> <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:<br />
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><span class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><span class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><span class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><span class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
} ?><br />
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1 && $total_available >= $total_required) {
echo "| <a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
} ?><br />
<?php
if($bindicate == 2) {
echo "<span class=\"none\">".WORKERS_ALREADY_WORK."</span>";
+3 -1
View File
@@ -37,7 +37,9 @@ if ( $building->allowWwUpgrade() ) {
title="Crop consumption"/><?php echo $uprequire['pop']; ?>
| <img class="clock" src="img/x.gif" alt="duration"
title="duration"/><?php echo $generator->getTimeFormat( $uprequire['time'] );
if ( $session->userinfo['gold'] >= 3 && $building->getTypeLevel( 17 ) >= 1 ) {
//-- If available resources combined are not enough, remove NPC button
$total_required = (int)($uprequire['wood'] + $uprequire['clay'] + $uprequire['iron'] + $uprequire['crop']);
if ( $session->userinfo['gold'] >= 3 && $building->getTypeLevel( 17 ) >= 1 && $village->atotal >= $total_required) {
echo "|<a href=\"build.php?gid=17&t=3&r1=" . $uprequire['wood'] . "&r2=" . $uprequire['clay'] . "&r3=" . $uprequire['iron'] . "&r4=" . $uprequire['crop'] . "\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
} ?><br/>
<?php
+21 -23
View File
@@ -10,36 +10,34 @@
#################################################################################
$txt="Construction plans
$txt="World Wonder Construction Plans
Many moons ago the tribes of Travian were surprised by the unforeseen return of the Natars. This tribe from immemorial times surpassing all in wisdom, might and glory was about to trouble the free ones again. Thus they put all their efforts in preparing a last war against the Natars and vanquishing them forever. Many thought about the so-called 'Wonders of the World', a construction of many legends, as the only solution. It was told that it would render anyone invincible once completed. Ultimately making the constructors the rulers and conquerors of all known Travian.
However, it was also told that one would need construction plans to construct such a building. Due to this fact, the architects devised cunning plans about how to store these safely. After a while, one could see temple-like buildings in many a city and metropolis - the Treasure Chambers (Treasuries).
Sadly, no one - not even the wise and well versed - knew where to find these construction plans. The harder people tried to locate them, the more it seemed as if they where only legends.
Today, however, this last secret will be revealed. Deprivations and endeavors of the past will not have been in vain, as today scouts of several tribes have successfully obtained the whereabouts of the construction plans. Well guarded by the Natars, they lie hidden in several oases to be found all over Travian. Only the most valiant heroes will be able to secure such a plan and bring it home safely so that the construction can begin.
In the end, we will see whether the free tribes of Travian can once again outwit the Natars and vanquish them once and for all. Do not be so foolish as to assume that the Natars will leave without a fight, though!
Countless days have passed since the first battles upon the walls of the cursed villages of the Dread Natars, many armies of both the free ones and the Natarian empire struggled and died before the walls of the many strongholds from which the Natars had once ruled all creation. Now with the dust settled and a relative calm having settled in, armies began to count their losses and collect their dead, the stench of combat still lingering in the night air, a smell of a slaughter unforgettable in its extent and brutality yet soon to be dwarfed by yet others. The largest armies of the free ones and the Dread Natars were marshalling for yet another renewed assault upon the coveted former strongholds of the Natarian Empire.
Soon scouts arrived telling of a most awesome sight and a chilling reminder, a dread army of an unfathomable size had been spotted marshalling at the end of the world, the Natarian capital, a force so great and unstoppable that the dust from their march would choke off all light, a force so brutal and ruthless that it would crush all hope. The free people knew that they had to race now, race against time and the endless hordes of the Natarian Empire to raise a Wonder of the World to restore the world to peace and vanquish the Natarian threat.
But to raise such a great Wonder would be no easy task, one would need construction plans created in the distant past, plans of such an arcane nature that even the very wisest of sages knew not their contents or locations.
Tens of thousands of scouts roamed across all existence searching in vain for these mystical plans, looking in all places but the dreaded Natarian Capital, yet could not find them. Today however, they return bearing good news, they return baring the locations of the plans, hidden by the armies of the Natars inside secret strongholds constructed to be hidden from the eyes of man.
Now begins the final stretch, when the greatest armies of the Free people and the Natars will clash across the world for the fate of all that lies under heaven. This is the war that will echo across the eons, this is your war, and here you shall etch your name across history, here you shall become legend.
To steal a set of Construction Plans from the Natars, the following things must happen:
- You must Attack the village (NOT Raid!)
- You must WIN the Attack
- You must DESTROY the Treasure Chamber (Treasury)
- Your Hero MUST be in that attack, as he is the only one who may carry the Construction Plans
- An empty level 10 Treasure Chamber (Treasury) MUST be in the village where that attack came from
NOTE: If the above criteria is not met during the attack, the next attack on that village which does meet the above criteria will take the Construction Plans.
Facts:
To steal one, the following things must happen:
You must attack the village (NO Raid!)
WIN the Attack
Destroy the treasury
An empty treasury lvl 10 MUST be in the village where that attack came from
Have a hero in an attack
If not, the next attack on that village, winning with a hero and empty treasury will take the building plan.
To build a Treasure Chamber (Treasury), you will need a Main Building level 10 and the village MUST NOT be contain a World Wonder.
To build a WW, you must own a plan yourself (you = the WW village owner) from lvl 0 to 50, from 51 to 100 you need an additional plan in your alliance! Two plans in the WW village account would not work!
The construction plans are conquerable immediately when they appear to the server.
There will be a countdown in game, showing the exact time of the release, 5 days prior to the launch. ";
To build a World Wonder, you must own the Construction Plans yourself (you = the World Wonder Village Owner) from level 0 to 50, and then from level 51 to 100 you will need an additional set of Construction Plans in your Alliance! Two sets of Construction Plans in the World Wonder Village Account will not work!";
//bbcode = html code
$txt = preg_replace("/\[b\]/is",'<b>', $txt);
Executable → Regular
View File