mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-25 03:16:39 +08:00
forgot some things in the last fix + fix artefact1 and artefact2 checking
This commit is contained in:
@@ -2085,9 +2085,9 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
|||||||
$artefact2 = count($database->getOwnUniqueArtefactInfo2($from['owner'],2,2,0));
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($from['owner'],2,2,0));
|
||||||
if($artefact > 0){
|
if($artefact > 0){
|
||||||
$fastertroops = 3;
|
$fastertroops = 3;
|
||||||
}else if($artefact1 > 1){
|
}else if($artefact1 > 0){
|
||||||
$fastertroops = 2;
|
$fastertroops = 2;
|
||||||
}else if($artefact2 > 1){
|
}else if($artefact2 > 0){
|
||||||
$fastertroops = 1.5;
|
$fastertroops = 1.5;
|
||||||
}else{
|
}else{
|
||||||
$fastertroops = 1;
|
$fastertroops = 1;
|
||||||
@@ -2203,9 +2203,9 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
|||||||
$artefact2 = count($database->getOwnUniqueArtefactInfo2($from['owner'],2,2,0));
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($from['owner'],2,2,0));
|
||||||
if($artefact > 0){
|
if($artefact > 0){
|
||||||
$fastertroops = 3;
|
$fastertroops = 3;
|
||||||
}else if($artefact1 > 1){
|
}else if($artefact1 > 0){
|
||||||
$fastertroops = 2;
|
$fastertroops = 2;
|
||||||
}else if($artefact2 > 1){
|
}else if($artefact2 > 0){
|
||||||
$fastertroops = 1.5;
|
$fastertroops = 1.5;
|
||||||
}else{
|
}else{
|
||||||
$fastertroops = 1;
|
$fastertroops = 1;
|
||||||
@@ -2371,9 +2371,9 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
|||||||
$artefact2 = count($database->getOwnUniqueArtefactInfo2($from['owner'],2,2,0));
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($from['owner'],2,2,0));
|
||||||
if($artefact > 0){
|
if($artefact > 0){
|
||||||
$fastertroops = 3;
|
$fastertroops = 3;
|
||||||
}else if($artefact1 > 1){
|
}else if($artefact1 > 0){
|
||||||
$fastertroops = 2;
|
$fastertroops = 2;
|
||||||
}else if($artefact2 > 1){
|
}else if($artefact2 > 0){
|
||||||
$fastertroops = 1.5;
|
$fastertroops = 1.5;
|
||||||
}else{
|
}else{
|
||||||
$fastertroops = 1;
|
$fastertroops = 1;
|
||||||
|
|||||||
@@ -408,10 +408,10 @@ class Technology {
|
|||||||
if($artefact > 0){
|
if($artefact > 0){
|
||||||
$upkeep /= 2;
|
$upkeep /= 2;
|
||||||
$upkeep = round($upkeep);
|
$upkeep = round($upkeep);
|
||||||
}else if($artefact1 > 1){
|
}else if($artefact1 > 0){
|
||||||
$upkeep /= 2;
|
$upkeep /= 2;
|
||||||
$upkeep = round($upkeep);
|
$upkeep = round($upkeep);
|
||||||
}else if($artefact2 > 1){
|
}else if($artefact2 > 0){
|
||||||
$upkeep /= 4;
|
$upkeep /= 4;
|
||||||
$upkeep = round($upkeep);
|
$upkeep = round($upkeep);
|
||||||
$upkeep *= 3;
|
$upkeep *= 3;
|
||||||
|
|||||||
+5
-17
@@ -311,9 +311,9 @@ class Units {
|
|||||||
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0));
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0));
|
||||||
if($artefact > 0){
|
if($artefact > 0){
|
||||||
$fastertroops = 3;
|
$fastertroops = 3;
|
||||||
}else if($artefact1 > 1){
|
}else if($artefact1 > 0){
|
||||||
$fastertroops = 2;
|
$fastertroops = 2;
|
||||||
}else if($artefact2 > 1){
|
}else if($artefact2 > 0){
|
||||||
$fastertroops = 1.5;
|
$fastertroops = 1.5;
|
||||||
}else{
|
}else{
|
||||||
$fastertroops = 1;
|
$fastertroops = 1;
|
||||||
@@ -439,9 +439,9 @@ class Units {
|
|||||||
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0));
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0));
|
||||||
if($artefact > 0){
|
if($artefact > 0){
|
||||||
$fastertroops = 3;
|
$fastertroops = 3;
|
||||||
}else if($artefact1 > 1){
|
}else if($artefact1 > 0){
|
||||||
$fastertroops = 2;
|
$fastertroops = 2;
|
||||||
}else if($artefact2 > 1){
|
}else if($artefact2 > 0){
|
||||||
$fastertroops = 1.5;
|
$fastertroops = 1.5;
|
||||||
}else{
|
}else{
|
||||||
$fastertroops = 1;
|
$fastertroops = 1;
|
||||||
@@ -475,21 +475,9 @@ class Units {
|
|||||||
if($rallypoint['f39'] > 0){
|
if($rallypoint['f39'] > 0){
|
||||||
if($cps >= $need_cps) {
|
if($cps >= $need_cps) {
|
||||||
$unit = ($session->tribe*10);
|
$unit = ($session->tribe*10);
|
||||||
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
|
|
||||||
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
|
|
||||||
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0));
|
|
||||||
if($artefact > 0){
|
|
||||||
$fastertroops = 3;
|
|
||||||
}else if($artefact1 > 1){
|
|
||||||
$fastertroops = 2;
|
|
||||||
}else if($artefact2 > 1){
|
|
||||||
$fastertroops = 1.5;
|
|
||||||
}else{
|
|
||||||
$fastertroops = 1;
|
|
||||||
}
|
|
||||||
$database->modifyResource($village->wid,750,750,750,750,0);
|
$database->modifyResource($village->wid,750,750,750,750,0);
|
||||||
$database->modifyUnit($village->wid,array($unit),array(3),array(0));
|
$database->modifyUnit($village->wid,array($unit),array(3),array(0));
|
||||||
$database->addMovement(5,$village->wid,$post['s'],0,time(),round(($post['timestamp']-time())/$fastertroops)+time());
|
$database->addMovement(5,$village->wid,$post['s'],0,time(),$post['timestamp']);
|
||||||
header("Location: build.php?id=39");
|
header("Location: build.php?id=39");
|
||||||
|
|
||||||
if($form->returnErrors() > 0) {
|
if($form->returnErrors() > 0) {
|
||||||
|
|||||||
@@ -7,7 +7,19 @@ $from = array('x'=>$eigen['x'], 'y'=>$eigen['y']);
|
|||||||
|
|
||||||
$to = array('x'=>$coor['x'], 'y'=>$coor['y']);
|
$to = array('x'=>$coor['x'], 'y'=>$coor['y']);
|
||||||
|
|
||||||
$time = $generator->procDistanceTime($from,$to,300,0);
|
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
|
||||||
|
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
|
||||||
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,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($from,$to,300,0)/$fastertroops);
|
||||||
|
|
||||||
// Temp
|
// Temp
|
||||||
|
|
||||||
@@ -368,8 +380,19 @@ $end = ($tribe*10);
|
|||||||
|
|
||||||
$process['c'] = 1;
|
$process['c'] = 1;
|
||||||
|
|
||||||
|
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
|
||||||
$time = $generator->procDistanceTime($from,$to,min($speeds),1);
|
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
|
||||||
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,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($from,$to,min($speeds),1)/$fastertroops);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,19 @@ $from = array('x'=>$eigen['x'], 'y'=>$eigen['y']);
|
|||||||
|
|
||||||
$to = array('x'=>$coor['x'], 'y'=>$coor['y']);
|
$to = array('x'=>$coor['x'], 'y'=>$coor['y']);
|
||||||
|
|
||||||
$time = $generator->procDistanceTime($from,$to,300,0);
|
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
|
||||||
|
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
|
||||||
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,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($from,$to,300,0)/$fastertroops);
|
||||||
|
|
||||||
// Temp
|
// Temp
|
||||||
|
|
||||||
@@ -363,8 +375,19 @@ $actionType = "Raid";
|
|||||||
|
|
||||||
$process['c'] = 1;
|
$process['c'] = 1;
|
||||||
|
|
||||||
|
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
|
||||||
$time = $generator->procDistanceTime($from,$to,min($speeds),1);
|
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
|
||||||
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,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($from,$to,min($speeds),1)/$fastertroops);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,19 @@ $newvillage = $database->getMInfo($_GET['id']);
|
|||||||
$eigen = $database->getCoor($village->wid);
|
$eigen = $database->getCoor($village->wid);
|
||||||
$from = array('x'=>$eigen['x'], 'y'=>$eigen['y']);
|
$from = array('x'=>$eigen['x'], 'y'=>$eigen['y']);
|
||||||
$to = array('x'=>$newvillage['x'], 'y'=>$newvillage['y']);
|
$to = array('x'=>$newvillage['x'], 'y'=>$newvillage['y']);
|
||||||
$time = $generator->procDistanceTime($from,$to,300,0);
|
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
|
||||||
|
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
|
||||||
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,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($from,$to,300,0)/$fastertroops);
|
||||||
|
|
||||||
echo '<pre>';
|
echo '<pre>';
|
||||||
echo '</pre>';
|
echo '</pre>';
|
||||||
|
|||||||
@@ -144,7 +144,19 @@ $tocoor = $database->getCoor($enforce['vref']);
|
|||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
}
|
}
|
||||||
$time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1);
|
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
|
||||||
|
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
|
||||||
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,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);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,19 @@ $tocoor = $database->getCoor($enforce['vref']);
|
|||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
}
|
}
|
||||||
$time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1);
|
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
|
||||||
|
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
|
||||||
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,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);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,19 @@ $tocoor = $database->getCoor($enforce['vref']);
|
|||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
}
|
}
|
||||||
$time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1);
|
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
|
||||||
|
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
|
||||||
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,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);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -145,7 +145,19 @@ $tocoor = $database->getCoor($enforce['vref']);
|
|||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
}
|
}
|
||||||
$time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1);
|
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
|
||||||
|
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
|
||||||
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,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);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
@@ -143,7 +143,19 @@ $tocoor = $database->getCoor($enforce['vref']);
|
|||||||
$hero_unit=$hero_f['unit'];
|
$hero_unit=$hero_f['unit'];
|
||||||
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
|
||||||
}
|
}
|
||||||
$time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1);
|
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
|
||||||
|
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
|
||||||
|
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,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);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user