mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-06-28 00:24:23 +00:00
Natars automation system
+Natars will now spawn automatically, you can set how many day should
pass before the spawn of Natars (and artifacts), WW Villages and WW
building plans (Note: WW villages and WW building plans won't spawn
until the creation of the natar account)
+Added 3 timers under the left menu which indicate the spawn of
Natars/Artifacts, WW villages and WW building plans
+Added an option in the installation, to set the resource production of
oasis
+Fixed a bug that didn't permit to add multiple Units, Abtech and tech
rows with one query
+Added a new information to the Artifact of the fool, the next effect
reroll will now be displayed in his informations (in the treasury)
+Fixed a bug that dind't permit the correct timers flow in Dorf3.php
(Warehouse tab), they'll now flow correctly
+Timers and resources percentage of villages with a negative production
of crop will now be marked in red (in the Warehouse tab, Dorf3.php) and
will now be displayed in how much time the granary will be emptied
+Fixed a possible bug that prevented to add raids to farm lists
+Fixed a bug that didn't permit to create WW Villages from the
Multihunter control panel
+Reworked all timers, there will be only one timer field now (in
Session.php)
+Minor bug fixing and optimization
NOTE: To play this version of the game, you need to reinstall the server
OR you can simply add these lines of code into your "config.php" file:
// ***** Natars Spawn Time
define("NATARS_SPAWN_TIME",260);
define("NATARS_WW_SPAWN_TIME",260);
define("NATARS_WW_BUILDING_PLAN_SPAWN_TIME",260);
// ***** Oasis production
define("OASIS_WOOD_MULTIPLIER",40);
define("OASIS_CLAY_MULTIPLIER",40);
define("OASIS_IRON_MULTIPLIER",40);
define("OASIS_CROP_MULTIPLIER",40);
define("OASIS_WOOD_PRODUCTION",OASIS_WOOD_MULTIPLIER*SPEED);
define("OASIS_CLAY_PRODUCTION",OASIS_CLAY_MULTIPLIER*SPEED);
define("OASIS_IRON_PRODUCTION",OASIS_IRON_MULTIPLIER*SPEED);
define("OASIS_CROP_PRODUCTION",OASIS_CROP_MULTIPLIER*SPEED);
P.S: from the next version, the possibility to add manual WWs, WW
building plans and to create the natar account will be REMOVED.
This commit is contained in:
+19
-21
@@ -40,9 +40,7 @@ class Technology {
|
||||
global $village;
|
||||
$holder = [];
|
||||
foreach($village->researching as $research) {
|
||||
if(substr($research['tech'], 0, 1) == "t"){
|
||||
array_push($holder,$research);
|
||||
}
|
||||
if(substr($research['tech'], 0, 1) == "t") array_push($holder, $research);
|
||||
}
|
||||
return $holder;
|
||||
}
|
||||
@@ -51,29 +49,27 @@ class Technology {
|
||||
global $village;
|
||||
$holder = [];
|
||||
foreach($village->researching as $research) {
|
||||
if(substr($research['tech'],0,1) == $type){
|
||||
array_push($holder,$research);
|
||||
}
|
||||
if(substr($research['tech'], 0, 1) == $type) array_push($holder, $research);
|
||||
}
|
||||
return $holder;
|
||||
}
|
||||
|
||||
public function isResearch($tech,$type) {
|
||||
public function isResearch($tech, $type) {
|
||||
global $village;
|
||||
if(count($village->researching) == 0) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
||||
if(count($village->researching) == 0) return false;
|
||||
else
|
||||
{
|
||||
switch($type) {
|
||||
case 1: $string = "t"; break;
|
||||
case 2: $string = "a"; break;
|
||||
case 3: $string = "b"; break;
|
||||
}
|
||||
|
||||
foreach($village->researching as $research) {
|
||||
if($research['tech'] == $string.$tech) {
|
||||
return true;
|
||||
}
|
||||
if($research['tech'] == $string.$tech) return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -435,24 +431,26 @@ class Technology {
|
||||
|
||||
for ($i = $start; $i <= $end; $i ++) {
|
||||
$k = $i - $start + 1;
|
||||
$unit = $prisoners == 0 ? "u" . $i : "t" . $k;
|
||||
|
||||
$unit = "u".$i;
|
||||
$index = $prisoners == 0 ? $unit : "t".$k;
|
||||
|
||||
global $$unit;
|
||||
$dataarray = $$unit;
|
||||
|
||||
if($horsedrinking > 0) {
|
||||
if (($i == 4 && $horsedrinking >= 10) || ($i == 5 && $horsedrinking >= 15) || ( $i == 6 && $horsedrinking == 20)) {
|
||||
$upkeep += ($dataarray['pop'] - 1) * $array[$unit];
|
||||
$upkeep += ($dataarray['pop'] - 1) * $array[$index];
|
||||
}
|
||||
else $upkeep += ($dataarray['pop'] * $array[$unit]);
|
||||
else $upkeep += ($dataarray['pop'] * $array[$index]);
|
||||
}
|
||||
else $upkeep += ($dataarray['pop'] * $array[$unit]);
|
||||
else $upkeep += ($dataarray['pop'] * $array[$index]);
|
||||
}
|
||||
|
||||
$unit = ($prisoners > 0) ? 't11' : 'hero';
|
||||
$index = $prisoners > 0 ? 't11' : 'hero';
|
||||
|
||||
if(!isset($array[$unit])) $array[$unit] = 0;
|
||||
$upkeep += $array[$unit] * 6;
|
||||
if(!isset($array[$index])) $array[$index] = 0;
|
||||
$upkeep += $array[$index] * 6;
|
||||
$who = $database->getVillageField($vid, "owner");
|
||||
|
||||
return ceil($database->getArtifactsValueInfluence($who, $vid, 4, $upkeep, false));
|
||||
|
||||
Reference in New Issue
Block a user