mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-31 15:47:14 +00:00
+15
-144
@@ -1118,7 +1118,7 @@ class Automation {
|
|||||||
if ($isSecondRow) {
|
if ($isSecondRow) {
|
||||||
if ($tbid > 0 || ($tbid == 0 && strpos($info_cat, 'The village has') === false)) {
|
if ($tbid > 0 || ($tbid == 0 && strpos($info_cat, 'The village has') === false)) {
|
||||||
$info_cat .= "<br><tbody class=\"goods\"><tr><th>Information</th><td colspan=\"11\">
|
$info_cat .= "<br><tbody class=\"goods\"><tr><th>Information</th><td colspan=\"11\">
|
||||||
<img class=\"unit u" . $catp_pic . "\" src=\"img/x.gif\" alt=\"Catapult\" title=\"Catapult\" /> " . $this->procResType( $tbgid, $can_destroy, $isoasis ) . " destroyed.";
|
<img class=\"unit u" . $catp_pic . "\" src=\"img/x.gif\" alt=\"Catapult\" title=\"Catapult\" /> " . $this->procResType( $tbgid, $can_destroy, $isoasis ) . " <b>destroyed</b>.";
|
||||||
}
|
}
|
||||||
|
|
||||||
// embassy level was changed
|
// embassy level was changed
|
||||||
@@ -1128,7 +1128,7 @@ class Automation {
|
|||||||
|
|
||||||
$info_cat .= "</td></tr></tbody>";
|
$info_cat .= "</td></tr></tbody>";
|
||||||
} else {
|
} else {
|
||||||
$info_cat = "" . $catp_pic . ", " . $this->procResType( $tbgid, $can_destroy, $isoasis ) . " destroyed.";
|
$info_cat = "" . $catp_pic . ", " . $this->procResType( $tbgid, $can_destroy, $isoasis ) . " <b>destroyed</b>.";
|
||||||
|
|
||||||
// embassy level was changed
|
// embassy level was changed
|
||||||
if ($tbgid==18){
|
if ($tbgid==18){
|
||||||
@@ -1175,7 +1175,7 @@ class Automation {
|
|||||||
|
|
||||||
if ($tblevel == 1 && $totallvl == 0) {
|
if ($tblevel == 1 && $totallvl == 0) {
|
||||||
// building was actually destroyed - recalculate population and remove village itself, if needed
|
// building was actually destroyed - recalculate population and remove village itself, if needed
|
||||||
$info_cata = " destroyed.";
|
$info_cata = " <b>destroyed</b>.";
|
||||||
} else {
|
} else {
|
||||||
// building was damaged to a lower level
|
// building was damaged to a lower level
|
||||||
$info_cata = " damaged from level <b>" . $tblevel . "</b> to level <b>" . $totallvl . "</b>.";
|
$info_cata = " damaged from level <b>" . $tblevel . "</b> to level <b>" . $totallvl . "</b>.";
|
||||||
@@ -3335,140 +3335,6 @@ class Automation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private function sendTroopsBack($post) {
|
|
||||||
global $form, $database, $village, $generator, $session, $technology;
|
|
||||||
|
|
||||||
$enforce=$database->getEnforceArray($post['ckey'],0);
|
|
||||||
$to = $database->getVillage($enforce['from']);
|
|
||||||
$Gtribe = "";
|
|
||||||
if ($database->getUserField($to['owner'],'tribe',0) == '2'){ $Gtribe = "1"; } else if ($database->getUserField($to['owner'],'tribe',0) == '3'){ $Gtribe = "2"; } else if ($database->getUserField($to['owner'],'tribe',0) == '4'){ $Gtribe = "3"; }else if ($database->getUserField($to['owner'],'tribe',0) == '5'){ $Gtribe = "4"; }
|
|
||||||
|
|
||||||
for($i=1; $i<10; $i++){
|
|
||||||
if(isset($post['t'.$i])){
|
|
||||||
if($i!=10){
|
|
||||||
if ($post['t'.$i] > $enforce['u'.$Gtribe.$i])
|
|
||||||
{
|
|
||||||
$form->addError("error","You can't send more units than you have");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if($post['t'.$i]<0)
|
|
||||||
{
|
|
||||||
$form->addError("error","You can't send negative units.");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$post['t'.$i.'']='0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(isset($post['t11'])){
|
|
||||||
if ($post['t11'] > $enforce['hero'])
|
|
||||||
{
|
|
||||||
$form->addError("error","You can't send more units than you have");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if($post['t11']<0)
|
|
||||||
{
|
|
||||||
$form->addError("error","You can't send negative units.");
|
|
||||||
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$post['t11']='0';
|
|
||||||
}
|
|
||||||
|
|
||||||
if($form->returnErrors() > 0) {
|
|
||||||
$_SESSION['errorarray'] = $form->getErrors();
|
|
||||||
$_SESSION['valuearray'] = $_POST;
|
|
||||||
header("Location: a2b.php");
|
|
||||||
exit;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
//change units
|
|
||||||
$start = ($database->getUserField($to['owner'],'tribe',0)-1)*10+1;
|
|
||||||
$end = ($database->getUserField($to['owner'],'tribe',0)*10);
|
|
||||||
|
|
||||||
$j='1';
|
|
||||||
$units = [];
|
|
||||||
$amounts = [];
|
|
||||||
$modes = [];
|
|
||||||
|
|
||||||
for($i=$start;$i<=$end;$i++){
|
|
||||||
$units[] = $i;
|
|
||||||
$amounts[] = $post['t'.$j.''];
|
|
||||||
$modes[] = 0;
|
|
||||||
$j++;
|
|
||||||
}
|
|
||||||
$database->modifyEnforce($post['ckey'], $units, $amounts, $modes);
|
|
||||||
|
|
||||||
//get cord
|
|
||||||
$from = $database->getVillage($enforce['from']);
|
|
||||||
$fromcoor = $database->getCoor($enforce['from']);
|
|
||||||
$tocoor = $database->getCoor($enforce['vref']);
|
|
||||||
$fromCor = array('x'=>$tocoor['x'], 'y'=>$tocoor['y']);
|
|
||||||
$toCor = array('x'=>$fromcoor['x'], 'y'=>$fromcoor['y']);
|
|
||||||
|
|
||||||
$speeds = array();
|
|
||||||
|
|
||||||
//find slowest unit.
|
|
||||||
for($i=1;$i<=10;$i++){
|
|
||||||
if (isset($post['t'.$i])){
|
|
||||||
if( $post['t'.$i] != '' && $post['t'.$i] > 0){
|
|
||||||
if($unitarray) { reset($unitarray); }
|
|
||||||
$unitarray = $GLOBALS["u".(($session->tribe-1)*10+$i)];
|
|
||||||
$speeds[] = $unitarray['speed'];
|
|
||||||
} else {
|
|
||||||
$post['t'.$i.'']='0';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$post['t'.$i.'']='0';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (isset($post['t11'])){
|
|
||||||
if( $post['t11'] != '' && $post['t11'] > 0){
|
|
||||||
$hero_unit = getHeroField($from['owner'], 'unit');
|
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
|
||||||
} else {
|
|
||||||
$post['t11']='0';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$post['t11']='0';
|
|
||||||
}
|
|
||||||
$artefact = count($database->getOwnUniqueArtefactInfo2($from['owner'],2,3,0));
|
|
||||||
$artefact1 = count($database->getOwnUniqueArtefactInfo2($from['vref'],2,1,1));
|
|
||||||
$artefact2 = count($database->getOwnUniqueArtefactInfo2($from['owner'],2,2,0));
|
|
||||||
if($artefact > 0){
|
|
||||||
$fastertroops = 3;
|
|
||||||
}else if($artefact1 > 0){
|
|
||||||
$fastertroops = 2;
|
|
||||||
}else if($artefact2 > 0){
|
|
||||||
$fastertroops = 1.5;
|
|
||||||
}else{
|
|
||||||
$fastertroops = 1;
|
|
||||||
}
|
|
||||||
$time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops);
|
|
||||||
$foolartefact4 = $database->getFoolArtefactInfo(2,$from['wref'],$from['owner']);
|
|
||||||
if(count($foolartefact4) > 0){
|
|
||||||
foreach($foolartefact4 as $arte){
|
|
||||||
if($arte['bad_effect'] == 1){
|
|
||||||
$time *= $arte['effect2'];
|
|
||||||
}else{
|
|
||||||
$time /= $arte['effect2'];
|
|
||||||
$time = round($endtime);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$reference = $database->addAttack($enforce['from'],$post['t1'],$post['t2'],$post['t3'],$post['t4'],$post['t5'],$post['t6'],$post['t7'],$post['t8'],$post['t9'],$post['t10'],$post['t11'],2,0,0,0,0);
|
|
||||||
$database->addMovement(4,$village->wid,$enforce['from'],$reference,$AttackArrivalTime,($time+$AttackArrivalTime));
|
|
||||||
$technology->checkReinf($post['ckey']);
|
|
||||||
|
|
||||||
header("Location: build.php?id=39");
|
|
||||||
exit;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private function sendreinfunitsComplete() {
|
private function sendreinfunitsComplete() {
|
||||||
global $bid23,$database,$battle,$session,$autoprefix;
|
global $bid23,$database,$battle,$session,$autoprefix;
|
||||||
|
|
||||||
@@ -4441,15 +4307,20 @@ class Automation {
|
|||||||
$valuesUpdated = false;
|
$valuesUpdated = false;
|
||||||
if($timepast <= 0 && $train['amt'] > 0) {
|
if($timepast <= 0 && $train['amt'] > 0) {
|
||||||
$valuesUpdated = true;
|
$valuesUpdated = true;
|
||||||
$timepast2 = $time - $train['timestamp2'];
|
if($train['eachtime'] > 0){
|
||||||
$trained = 1;
|
$timepast2 = $time - $train['timestamp2'];
|
||||||
while($timepast2 >= $train['eachtime']){
|
$trained = 1;
|
||||||
$timepast2 -= $train['eachtime'];
|
while($timepast2 >= $train['eachtime']){
|
||||||
$trained += 1;
|
$timepast2 -= $train['eachtime'];
|
||||||
}
|
$trained += 1;
|
||||||
if($trained > $train['amt']){
|
}
|
||||||
|
if($trained > $train['amt']){
|
||||||
|
$trained = $train['amt'];
|
||||||
|
}
|
||||||
|
}else{
|
||||||
$trained = $train['amt'];
|
$trained = $train['amt'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if($train['unit']>60 && $train['unit']!=99){
|
if($train['unit']>60 && $train['unit']!=99){
|
||||||
$database->modifyUnit($train['vref'],array($train['unit']-60),array($trained),array(1));
|
$database->modifyUnit($train['vref'],array($train['unit']-60),array($trained),array(1));
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
+1
-55
@@ -6113,9 +6113,7 @@ References: User ID/Message ID, Mode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ( $each == 0 ) {
|
|
||||||
$each = 1;
|
|
||||||
}
|
|
||||||
$time2 = $now + $each;
|
$time2 = $now + $each;
|
||||||
if ( count( $queued ) > 0 ) {
|
if ( count( $queued ) > 0 ) {
|
||||||
$time += $queued[ count( $queued ) - 1 ]['timestamp'] - $now;
|
$time += $queued[ count( $queued ) - 1 ]['timestamp'] - $now;
|
||||||
@@ -7882,58 +7880,6 @@ References:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/***************************
|
|
||||||
Function checkAttack
|
|
||||||
Made by: Shadow
|
|
||||||
***************************/
|
|
||||||
// no need to cache this method
|
|
||||||
function checkAttack($wref, $toWref) {
|
|
||||||
list($wref, $toWref) = $this->escape_input((int) $wref, (int) $toWref);
|
|
||||||
|
|
||||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and (" . TB_PREFIX . "attacks.attack_type = 3 or " . TB_PREFIX . "attacks.attack_type = 4) ORDER BY endtime ASC";
|
|
||||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
|
||||||
|
|
||||||
if ($result['Total']) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/***************************
|
|
||||||
Function checkEnforce
|
|
||||||
Made by: Shadow
|
|
||||||
***************************/
|
|
||||||
// no need to cache this method
|
|
||||||
function checkEnforce($wref, $toWref) {
|
|
||||||
list($wref, $toWref) = $this->escape_input((int) $wref, (int) $toWref);
|
|
||||||
|
|
||||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and " . TB_PREFIX . "attacks.attack_type = 2 ORDER BY endtime ASC";
|
|
||||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
|
||||||
if($result['Total']) {
|
|
||||||
return true;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/***************************
|
|
||||||
Function checkScout
|
|
||||||
Made by: yi12345
|
|
||||||
***************************/
|
|
||||||
// no need to cache this method
|
|
||||||
function checkScout($wref, $toWref) {
|
|
||||||
list($wref, $toWref) = $this->escape_input((int) $wref, (int) $toWref);
|
|
||||||
|
|
||||||
$q = "SELECT Count(*) as Total FROM " . TB_PREFIX . "movement, " . TB_PREFIX . "attacks where " . TB_PREFIX . "movement.from = $wref and " . TB_PREFIX . "movement.to = $toWref and " . TB_PREFIX . "movement.ref = " . TB_PREFIX . "attacks.id and " . TB_PREFIX . "movement.proc = 0 and " . TB_PREFIX . "movement.sort_type = 3 and " . TB_PREFIX . "attacks.attack_type = 1 ORDER BY endtime ASC";
|
|
||||||
$result = mysqli_fetch_array(mysqli_query($this->dblink,$q), MYSQLI_ASSOC);
|
|
||||||
if($result['Total']) {
|
|
||||||
return true;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// database is not needed if we're displaying static pages
|
// database is not needed if we're displaying static pages
|
||||||
|
|||||||
@@ -628,6 +628,7 @@ define("TROOPS","Troops");
|
|||||||
define("TROOPSFROM","Troops");
|
define("TROOPSFROM","Troops");
|
||||||
define("BOUNTY","Bounty");
|
define("BOUNTY","Bounty");
|
||||||
define("ARRIVAL","Arrival");
|
define("ARRIVAL","Arrival");
|
||||||
|
define("CATAPULT_TARGET","Catapult target(s)");
|
||||||
define("INCOMING_TROOPS","Incoming Troops");
|
define("INCOMING_TROOPS","Incoming Troops");
|
||||||
define("TROOPS_ON_THEIR_WAY","Troops on their way");
|
define("TROOPS_ON_THEIR_WAY","Troops on their way");
|
||||||
define("OWN_TROOPS","Own troops");
|
define("OWN_TROOPS","Own troops");
|
||||||
|
|||||||
@@ -640,7 +640,6 @@ private function trainUnit($unit,$amt,$great=false) {
|
|||||||
$clay = ${'u'.$unit}['clay'] * $amt * ($great?3:1);
|
$clay = ${'u'.$unit}['clay'] * $amt * ($great?3:1);
|
||||||
$iron = ${'u'.$unit}['iron'] * $amt * ($great?3:1);
|
$iron = ${'u'.$unit}['iron'] * $amt * ($great?3:1);
|
||||||
$crop = ${'u'.$unit}['crop'] * $amt * ($great?3:1);
|
$crop = ${'u'.$unit}['crop'] * $amt * ($great?3:1);
|
||||||
$each = ($each == 0) ? 1 : $each;
|
|
||||||
$time = $each*$amt;
|
$time = $each*$amt;
|
||||||
if($database->modifyResource($village->wid,$wood,$clay,$iron,$crop,0) && $amt > 0) {
|
if($database->modifyResource($village->wid,$wood,$clay,$iron,$crop,0) && $amt > 0) {
|
||||||
$database->trainUnit($village->wid,$unit+($great?60:0),$amt,${'u'.$unit}['pop'],$each,time()+$time,0);
|
$database->trainUnit($village->wid,$unit+($great?60:0),$amt,${'u'.$unit}['pop'],$each,time()+$time,0);
|
||||||
|
|||||||
+41
-9
@@ -363,7 +363,7 @@ class Units {
|
|||||||
if ( $data['u11'] < 0 ) {
|
if ( $data['u11'] < 0 ) {
|
||||||
$form->addError( "error", "You can't send negative units." );
|
$form->addError( "error", "You can't send negative units." );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $form->returnErrors() > 0 ) {
|
if ( $form->returnErrors() > 0 ) {
|
||||||
$_SESSION['errorarray'] = $form->getErrors();
|
$_SESSION['errorarray'] = $form->getErrors();
|
||||||
$_SESSION['valuearray'] = $_POST;
|
$_SESSION['valuearray'] = $_POST;
|
||||||
@@ -503,8 +503,44 @@ class Units {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$rallyPointLevel = ($village->resarray)['f39'];
|
||||||
|
$invalidBuildings = [];
|
||||||
|
|
||||||
|
// fill the array with the invalid buildings
|
||||||
|
if($rallyPointLevel >= 3 && $rallyPointLevel < 5){
|
||||||
|
for($i = 1; $i <= 37; $i++){
|
||||||
|
if(!in_array($i, [10, 11])) $invalidBuildings[] = $i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if($rallyPointLevel >= 5 && $rallyPointLevel < 10){
|
||||||
|
for($i = 12; $i <= 37; $i++) $invalidBuildings[] = $i;
|
||||||
|
}
|
||||||
|
else if($rallyPointLevel >= 10){
|
||||||
|
$invalidBuildings = [23, 31, 32, 33, 34, 36];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($post['ctar1']) && $post['ctar1'] != 0){
|
||||||
|
// check if the player has selected a valid building
|
||||||
|
if($rallyPointLevel < 3 || $data['u8'] == 0 || in_array($post['ctar1'], $invalidBuildings) || $post['ctar1'] < 0 || $post['ctar1'] > 40){
|
||||||
|
$post['ctar1'] = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isset($post['ctar2']) && $post['ctar2'] != 0){
|
||||||
|
// check if there are atleast 20 catapults
|
||||||
|
if($data['u8'] < 20 || $rallyPointLevel != 20){
|
||||||
|
$post['ctar2'] = 0;
|
||||||
|
}else{
|
||||||
|
// check if the player has selected a valid building
|
||||||
|
if(in_array($post['ctar2'], $invalidBuildings) || ($post['ctar2'] < 0 || $post['ctar2'] > 40 && $post['ctar2'] != 99)){
|
||||||
|
$post['ctar2'] = 99;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//TODO: check those instructions, i think that they're wrong
|
||||||
if ( isset( $post['ctar1'] ) ) {
|
if ( isset( $post['ctar1'] ) ) {
|
||||||
if ( $artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0 or $good_artefact == 1 ) {
|
if ( $artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0 or $good_artefact == 1 ) {
|
||||||
if ( $post['ctar1'] != 40 or $post['ctar1'] != 27 and $iswwvilla == 1 ) {
|
if ( $post['ctar1'] != 40 or $post['ctar1'] != 27 and $iswwvilla == 1 ) {
|
||||||
@@ -512,12 +548,11 @@ class Units {
|
|||||||
} else {
|
} else {
|
||||||
$post['ctar1'] = 99;
|
$post['ctar1'] = 99;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$post['ctar1'] = $post['ctar1'];
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$post['ctar1'] = 0;
|
$post['ctar1'] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset( $post['ctar2'] ) ) {
|
if ( isset( $post['ctar2'] ) ) {
|
||||||
if ( $artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0 or $good_artefact == 1 ) {
|
if ( $artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0 or $good_artefact == 1 ) {
|
||||||
if ( $post['ctar2'] != 40 or $post['ctar2'] != 27 and $iswwvilla == 1 ) {
|
if ( $post['ctar2'] != 40 or $post['ctar2'] != 27 and $iswwvilla == 1 ) {
|
||||||
@@ -525,15 +560,12 @@ class Units {
|
|||||||
} else {
|
} else {
|
||||||
$post['ctar2'] = 99;
|
$post['ctar2'] = 99;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$post['ctar2'] = $post['ctar2'];
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$post['ctar2'] = 0;
|
$post['ctar2'] = 0;
|
||||||
}
|
}
|
||||||
if ( isset( $post['spy'] ) ) {
|
|
||||||
$post['spy'] = $post['spy'];
|
if (!isset($post['spy'])) {
|
||||||
} else {
|
|
||||||
$post['spy'] = 0;
|
$post['spy'] = 0;
|
||||||
}
|
}
|
||||||
$abdata = $database->getABTech( $village->wid );
|
$abdata = $database->getABTech( $village->wid );
|
||||||
|
|||||||
@@ -60,6 +60,19 @@ $to = $database->getOMInfo($units[$y]['to']);}
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</tr></tbody>
|
</tr></tbody>
|
||||||
|
<?php if($units[$y]['t8'] > 0 && $units[$y]['attack_type'] == 3 && !$database->isVillageOases($units[$y]['to'])){ ?>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th><?php echo CATAPULT_TARGET;?></th>
|
||||||
|
<td style="text-align: center" colspan="5">
|
||||||
|
<?php echo $units[$y]['ctar1'] == 0 ? "Random" : $building->procResType($units[$y]['ctar1']); ?>
|
||||||
|
</td>
|
||||||
|
<td style="text-align: center" colspan="<?php if($units[$y]['t11'] == 0) {echo"5";}else{echo"6";}?>">
|
||||||
|
<?php echo $units[$y]['ctar2'] == 99 ? "Random" : ($units[$y]['ctar2'] == 0 ? "-" : $building->procResType($units[$y]['ctar2'])); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
<?php } ?>
|
||||||
<tbody class="infos">
|
<tbody class="infos">
|
||||||
<tr>
|
<tr>
|
||||||
<th><?php echo ARRIVAL;?></th>
|
<th><?php echo ARRIVAL;?></th>
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ $dur=round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
//-- If available resources combined are not enough, remove NPC button
|
//-- 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']);
|
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||||
|
|
||||||
@@ -75,7 +75,7 @@ $dur=round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
echo "|<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>";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ for($i=4;$i<=6;$i++) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
echo "|<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>";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ for($i=15;$i<=16;$i++) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
|
|
||||||
//-- If available resources combined are not enough, remove NPC button
|
//-- 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']);
|
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ for($i=23;$i<=26;$i++) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
|
|
||||||
//-- If available resources combined are not enough, remove NPC button
|
//-- 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']);
|
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ for($i=35;$i<=36;$i++) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
|
|
||||||
//-- If available resources combined are not enough, remove NPC button
|
//-- 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']);
|
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ for($i=45;$i<=46;$i++) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
echo "</div></td>
|
echo "</div></td>
|
||||||
<td class=\"val\">
|
<td class=\"val\">
|
||||||
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
|
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"10\">
|
||||||
|
|||||||
@@ -65,7 +65,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
|
|
||||||
//-- If available resources combined are not enough, remove NPC button
|
//-- 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']);
|
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ $dur=round(${'u'.$i}['time'] * ($bid25[$village->resarray['f'.$id]]['attri'] / 1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
//-- If available resources combined are not enough, remove NPC button
|
//-- 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']);
|
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||||
|
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ $dur=round(${'u'.$i}['time'] * ($bid26[$village->resarray['f'.$id]]['attri'] / 1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
|
|
||||||
//-- If available resources combined are not enough, remove NPC button
|
//-- 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']);
|
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ $dur=round(${'u'.$i}['time'] * ($bid29[$village->resarray['f'.$id]]['attri'] / 1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
|
|
||||||
//-- If available resources combined are not enough, remove NPC button
|
//-- 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']);
|
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ $dur=round(${'u'.$i}['time'] * ($bid30[$village->resarray['f'.$id]]['attri'] * (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
|
|
||||||
//-- If available resources combined are not enough, remove NPC button
|
//-- 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']);
|
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ $dur=round(${'u'.$i}['time'] * ($bid42[$village->resarray['f'.$id]]['attri'] / 1
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dur=$generator->getTimeFormat($dur);
|
$dur=$generator->getTimeFormat($dur);
|
||||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
echo $dur;
|
||||||
|
|
||||||
//-- If available resources combined are not enough, remove NPC button
|
//-- 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']);
|
$total_required = (int)(${'u'.$i}['wood'] + ${'u'.$i}['clay'] + ${'u'.$i}['iron'] + ${'u'.$i}['crop']);
|
||||||
|
|||||||
@@ -250,7 +250,7 @@ if($armoury == 0 && ($mainbuilding <= 2 || $academy == 0)) {
|
|||||||
if($cropland <= 4) {
|
if($cropland <= 4) {
|
||||||
include("soon/grainmill.tpl");
|
include("soon/grainmill.tpl");
|
||||||
}
|
}
|
||||||
if($marketplace == 0 && ($mainbuilding <= 2 || $granary <= 0 || $warehouse <= 0)) {
|
if($market == 0 && ($mainbuilding <= 2 || $granary <= 0 || $warehouse <= 0)) {
|
||||||
include("soon/marketplace.tpl");
|
include("soon/marketplace.tpl");
|
||||||
}
|
}
|
||||||
if($residence == 0 && $mainbuilding <= 4) {
|
if($residence == 0 && $mainbuilding <= 4) {
|
||||||
|
|||||||
@@ -242,6 +242,7 @@ $end = ($tribe*10);
|
|||||||
<option value="26">Palace</option>
|
<option value="26">Palace</option>
|
||||||
<option value="27">Treasury</option>
|
<option value="27">Treasury</option>
|
||||||
<option value="28">Trade office</option>
|
<option value="28">Trade office</option>
|
||||||
|
<option value="35">Brewery</option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<option value="38">Great warehouse</option>
|
<option value="38">Great warehouse</option>
|
||||||
<option value="39">Great granary</option>
|
<option value="39">Great granary</option>
|
||||||
@@ -298,6 +299,7 @@ $end = ($tribe*10);
|
|||||||
|
|
||||||
<option value="27">Treasury</option>
|
<option value="27">Treasury</option>
|
||||||
<option value="28">Trade office</option>
|
<option value="28">Trade office</option>
|
||||||
|
<option value="35">Brewery</option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<option value="38">Great warehouse</option>
|
<option value="38">Great warehouse</option>
|
||||||
<option value="39">Great granary</option>
|
<option value="39">Great granary</option>
|
||||||
|
|||||||
@@ -228,6 +228,7 @@ $actionType = "Raid";
|
|||||||
|
|
||||||
<option value="27">Treasury</option>
|
<option value="27">Treasury</option>
|
||||||
<option value="28">Trade office</option>
|
<option value="28">Trade office</option>
|
||||||
|
<option value="35">Brewery</option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<option value="38">Great warehouse</option>
|
<option value="38">Great warehouse</option>
|
||||||
<option value="39">Great granary</option>
|
<option value="39">Great granary</option>
|
||||||
@@ -282,6 +283,7 @@ $actionType = "Raid";
|
|||||||
|
|
||||||
<option value="27">Treasury</option>
|
<option value="27">Treasury</option>
|
||||||
<option value="28">Trade office</option>
|
<option value="28">Trade office</option>
|
||||||
|
<option value="35">Brewery</option>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<option value="38">Great warehouse</option>
|
<option value="38">Great warehouse</option>
|
||||||
<option value="39">Great granary</option>
|
<option value="39">Great granary</option>
|
||||||
|
|||||||
Reference in New Issue
Block a user