diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index a4edcddb..1dbb31ae 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -2083,6 +2083,7 @@ class Automation { $plevel = $i; } } + if($palacelevel['f'.$plevel.'t'] == 26){ if($palacelevel['f'.$plevel] < 10){ $canconquer = 0; } @@ -2095,6 +2096,17 @@ class Automation { else{ $canconquer = 3; } + }else if($palacelevel['f'.$i.'t'] == 25){ + if($palacelevel['f'.$plevel] < 10){ + $canconquer = 0; + } + elseif($palacelevel['f'.$plevel] < 20){ + $canconquer = 1; + } + else{ + $canconquer = 2; + } + } $exp1 = $database->getVillageField($from['wref'],'exp1'); $exp2 = $database->getVillageField($from['wref'],'exp2'); @@ -2105,7 +2117,7 @@ class Automation { elseif($exp2 == 0){ $villexp = 1; } - elseif($exp2 == 0){ + elseif($exp3 == 0){ $villexp = 2; } else{ @@ -2803,6 +2815,17 @@ $crannyimg = "pruneResource(); + // Settlers + + $q = "SELECT * FROM ".TB_PREFIX."movement where ref = 0 and proc = '0' and sort_type = '4' and endtime < $time"; + $dataarray = $database->query_return($q); + foreach($dataarray as $data) { + + $tribe = $database->getUserField($database->getVillageField($data['to'],"owner"),"tribe",0); + + $database->modifyUnit($data['to'],array($tribe."0"),array(3),array(1)); + $database->setMovementProc($data['moveid']); + } if(file_exists("GameEngine/Prevention/returnunits.txt")) { unlink("GameEngine/Prevention/returnunits.txt"); @@ -2823,7 +2846,7 @@ $crannyimg = "getMInfo($data['from']); $user = $database->getUserField($to['owner'],'username',0); $taken = $database->getVillageState($data['to']); - if($taken['occupied'] == 0){ + if($taken != 1){ $database->setFieldTaken($data['to']); $database->addVillage($data['to'],$to['owner'],$user,'0'); $database->addResourceFields($data['to'],$database->getVillageType($data['to'])); @@ -2852,7 +2875,8 @@ $crannyimg = "setMovementProc($data['moveid']); + $database->addMovement(4,$data['to'],$data['from'],$data['ref'],$time,$time+($time-$data['starttime'])); + $database->setMovementProc($data['moveid']); } } if(file_exists("GameEngine/Prevention/settlers.txt")) { diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index c599ab41..1dd5b991 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -2058,6 +2058,9 @@ case 6: $q = "SELECT * FROM " . TB_PREFIX . "movement," . TB_PREFIX . "odata, " . TB_PREFIX . "attacks where " . TB_PREFIX . "odata.conqured = $village and " . TB_PREFIX . "movement.to = " . TB_PREFIX . "odata.wref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 ORDER BY endtime ASC"; break; + case 7: + $q = "SELECT * FROM " . TB_PREFIX . "movement where " . TB_PREFIX . "movement." . $where . " = $village and sort_type = 4 and ref = 0 and proc = 0 ORDER BY endtime ASC"; + break; case 34: $q = "SELECT * FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement." . $where . " = $village and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 or " . TB_PREFIX . "movement." . $where . " = $village and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 4 ORDER BY endtime ASC"; break; diff --git a/GameEngine/Units.php b/GameEngine/Units.php index 6d4ced99..f6997403 100644 --- a/GameEngine/Units.php +++ b/GameEngine/Units.php @@ -481,7 +481,7 @@ class Units { $unit = ($session->tribe*10); $database->modifyResource($village->wid,750,750,750,750,0); $database->modifyUnit($village->wid,array($unit),array(3),array(0)); - $database->addMovement(5,$village->wid,$post['s'],0,time(),$post['timestamp']); + $database->addMovement(5,$village->wid,$post['s'],0,time(),time()+$post['timestamp']); header("Location: build.php?id=39"); if($form->returnErrors() > 0) { diff --git a/Templates/Build/16.tpl b/Templates/Build/16.tpl index 63d1b2a9..8c36bcde 100644 --- a/Templates/Build/16.tpl +++ b/Templates/Build/16.tpl @@ -13,13 +13,14 @@ getMovement("34",$village->wid,1); - +$settlers = $database->getMovement("7",$village->wid,1); $units_incoming = count($units_type); +$settlers_incoming = count($settlers); for($i=0;$i<$units_incoming;$i++){ - if($units_type[$i]['attack_type'] == 1) + if($units_type[$i]['attack_type'] == 1 && $units_type[$i]['sort_type'] == 3) $units_incoming -= 1; } -if($units_incoming >= 1){ +if($units_incoming > 0 or $settlers_incoming > 0){ ?>

Incoming troops ()

+$settlers = $database->getMovement("7",$village->wid,1); +$total_for3 = count($settlers); +for($x=0;$x < $total_for3;$x++){ +$timer = $x+1; +$to = $database->getMInfo($settlers[$x]['to']); +?> + + + + + + + + + tribe; + $start = ($tribe-1)*10+1; + $end = ($tribe*10); + echo ""; + for($i=$start;$i<=($end);$i++) { + echo ""; + } + ?> + + + 0"; + } + else { + echo ""; + } + } + ?> + + + + + + + + +
vname; ?>
 getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" />
Troops"; + echo $settlers[$x]['t'.$i]."
Arrival + ".$generator->getTimeFormat($settlers[$x]['endtime']-time())." h"; + $datetime = $generator->procMtime($settlers[$x]['endtime']); + echo "
"; + if($datetime[0] != "today") { + echo "on ".$datetime[0]." "; + } + echo "at ".$datetime[1]."
"; + ?> + +
+ \ No newline at end of file diff --git a/Templates/Build/16_walking.tpl b/Templates/Build/16_walking.tpl index 34056b1b..bfb0cb4b 100644 --- a/Templates/Build/16_walking.tpl +++ b/Templates/Build/16_walking.tpl @@ -97,7 +97,7 @@ $timer += 1; vname; ?> - Found new village. + Found new village @@ -113,15 +113,18 @@ $timer += 1; Troops "; + echo "0"; } else { echo ""; - } echo $units[$y]['t'.$i].""; + } } ?> diff --git a/Templates/a2b/newdorf.tpl b/Templates/a2b/newdorf.tpl index b4a2de98..97aa9475 100644 --- a/Templates/a2b/newdorf.tpl +++ b/Templates/a2b/newdorf.tpl @@ -28,7 +28,7 @@ echo ''; - +