mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-15 15:51:01 +00:00
@@ -27,7 +27,6 @@ include_once($autoprefix."GameEngine/Database.php");
|
|||||||
|
|
||||||
$id = (int) $_POST['id'];
|
$id = (int) $_POST['id'];
|
||||||
$amt = (int) $_POST['vill_amount'];
|
$amt = (int) $_POST['vill_amount'];
|
||||||
$addUnitsWrefs = [];
|
|
||||||
|
|
||||||
for($i=1;$i<=$amt;$i++) {
|
for($i=1;$i<=$amt;$i++) {
|
||||||
|
|
||||||
@@ -41,7 +40,7 @@ $addUnitsWrefs = [];
|
|||||||
mysqli_query($GLOBALS["link"], $q);
|
mysqli_query($GLOBALS["link"], $q);
|
||||||
$pop = $automation->recountPop($wid);
|
$pop = $automation->recountPop($wid);
|
||||||
$cp = $automation->recountPop($wid);
|
$cp = $automation->recountPop($wid);
|
||||||
$addUnitsWrefs[] = $wid;
|
$database->addUnits($wid);
|
||||||
$database->addTech($wid);
|
$database->addTech($wid);
|
||||||
$database->addABTech($wid);
|
$database->addABTech($wid);
|
||||||
$speed = NATARS_UNITS;
|
$speed = NATARS_UNITS;
|
||||||
@@ -51,8 +50,6 @@ $addUnitsWrefs = [];
|
|||||||
$database->addArtefact($wid, 3, 11, 1, PLAN, $desc, '', 'type1.gif');
|
$database->addArtefact($wid, 3, 11, 1, PLAN, $desc, '', 'type1.gif');
|
||||||
}
|
}
|
||||||
|
|
||||||
$database->addUnits($addUnitsWrefs);
|
|
||||||
|
|
||||||
$myFile = "../../../Templates/text.tpl";
|
$myFile = "../../../Templates/text.tpl";
|
||||||
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: templates/text.tpl");
|
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: templates/text.tpl");
|
||||||
$text = file_get_contents("../../../Templates/text_format.tpl");
|
$text = file_get_contents("../../../Templates/text_format.tpl");
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ include_once($autoprefix."GameEngine/Database.php");
|
|||||||
|
|
||||||
$id = (int) $_POST['id'];
|
$id = (int) $_POST['id'];
|
||||||
$amt = (int) $_POST['vill_amount'];
|
$amt = (int) $_POST['vill_amount'];
|
||||||
$addUnitsWrefs = [];
|
|
||||||
$addTechWrefs = [];
|
$addTechWrefs = [];
|
||||||
$addABTechWrefs = [];
|
$addABTechWrefs = [];
|
||||||
|
|
||||||
@@ -44,17 +43,16 @@ for($i=1;$i<=$amt;$i++) {
|
|||||||
mysqli_query($GLOBALS["link"], $q);
|
mysqli_query($GLOBALS["link"], $q);
|
||||||
$pop = $automation->recountPop($wid);
|
$pop = $automation->recountPop($wid);
|
||||||
$cp = $automation->recountPop($wid);
|
$cp = $automation->recountPop($wid);
|
||||||
$addUnitsWrefs[] = $wid;
|
|
||||||
$addTechWrefs[] = $wid;
|
$addTechWrefs[] = $wid;
|
||||||
$addABTechWrefs[] = $wid;
|
$addABTechWrefs[] = $wid;
|
||||||
$speed = NATARS_UNITS;
|
$speed = NATARS_UNITS;
|
||||||
|
|
||||||
//new with random amount of troops
|
//new with random amount of troops
|
||||||
$q = "INSERT IGNORE INTO " . TB_PREFIX . "units SET u41 = " . (rand(50, 1200) * $speed) . ", u42 = " . (rand(100, 1400) * $speed) . ", u43 = " . (rand(200, 1600) * $speed) . ", u44 = " . (rand(10, 50) * $speed) . ", u45 = " . (rand(48, 1700) * $speed) . ", u46 = " . (rand(60, 1800) * $speed) . ", u47 = " . (rand(200, 1600) * $speed) . ", u48 = " . (rand(40, 200) * $speed) . " , u49 = " . (rand(4, 20) * $speed) . ", u50 = " . (rand(5, 25) * $speed) . " WHERE vref = ".$wid;
|
$database->addUnits($wid);
|
||||||
|
$q = "UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(50, 1200) * $speed) . ", u42 = " . (rand(100, 1400) * $speed) . ", u43 = " . (rand(200, 1600) * $speed) . ", u44 = " . (rand(10, 50) * $speed) . ", u45 = " . (rand(48, 1700) * $speed) . ", u46 = " . (rand(60, 1800) * $speed) . ", u47 = " . (rand(200, 1600) * $speed) . ", u48 = " . (rand(40, 200) * $speed) . " , u49 = " . (rand(4, 20) * $speed) . ", u50 = " . (rand(5, 25) * $speed) . " WHERE vref = '".$wid."'";
|
||||||
mysqli_query($GLOBALS["link"], $q);
|
mysqli_query($GLOBALS["link"], $q);
|
||||||
}
|
}
|
||||||
|
|
||||||
$database->addUnits($addUnitsWrefs);
|
|
||||||
$database->addTech($addTechWrefs);
|
$database->addTech($addTechWrefs);
|
||||||
$database->addABTech($addABTechWrefs);
|
$database->addABTech($addABTechWrefs);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user