mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-07 21:34:22 +00:00
more fixes
This commit is contained in:
+45
-13
@@ -946,6 +946,41 @@ class Automation {
|
||||
$toF = $database->getVillage($data['to']);
|
||||
$fromF = $database->getVillage($data['from']);
|
||||
|
||||
$DefenderUnit = array();
|
||||
$DefenderUnit = $database->getUnit($data['to']);
|
||||
$evasion = $database->getVillageField($data['to'],"evasion");
|
||||
$maxevasion = $database->getUserField($DefenderID,"maxevasion",0);
|
||||
$gold = $database->getUserField($DefenderID,"gold",0);
|
||||
$playerunit = ($targettribe-1)*10;
|
||||
$cannotsend = 0;
|
||||
$movements = $database->getMovement("34",$data['to'],1);
|
||||
for($y=0;$y < count($movements);$y++){
|
||||
$returntime = $units[$y]['endtime']-time();
|
||||
if($units[$y]['sort_type'] == 4 && $units[$y]['from'] != 0 && $returntime <= 10){
|
||||
$cannotsend = 1;
|
||||
}
|
||||
}
|
||||
if($evasion == 1 && $maxevasion > 0 && $gold > 1 && $cannotsend == 0){
|
||||
$totaltroops = 0;
|
||||
for($i=1;$i<=10;$i++){
|
||||
$playerunit += $i;
|
||||
$data['u'.$i] = $DefenderUnit['u'.$playerunit];
|
||||
$database->modifyUnit($data['to'],array($playerunit),array($DefenderUnit['u'.$playerunit]),array(0));
|
||||
$playerunit -= $i;
|
||||
$totaltroops += $data['u'.$i];
|
||||
}
|
||||
$data['u11'] = $DefenderUnit['hero'];
|
||||
$totaltroops += $data['u11'];
|
||||
if($totaltroops > 0){
|
||||
$database->modifyUnit($data['to'],array("hero"),array($DefenderUnit['hero']),array(0));
|
||||
$attackid = $database->addAttack($data['to'],$data['u1'],$data['u2'],$data['u3'],$data['u4'],$data['u5'],$data['u6'],$data['u7'],$data['u8'],$data['u9'],$data['u10'],$data['u11'],4,0,0,0,0,0,0,0,0,0,0,0);
|
||||
$database->addMovement(4,0,$data['to'],$attackid,time(),time()+(180/EVASION_SPEED));
|
||||
$newgold = $gold-2;
|
||||
$newmaxevasion = $maxevasion-1;
|
||||
$database->updateUserField($DefenderID, "gold", $newgold, 1);
|
||||
$database->updateUserField($DefenderID, "maxevasion", $newmaxevasion, 1);
|
||||
}
|
||||
}
|
||||
//get defence units
|
||||
$Defender = array(); $rom = $ger = $gal = $nat = $natar = 0;
|
||||
$Defender = $database->getUnit($data['to']);
|
||||
@@ -2571,7 +2606,8 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
,$troopsdead8
|
||||
,$troopsdead9
|
||||
,$troopsdead10
|
||||
,$troopsdead11);
|
||||
,$troopsdead11
|
||||
,$DefenderUnit);
|
||||
|
||||
#################################################
|
||||
|
||||
@@ -3227,25 +3263,21 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
$ourFileHandle = fopen("GameEngine/Prevention/training.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
$trainlist = $database->getTrainingList();
|
||||
if(count($trainlist) > 0) {
|
||||
foreach($trainlist as $train) {
|
||||
$database->updateTraining($train['id'],0);
|
||||
$trained = 0;
|
||||
|
||||
$timepast = $train['timestamp'] - $time;
|
||||
$trained = $timepast-($train['amt']-1)*$train['eachtime'];
|
||||
if(count($trainlist) > 0){
|
||||
foreach($trainlist as $train){
|
||||
$timepast = $train['timestamp2'] - $time;
|
||||
$pop = $train['pop'];
|
||||
if($trained <= 0){
|
||||
if($timepast <= 0 && $train['amt'] > 0) {
|
||||
if($train['unit']>60 && $train['unit']!=99){
|
||||
$database->modifyUnit($train['vref'],array($train['unit']-60),array(1),array(1));
|
||||
}else{
|
||||
$database->modifyUnit($train['vref'],array($train['unit']),array(1),array(1));
|
||||
}
|
||||
$database->updateTraining($train['id'],1);
|
||||
$database->updateTraining($train['id'],1,$train['eachtime']);
|
||||
}
|
||||
if($train['amt'] == 0){
|
||||
$database->trainUnit($train['id'],0,0,0,0,1,1);
|
||||
}
|
||||
if($timepast < 0) {
|
||||
$database->trainUnit($train['id'],0,0,0,0,1,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/training.txt")) {
|
||||
|
||||
@@ -2061,6 +2061,9 @@
|
||||
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 8:
|
||||
$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 = 4 OR " . 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;
|
||||
@@ -2159,6 +2162,31 @@
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
function getUnitsNumber($vid) {
|
||||
$q = "SELECT * from " . TB_PREFIX . "units where vref = $vid";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
$dbarray = mysql_fetch_assoc($result);
|
||||
$totalunits = 0;
|
||||
$movingunits = $this->getVillageMovement($vid);
|
||||
for($i=1;$i<=50;$i++){
|
||||
$totalunits += $dbarray['u'.$i];
|
||||
}
|
||||
$totalunits += $dbarray['hero'];
|
||||
$movingunits = $this->getVillageMovement($vid);
|
||||
$reinforcingunits = $this->getEnforceArray($vid,1);
|
||||
$owner = $this->getVillageField($vid,"owner");
|
||||
$ownertribe = $this->getUserField($owner,"tribe",0);
|
||||
$start = ($ownertribe-1)*10+1;
|
||||
$end = ($ownertribe*10);
|
||||
for($i=$start;$i<=$end;$i++){
|
||||
$totalunits += $movingunits['u'.$i];
|
||||
$totalunits += $reinforcingunits['u'.$i];
|
||||
}
|
||||
$totalunits += $movingunits['hero'];
|
||||
$totalunits += $reinforcingunits['hero'];
|
||||
return $totalunits;
|
||||
}
|
||||
|
||||
function getHero($uid=0,$all=0) {
|
||||
if ($all) {
|
||||
@@ -2295,7 +2323,7 @@
|
||||
$now = time();
|
||||
|
||||
$uid = $this->getVillageField($vid, "owner");
|
||||
|
||||
$oldeach = $each;
|
||||
$artefact = count($this->getOwnUniqueArtefactInfo2($uid,5,3,0));
|
||||
$artefact1 = count($this->getOwnUniqueArtefactInfo2($vid,5,1,1));
|
||||
$artefact2 = count($this->getOwnUniqueArtefactInfo2($uid,5,2,0));
|
||||
@@ -2315,18 +2343,25 @@
|
||||
$each = round($each);
|
||||
}
|
||||
if($each == 0){ $each = 1; }
|
||||
$time2 = $now+$each;
|
||||
if(count($queued) > 0) {
|
||||
$time += $queued[count($queued) - 1]['timestamp'] - $now;
|
||||
$time2 += $queued[count($queued) - 1]['timestamp'] - $now;
|
||||
}
|
||||
$q = "INSERT INTO " . TB_PREFIX . "training values (0,$vid,$unit,$amt,$pop,$time,$each)";
|
||||
if($queued[count($queued) - 1]['unit'] == $unit){
|
||||
$time = $amt*$oldeach;
|
||||
$q = "UPDATE " . TB_PREFIX . "training SET amt = amt + $amt, timestamp = timestamp + $time WHERE id = ".$queued[count($queued) - 1]['id']."";
|
||||
}else{
|
||||
$q = "INSERT INTO " . TB_PREFIX . "training values (0,$vid,$unit,$amt,$pop,$time,$each,$time2)";
|
||||
}
|
||||
} else {
|
||||
$q = "DELETE FROM " . TB_PREFIX . "training where id = $vid";
|
||||
}
|
||||
return mysql_query($q, $this->connection);
|
||||
}
|
||||
|
||||
function updateTraining($id, $trained) {
|
||||
$q = "UPDATE " . TB_PREFIX . "training set amt = amt - $trained where id = $id";
|
||||
function updateTraining($id, $trained, $each) {
|
||||
$q = "UPDATE " . TB_PREFIX . "training set amt = amt - $trained,timestamp2 = timestamp2 + $each where id = $id";
|
||||
return mysql_query($q, $this->connection);
|
||||
}
|
||||
|
||||
@@ -3084,6 +3119,8 @@
|
||||
return $casualties;
|
||||
}
|
||||
|
||||
//end general statistics
|
||||
|
||||
function addFriend($uid, $column, $friend) {
|
||||
$q = "UPDATE " . TB_PREFIX . "users SET $column = $friend WHERE id = $uid";
|
||||
return mysql_query($q, $this->connection);
|
||||
@@ -3113,8 +3150,17 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setVillageEvasion($vid) {
|
||||
$village = $this->getVillage($vid);
|
||||
if($village['evasion'] == 0){
|
||||
$q = "UPDATE " . TB_PREFIX . "vdata SET evasion = 1 WHERE wref = $vid";
|
||||
}else{
|
||||
$q = "UPDATE " . TB_PREFIX . "vdata SET evasion = 0 WHERE wref = $vid";
|
||||
}
|
||||
return mysql_query($q, $this->connection);
|
||||
}
|
||||
}
|
||||
;
|
||||
|
||||
|
||||
@@ -420,7 +420,6 @@ class Technology {
|
||||
$upkeep /= 4;
|
||||
$upkeep = round($upkeep);
|
||||
$upkeep *= 3;
|
||||
$upkeep = round($upkeep);
|
||||
}
|
||||
return $upkeep;
|
||||
}
|
||||
|
||||
@@ -20,5 +20,57 @@ if(!$session->goldclub) {
|
||||
<div id="raidList">
|
||||
<?php include "Templates/goldClub/farmlist.tpl"; ?>
|
||||
</div>
|
||||
<br />
|
||||
<table cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="4">evasion settings</th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td></td>
|
||||
|
||||
<td>village</td>
|
||||
|
||||
<td>own troops</td>
|
||||
|
||||
<td>reinforcement</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
for($i=0;$i<=count($session->villages)-1;$i++) {
|
||||
$wref = $session->villages[$i];
|
||||
$vname = $database->getVillageField($wref,"name");
|
||||
$vchecked = $database->getVillageField($wref,"evasion");
|
||||
$reinf = $database->getEnforceVillage($wref,0);
|
||||
if($vchecked == 1){ $checked = 'checked'; }else{ $checked = ''; }
|
||||
?>
|
||||
<tr>
|
||||
<td><input type="checkbox" class="check" name="hideShow" onclick="window.location.href = '?gid=16&t=99&evasion=<?php echo $wref;?>';" <?php echo $checked; ?>></td>
|
||||
|
||||
<td><?php echo $vname; ?></td>
|
||||
|
||||
<td><?php echo $database->getUnitsNumber($wref); ?></td>
|
||||
|
||||
<td><?php echo count($reinf); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
$user = $database->getUserArray($session->uid, 1);
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<form action="build.php?id=39&t=99" method="POST">
|
||||
<br />
|
||||
<tr>
|
||||
Send troops away a maximun of <input class="text" type="text" name="maxevasion" value="<?php echo $user['maxevasion']; ?>" maxlength="3" style="width:50px;"> times
|
||||
<span class="none">(costs: <img src="<?php echo GP_LOCATE; ?>img/a/gold_g.gif" alt="Gold" title="Gold"/><b>2</b> per evasion)</span>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<div class="clear"></div><p><input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" tabindex="8" alt="OK" <?php if(!$market->merchantAvail()) { echo "DISABLED"; }?>/></p></form>
|
||||
</tr>
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
@@ -136,7 +136,6 @@ if ($units[$y]['sort_type']==3){
|
||||
|
||||
|
||||
$to = $database->getMInfo($units[$y]['vref']);
|
||||
if($units[$y]['from'] != 0){
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
@@ -205,76 +204,6 @@ if($units[$y]['from'] != 0){
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a>?</a></td>
|
||||
<td colspan="<?php if($units[$y]['t11'] != 0) {echo"11";}else{echo"10";}?>"><a href="karte.php?d=<?php echo $to['wref']."&c=".$generator->getMapCheck($to['wref']); ?>"><?php echo "Returning to ".$to['name']; ?></a></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<?php
|
||||
$tribe = $session->tribe;
|
||||
$start = ($tribe-1)*10+1;
|
||||
$end = ($tribe*10);
|
||||
echo "<tr><th> </th>";
|
||||
for($i=$start;$i<=($end);$i++) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
|
||||
}
|
||||
if($units[$y]['t11'] != 0) {
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<tr><th>Troops</th>
|
||||
<?php
|
||||
for($i=1;$i<($units[$y]['t11'] != 0?12:11);$i++) {
|
||||
if($units[$y]['t'.$i] == 0) {
|
||||
echo "<td class=\"none\">0</td>";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
echo $units[$y]['t'.$i]."</td>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
<?php
|
||||
$totalres = $res['wood']+$res['clay']+$res['iron']+$res['crop'];
|
||||
if($units[$y]['attack_type']!=2 and $units[$y]['attack_type']!=1 and $totalres != ""){?>
|
||||
<tr><th>Bounty</th>
|
||||
|
||||
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
|
||||
<?php
|
||||
$totalcarry = $units[$y]['t1']*${'u'.$start.''}['cap']+$units[$y]['t2']*${'u'.($start+1).''}['cap']+$units[$y]['t3']*${'u'.($start+2).''}['cap']+$units[$y]['t4']*${'u'.($start+3).''}['cap']+$units[$y]['t5']*${'u'.($start+4).''}['cap']+$units[$y]['t6']*${'u'.($start+5).''}['cap']+$units[$y]['t7']*${'u'.($start+6).''}['cap']+$units[$y]['t8']*${'u'.($start+7).''}['cap']+$units[$y]['t9']*${'u'.($start+8).''}['cap']+$units[$y]['t10']*${'u'.($start+9).''}['cap'];
|
||||
echo "<div class=\"in small\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".$res['wood']."<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".$res['clay']."<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".$res['iron']."<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".$res['crop']."</div>";
|
||||
echo "<div class=\"in small\"><img class=\"car\" src=\"gpack/travian_default/img/a/car.gif\" alt=\"carry\" title=\"carry\"/>".$totalres."/".$totalcarry."</div>";
|
||||
?>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
|
||||
<tbody class="infos">
|
||||
<tr>
|
||||
<th>Arrival</th>
|
||||
<td colspan="<?php if($units[$y]['t11'] == 0) {echo"10";}else{echo"11";}?>">
|
||||
<?php
|
||||
echo "<div class=\"in small\"><span id=timer".$timer.">".$generator->getTimeFormat($units[$y]['endtime']-time())."</span> h</div>";
|
||||
$datetime = $generator->procMtime($units[$y]['endtime']);
|
||||
echo "<div class=\"at small\">";
|
||||
if($datetime[0] != "today") {
|
||||
echo "on ".$datetime[0]." ";
|
||||
}
|
||||
echo "at ".$datetime[1]."</div>";
|
||||
?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
echo "<img class=\"unit u".$train['unit']."\" src=\"img/x.gif\" alt=\"".$train['name']."\" title=\"".$train['name']."\" />";
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat(($train['timestamp']-time())-($train['amt']-1)*$train['eachtime']);
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
|
||||
@@ -76,7 +76,7 @@ $cps = $session->cp;
|
||||
|
||||
if($cps >= $need_cps) {
|
||||
?>
|
||||
<input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" alt="OK" src="img/x.gif" />
|
||||
<input type="image" value="ok" name="s1" id="btn_ok" class="dynamic_img" alt="OK" src="img/x.gif" onclick="this.disabled=true;this.form.submit();"/>
|
||||
<?php
|
||||
} else {
|
||||
print "$cps/$need_cps culture points";
|
||||
|
||||
@@ -52,7 +52,7 @@ $coor['y'] = "";
|
||||
</tr>
|
||||
</tbody></table>
|
||||
|
||||
<input value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" type="image">
|
||||
<input value="ok" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" type="image" onclick="this.disabled=true;this.form.submit();">
|
||||
</form>
|
||||
<p class="error"><?php echo $form->getError("error"); ?></p>
|
||||
</div>
|
||||
|
||||
@@ -18,7 +18,7 @@ $oasistype = $type['oasistype'];
|
||||
$vdata = $database->getVillage($Wref);
|
||||
$villageOwner = $database->getVillageField($Wref,'owner');
|
||||
$userAccess = $database->getUserField($villageOwner,'access',0);
|
||||
}elseif($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){{
|
||||
}elseif($_POST['x']!="" && $_POST['y']!="" && is_numeric($_POST['x']) && is_numeric($_POST['y'])){
|
||||
$Wref = $database->getVilWref($_POST['x'], $_POST['y']);
|
||||
$WrefX = $_POST['x'];
|
||||
$WrefY = $_POST['y'];
|
||||
@@ -72,7 +72,6 @@ $troops = "".$_POST['t1']."+".$_POST['t2']."+".$_POST['t3']."+".$_POST['t4']."+"
|
||||
header("Location: build.php?id=39&t=99");
|
||||
}
|
||||
}
|
||||
}
|
||||
if($FLData['owner'] == $session->uid){
|
||||
?>
|
||||
|
||||
|
||||
+17
-1
@@ -9,7 +9,7 @@
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
$aantal=(count($database->getMovement(4,$village->wid,1))+count($database->getMovement(4,$village->wid,0))+count($database->getMovement(3,$village->wid,1))+count($database->getMovement(3,$village->wid,0)));
|
||||
$aantal=(count($database->getMovement(4,$village->wid,1))+count($database->getMovement(4,$village->wid,0))+count($database->getMovement(3,$village->wid,1))+count($database->getMovement(3,$village->wid,0))+count($database->getMovement(7,$village->wid,1)));
|
||||
if($aantal > 0){
|
||||
echo '<table id="movements" cellpadding="1" cellspacing="1"><thead><tr><th colspan="3">'.TROOP_MOVEMENTS.'</th></tr></thead><tbody>';
|
||||
}
|
||||
@@ -32,6 +32,22 @@ if($aantal > 0){
|
||||
$timer += 1;
|
||||
}
|
||||
|
||||
/* Units coming back from evasion */
|
||||
$aantal = count($database->getMovement(7,$village->wid,1));
|
||||
$aantal2 = $database->getMovement(7,$village->wid,1);
|
||||
if($aantal > 0){
|
||||
foreach($aantal2 as $receive) {
|
||||
$action = 'def1';
|
||||
$aclass = 'd1';
|
||||
$title = ''.ARRIVING_REINF_TROOPS.'';
|
||||
$short = ''.ARRIVING_REINF_TROOPS_SHORT.'';
|
||||
$NextArrival[] = $receive['endtime'];
|
||||
}
|
||||
echo '<tr><td class="typ"><a href="build.php?id=39"><img src="img/x.gif" class="'.$action.'" alt="'.$title.'" title="'.$title.'" /></a><span class="'.$aclass.'">»</span></td>
|
||||
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.' '.$short.'</span></div><div class="dur_r">in <span id="timer'.$timer.'">'.$generator->getTimeFormat(min($NextArrival)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
$timer += 1;
|
||||
}
|
||||
|
||||
/* attack/raid on you! */
|
||||
$aantal = count($database->getMovement(3,$village->wid,1));
|
||||
$aantal2 = $database->getMovement(3,$village->wid,1);
|
||||
|
||||
@@ -193,6 +193,26 @@ if($session->goldclub == 1 && $session->access != BANNED){
|
||||
if($_POST['action'] == 'startRaid'){
|
||||
include ("Templates/a2b/startRaid.tpl");
|
||||
}
|
||||
|
||||
if(isset($_GET['slid']) && is_numeric($_GET['slid'])) {
|
||||
$FLData = $database->getFLData($_GET['slid']);
|
||||
if($FLData['owner'] == $session->uid){
|
||||
$checked[$_GET['slid']] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($_GET['evasion']) && is_numeric($_GET['evasion'])) {
|
||||
$evasionvillage = $database->getVillage($_GET['evasion']);
|
||||
if($evasionvillage['owner'] == $session->uid){
|
||||
$database->setVillageEvasion($_GET['evasion']);
|
||||
}
|
||||
header("Location: build.php?id=39&t=99");
|
||||
}
|
||||
|
||||
if(isset($_POST['maxevasion']) && is_numeric($_POST['maxevasion'])) {
|
||||
$database->updateUserField($session->uid, "maxevasion", $_POST['maxevasion'], 1);
|
||||
header("Location: build.php?id=39&t=99");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$create = 0;
|
||||
|
||||
@@ -70,7 +70,7 @@ header("Location: banned.php");
|
||||
<div id="mid">
|
||||
<?php include("Templates/menu.tpl"); ?>
|
||||
<div id="content" class="village2">
|
||||
<h1><?php echo $village->vname; if($village->loyalty!='100'){ if($village->loyalty>'33'){ $color="gr"; }else{ $color="re"; } ?><div id="loyality" class="<?php echo $color; ?>"><?php echo LOYALTY; ?> <?php echo floor($village->loyalty); ?>%</div><?php } ?></h1>
|
||||
<h1><?php echo $village->vname; if($village->loyalty!='100'){ if($village->loyalty>'33'){ $color="green"; }else{ $color="red"; } ?><div id="loyality"><span style="color:<?php echo $color; ?>;font-size:xx-small;" size><?php echo LOYALTY; ?> <?php echo floor($village->loyalty); ?>%</span></div><?php } ?></h1>
|
||||
<?php include("Templates/dorf2.tpl");
|
||||
if($building->NewBuilding) {
|
||||
include("Templates/Building.tpl");
|
||||
|
||||
@@ -57,6 +57,9 @@ define("GP_LOCATE", "gpack/travian_default/");
|
||||
// Values: 1 (normal), 3 (3x speed) etc...
|
||||
define("INCREASE_SPEED","%INCSPEED%");
|
||||
|
||||
// ***** Evasion Speed
|
||||
define("EVASION_SPEED","%EVASIONSPEED%");
|
||||
|
||||
// ***** Trader capacity
|
||||
// Values: 1 (normal), 3 (3x speed) etc...
|
||||
define("TRADER_CAPACITY","%TRADERCAP%");
|
||||
|
||||
@@ -1230,6 +1230,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%training` (
|
||||
`pop` int(10) unsigned NOT NULL,
|
||||
`timestamp` int(10) unsigned NOT NULL,
|
||||
`eachtime` int(10) unsigned NOT NULL,
|
||||
`timestamp2` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
@@ -1394,6 +1395,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%users` (
|
||||
`friend17wait` int(10) unsigned NOT NULL,
|
||||
`friend18wait` int(10) unsigned NOT NULL,
|
||||
`friend19wait` int(10) unsigned NOT NULL,
|
||||
`maxevasion` mediumint(3) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=5 ;
|
||||
|
||||
@@ -1436,6 +1438,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%vdata` (
|
||||
`created` int(11) NOT NULL,
|
||||
`natar` tinyint(1) unsigned NOT NULL,
|
||||
`starv` int(10) unsigned NOT NULL,
|
||||
`evasion` tinyint(1) unsigned NOT NULL,
|
||||
PRIMARY KEY (`wref`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@
|
||||
$text = preg_replace("'%LANG%'", $_POST['lang'], $text);
|
||||
$text = preg_replace("'%SPEED%'", $_POST['speed'], $text);
|
||||
$text = preg_replace("'%INCSPEED%'", $_POST['incspeed'], $text);
|
||||
$text = preg_replace("'%EVASIONSPEED%'", $_POST['evasionspeed'], $text);
|
||||
$text = preg_replace("'%TRADERCAP%'", $_POST['tradercap'], $text);
|
||||
$text = preg_replace("'%STORAGE_MULTIPLIER%'", $_POST['storage_multiplier'], $text);
|
||||
$text = preg_replace("'%UTRACK%'", $_POST['trackusers'], $text);
|
||||
|
||||
@@ -11,7 +11,8 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
|
||||
<table><tr>
|
||||
<td><span class="f9 c6">Server name:</span></td><td width="140"><input type="text" name="servername" id="servername" value="TravianZ"></td></tr><tr>
|
||||
<td><span class="f9 c6">Server speed:</span></td><td><input name="speed" type="text" id="speed" value="1" size="2"></td></tr><tr>
|
||||
<td><span class="f9 c6">Troop speed:</span></td><td width="140"><input type="text" name="incspeed" id="incspeed" value="2" size="2"></td></tr><tr>
|
||||
<td><span class="f9 c6">Troop speed:</span></td><td width="140"><input type="text" name="incspeed" id="incspeed" value="1" size="2"></td></tr><tr>
|
||||
<td><span class="f9 c6">Evasion speed:</span></td><td><input name="evasionspeed" type="text" id="evasionspeed" value="1" size="2"></td></tr><tr>
|
||||
<td><span class="f9 c6">Trader capacity (1 = 1x...):</span></td><td width="140"><input type="text" name="tradercap" id="tradercap" value="1" size="2"></td></tr><tr>
|
||||
<td><span class="f9 c6">World size:</span></td><td>
|
||||
<select name="wmax">
|
||||
|
||||
Reference in New Issue
Block a user