mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-12 23:56:08 +00:00
fix duplicates when found new village + show returning scouts on rally point
This commit is contained in:
@@ -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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
}
|
||||
$this->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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
$to = $database->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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
}
|
||||
else{
|
||||
// here must come movement from returning settlers
|
||||
$database->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")) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user