mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-04 03:44:23 +00:00
Merge branch 'master' of https://github.com/Shadowss/TravianZ
This commit is contained in:
@@ -1395,8 +1395,8 @@ class Automation {
|
||||
}
|
||||
//to battle.php
|
||||
//fix by ronix
|
||||
$battlepart = $battle->calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab,$att_ab1,$att_ab2,$att_ab3,$att_ab4,$att_ab5,$att_ab6,$att_ab7,$att_ab8,$tblevel,$stonemason,$walllevel,0,0,$AttackerID,$DefenderID,$AttackerWref,$DefenderWref,$conqureby);
|
||||
|
||||
$battlepart = $battle->calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab,$att_ab1,$att_ab2,$att_ab3,$att_ab4,$att_ab5,$att_ab6,$att_ab7,$att_ab8,$tblevel,$stonemason,$walllevel,0,0,0,$AttackerID,$DefenderID,$AttackerWref,$DefenderWref,$conqureby);
|
||||
|
||||
//units attack string for battleraport
|
||||
$unitssend_att = ''.$data['t1'].','.$data['t2'].','.$data['t3'].','.$data['t4'].','.$data['t5'].','.$data['t6'].','.$data['t7'].','.$data['t8'].','.$data['t9'].','.$data['t10'].'';
|
||||
$herosend_att = $data['t11'];
|
||||
|
||||
+714
-1031
File diff suppressed because it is too large
Load Diff
+41
-23
@@ -55,29 +55,47 @@ class Building {
|
||||
}
|
||||
}
|
||||
|
||||
public function procBuild($get) {
|
||||
global $session, $village;
|
||||
if(isset($get['a']) && $get['c'] == $session->checker && !isset($get['id'])) {
|
||||
if($get['a'] == 0) {
|
||||
$this->removeBuilding($get['d']);
|
||||
}
|
||||
else {
|
||||
$session->changeChecker();
|
||||
$this->canProcess($village->resarray['f'.$get['a'].'t'],$get['a']);
|
||||
$this->upgradeBuilding($get['a']);
|
||||
}
|
||||
}
|
||||
if(isset($get['a']) && $get['c'] == $session->checker && isset($get['id'])) {
|
||||
$session->changeChecker();
|
||||
$this->canProcess($get['a'],$get['id']);
|
||||
$this->constructBuilding($get['id'],$get['a']);
|
||||
}
|
||||
if(isset($get['buildingFinish'])) {
|
||||
if($session->gold >= 2 && $session->sit == 0) {
|
||||
$this->finishAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
public function procBuild($get) {
|
||||
global $session, $village, $database;
|
||||
if(isset($get['a']) && $get['c'] == $session->checker && !isset($get['id'])) {
|
||||
if($get['a'] == 0) {
|
||||
$this->removeBuilding($get['d']);
|
||||
}else {
|
||||
$session->changeChecker();
|
||||
$this->canProcess($village->resarray['f'.$get['a'].'t'],$get['a']);
|
||||
$this->upgradeBuilding($get['a']);
|
||||
}
|
||||
}
|
||||
if(isset($get['master']) && isset($get['id']) && isset($get['time']) && $session->gold >= 1 && $session->goldclub && $village->master == 0 && (isset($get['c']) && $get['c']== $session->checker) && isset($_SESSION['mas'])) {
|
||||
$m=$get['master'];
|
||||
$master=explode(",",$_SESSION['mas'][$m]);
|
||||
if($get['master']==$master[0] && $get['id']==$master[1] && $get['time']==$master[2]) {
|
||||
$session->changeChecker();
|
||||
unset($_SESSION['mas']);
|
||||
if($session->access==BANNED){
|
||||
header("Location: banned.php");
|
||||
exit;
|
||||
}
|
||||
$level = $database->getResourceLevel($village->wid);
|
||||
$database->addBuilding($village->wid, $get['id'], $get['master'], 1, $get['time'], 1, $level['f'.$get['id']] + 1 + count($database->getBuildingByField($village->wid,$get['id'])));
|
||||
if($get['id'] > 18) {
|
||||
header("Location: dorf2.php");
|
||||
} else {
|
||||
header("Location: dorf1.php");
|
||||
}
|
||||
}
|
||||
}
|
||||
if(isset($get['a']) && $get['c'] == $session->checker && isset($get['id'])) {
|
||||
$session->changeChecker();
|
||||
$this->canProcess($get['a'],$get['id']);
|
||||
$this->constructBuilding($get['id'],$get['a']);
|
||||
}
|
||||
if(isset($get['buildingFinish']) && $session->plus) {
|
||||
if($session->gold >= 2 && $session->sit == 0) {
|
||||
$this->finishAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function canBuild($id,$tid) {
|
||||
global $village,$session,$database;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
//fix by ronix
|
||||
$bid = $_GET['bid'];
|
||||
unset($_GET['bid']);
|
||||
$bindicator = $building->canBuild($id,$bid);
|
||||
@@ -6,44 +7,45 @@ $loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
|
||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
|
||||
$uprequire = $building->resourceRequired($id,$bid);
|
||||
$mastertime = $uprequire['time'];
|
||||
$_SESSION['mas'][$bid]=$bid.",".$id.",".$mastertime;
|
||||
?>
|
||||
<td class="res">
|
||||
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $uprequire['wood']; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $uprequire['clay']; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $uprequire['iron']; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $uprequire['crop']; ?> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
|
||||
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $uprequire['wood']; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $uprequire['clay']; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $uprequire['iron']; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $uprequire['crop']; ?> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
|
||||
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
} ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="link">
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="link">
|
||||
<?php
|
||||
if($bindicator == 2) {
|
||||
echo "<span class=\"none\">The workers are already at work.</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime&c=$session->checker\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicator == 3) {
|
||||
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime&c=$session->checker\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicator == 4) {
|
||||
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
|
||||
@@ -55,33 +57,33 @@ $mastertime = $uprequire['time'];
|
||||
echo "<span class=\"none\">Upgrade Granary.</span>";
|
||||
}
|
||||
else if($bindicator == 7) {
|
||||
$neededtime = $building->calculateAvaliable($id,$bid);
|
||||
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
$neededtime = $building->calculateAvaliable($id,$bid);
|
||||
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime&c=$session->checker\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicator == 8) {
|
||||
if($session->access!=BANNED){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=$id&c=".$session->checker."\">Construct building.</a>";
|
||||
}else{
|
||||
echo "<a class=\"build\" href=\"banned.php\">Construct building.</a>";
|
||||
}
|
||||
if($session->access!=BANNED){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=$id&c=$session->checker\">Construct building.</a>";
|
||||
}else{
|
||||
echo "<a class=\"build\" href=\"banned.php\">Construct building.</a>";
|
||||
}
|
||||
}
|
||||
else if($bindicator == 9) {
|
||||
if($session->access!=BANNED){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=$id&c=".$session->checker."\">Construct building. (waiting loop)</a>";
|
||||
}else{
|
||||
echo "<a class=\"build\" href=\"banned.php?a=$bid&id=$id&c=".$session->checker."\">Construct building. (waiting loop)</a>";
|
||||
}
|
||||
if($session->access!=BANNED){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=$id&c=$session->checker\">Construct building. (waiting loop)</a>";
|
||||
}else{
|
||||
echo "<a class=\"build\" href=\"banned.php?a=$bid&id=$id&c=$session->checker\">Construct building. (waiting loop)</a>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
+96
-94
@@ -1,18 +1,20 @@
|
||||
<?php
|
||||
//fix by ronix
|
||||
$bid = $village->resarray['f'.$id.'t'];
|
||||
$bindicate = $building->canBuild($id,$bid);
|
||||
if($bindicate == 1) {
|
||||
echo "<p><span class=\"none\">Building already at max level</span></p>";
|
||||
echo "<p><span class=\"none\">Building already at max level</span></p>";
|
||||
} else if($bindicate == 10) {
|
||||
echo "<p><span class=\"none\">Building max level under construction</span></p>";
|
||||
echo "<p><span class=\"none\">Building max level under construction</span></p>";
|
||||
} else if($bindicate == 11) {
|
||||
echo "<p><span class=\"none\">Building presently being demolished</span></p>";
|
||||
echo "<p><span class=\"none\">Building presently being demolished</span></p>";
|
||||
} else {
|
||||
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
|
||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
|
||||
$master = count($database->getMasterJobsByField($village->wid,$id));
|
||||
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
|
||||
$mastertime = $uprequire['time'];
|
||||
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
|
||||
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
|
||||
$master = count($database->getMasterJobsByField($village->wid,$id));
|
||||
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
|
||||
$mastertime = $uprequire['time'];
|
||||
$_SESSION['mas'][$bid]=$bid.",".$id.",".$mastertime;
|
||||
?>
|
||||
<p id="contract"><b>Costs</b> for upgrading to 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']);
|
||||
@@ -21,116 +23,116 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
} ?><br />
|
||||
<?php
|
||||
if($bindicate == 2) {
|
||||
echo "<span class=\"none\">The workers are already at work.</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
echo "<span class=\"none\">The workers are already at work.</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($id <= 18) {
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}else{
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
if($id <= 18) {
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime&c=$session->checker\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}else{
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime&c=$session->checker\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicate == 3) {
|
||||
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($id <= 18) {
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}else{
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
if($id <= 18) {
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime&c=$session->checker\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}else{
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime&c=$session->checker\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicate == 4) {
|
||||
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
|
||||
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
|
||||
}
|
||||
else if($bindicate == 5) {
|
||||
echo "<span class=\"none\">Upgrade Warehouse.</span>";
|
||||
echo "<span class=\"none\">Upgrade Warehouse.</span>";
|
||||
}
|
||||
else if($bindicate == 6) {
|
||||
echo "<span class=\"none\">Upgrade Granary.</span>";
|
||||
echo "<span class=\"none\">Upgrade Granary.</span>";
|
||||
}
|
||||
else if($bindicate == 7) {
|
||||
if($village->allcrop - $village->pop - $automation->getUpkeep($village->unitall, 0) > 0){
|
||||
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
|
||||
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
|
||||
}else{
|
||||
echo "<span class=\"none\">Your crop production is negative, you will never get the required resources.</span>";
|
||||
}
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
if($village->allcrop - $village->pop - $automation->getUpkeep($village->unitall, 0) > 0){
|
||||
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
|
||||
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
|
||||
}else{
|
||||
echo "<span class=\"none\">Your crop production is negative, you will never get the required resources.</span>";
|
||||
}
|
||||
if($session->goldclub == 1){
|
||||
?> </br>
|
||||
<?php
|
||||
if($id <= 18) {
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}else{
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
if($id <= 18) {
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime&c=$session->checker\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}else{
|
||||
if($session->gold >= 1 && $village->master == 0){
|
||||
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime&c=$session->checker\">Constructing with master builder </a>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}else{
|
||||
echo "<span class=\"none\">Constructing with master builder</span>";
|
||||
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if($bindicate == 8) {
|
||||
if($session->access==BANNED){
|
||||
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
|
||||
}
|
||||
else if($id <= 18) {
|
||||
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
|
||||
if($session->access==BANNED){
|
||||
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
|
||||
}
|
||||
else if($id <= 18) {
|
||||
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
|
||||
}
|
||||
else {
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
|
||||
}
|
||||
echo $village->resarray['f'.$id]+1;
|
||||
echo ".</a>";
|
||||
}
|
||||
echo $village->resarray['f'.$id]+1;
|
||||
echo ".</a>";
|
||||
}
|
||||
else if($bindicate == 9) {
|
||||
if($session->access==BANNED){
|
||||
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
|
||||
}
|
||||
else if($id <= 18) {
|
||||
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
|
||||
if($session->access==BANNED){
|
||||
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
|
||||
}
|
||||
else if($id <= 18) {
|
||||
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
|
||||
}
|
||||
else {
|
||||
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
|
||||
}
|
||||
echo $village->resarray['f'.$id]+($loopsame > 0 ? 2:1);
|
||||
echo ".</a> <span class=\"none\">(waiting loop)</span> ";
|
||||
echo $village->resarray['f'.$id]+($loopsame > 0 ? 2:1);
|
||||
echo ".</a> <span class=\"none\">(waiting loop)</span> ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,9 +13,15 @@
|
||||
|
||||
<td class="research"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="ico"><img src="img/x.gif" class="unit upal" alt="Stonemason's Lodge" title="Stonemason's Lodge" /></td>
|
||||
<td class="desc" title="Stonemason's Lodge">Stonemason's Lodge</td>
|
||||
<td class="value"><input class="text" type="text" name="stonemason" value="<?php echo $form->getValue('stonemason')==""? 0 : $form->getValue('stonemason'); ?>" maxlength="2" title="Level Stonemason's Lodge" /></td>
|
||||
<td class="research"></td>
|
||||
</tr>
|
||||
<?php
|
||||
if(in_array(1,$target)) {
|
||||
if($_POST['wall1'] != 0){
|
||||
if(isset($_POST['wall1']) && $_POST['wall1'] != 0){
|
||||
$wall1 = $_POST['wall1'];
|
||||
}else{
|
||||
$wall1 = 0;
|
||||
@@ -28,7 +34,7 @@
|
||||
</tr>";
|
||||
}
|
||||
if(in_array(2,$target)) {
|
||||
if($_POST['wall2'] != 0){
|
||||
if(isset($_POST['wall2']) && $_POST['wall2'] != 0){
|
||||
$wall2 = $_POST['wall2'];
|
||||
}else{
|
||||
$wall2 = 0;
|
||||
@@ -42,8 +48,8 @@
|
||||
</tr>";
|
||||
}
|
||||
if(in_array(3,$target)) {
|
||||
if($_POST['wall3'] != 0){
|
||||
$wall3 = $_POST['wall3'];
|
||||
if(isset($_POST['wall3']) && $_POST['wall3'] != 0){
|
||||
$wall3 = $_POST['wall3'];
|
||||
}else{
|
||||
$wall3 = 0;
|
||||
}
|
||||
@@ -63,11 +69,13 @@
|
||||
<td class="research"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="ico"><img src="img/x.gif" class="unit upal" alt="Palace" title="Stonemason's Lodge" /></td>
|
||||
<td class="desc" title="Stonemason's Lodge">Stonemason's Lodge</td>
|
||||
<td class="value"><input class="text" type="text" name="stonemason" value="<?php echo $form->getValue('stonemason')==""? 0 : $form->getValue('stonemason'); ?>" maxlength="2" title="Level Stonemason's Lodge" /></td>
|
||||
<td class="research"></td>
|
||||
<td class="ico"><img src="img/x.gif" class="unit uhero" title="Hero" alt="Hero" /></td>
|
||||
<td class="desc">Hero (def bonus)</td>
|
||||
<td class="value"><input class="text" type="text" name="h_def_bonus" value="<?php echo $form->getValue('h_def_bonus')==""? 0 : $form->getValue('h_def_bonus'); ?>" maxlength="4" title="Hero (def bonus)" /></td>
|
||||
<td class="research"></td>
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr></tbody></table>
|
||||
|
||||
@@ -20,15 +20,6 @@ if(isset($_GET['newdid'])) {
|
||||
}else{
|
||||
$building->procBuild($_GET);
|
||||
}
|
||||
if(isset($_GET['master']) && isset($_GET['id']) && isset($_GET['time']) && $session->gold >= 1 && $session->goldclub && $village->master == 0) {
|
||||
if($session->access!=BANNED){
|
||||
$level = $database->getResourceLevel($village->wid);
|
||||
$database->addBuilding($village->wid, $_GET['id'], $_GET['master'], 1, $_GET['time'], 1, $level['f'.$_GET['id']] + 1 + count($database->getBuildingByField($village->wid,$_GET['id'])));
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
|
||||
@@ -17,15 +17,6 @@ if(isset($_GET['newdid'])) {
|
||||
}else{
|
||||
$building->procBuild($_GET);
|
||||
}
|
||||
if(isset($_GET['master']) && isset($_GET['id']) && isset($_GET['time']) && $session->gold >= 1 && $session->goldclub && $village->master == 0) {
|
||||
if($session->access!=BANNED){
|
||||
$level = $database->getResourceLevel($village->wid);
|
||||
$database->addBuilding($village->wid, $_GET['id'], $_GET['master'], 1, $_GET['time'], 1, $level['f'.$_GET['id']] + 1 + count($database->getBuildingByField($village->wid,$_GET['id'])));
|
||||
header("Location: ".$_SERVER['PHP_SELF']);
|
||||
}else{
|
||||
header("Location: banned.php");
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
|
||||
@@ -106,4 +97,4 @@ echo round(($generator->pageLoadTimeEnd()-$start)*1000);
|
||||
</div>
|
||||
<div id="ce"></div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user