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:
+47
-66
@@ -200,62 +200,59 @@ class Account {
|
||||
}
|
||||
|
||||
private function Login() {
|
||||
global $database,$session,$form;
|
||||
global $database, $session, $form;
|
||||
|
||||
$user = $_POST['user'];
|
||||
if(!isset($_POST['user']) || $_POST['user'] == "") {
|
||||
$form->addError("user",$user);
|
||||
if(!isset($_POST['user']) || empty($_POST['user'])){
|
||||
$form->addError("user", $user);
|
||||
}else if(!User::exists($database, $_POST['user'])){
|
||||
$form->addError("user", USR_NT_FOUND);
|
||||
}
|
||||
else if(!User::exists($database,$_POST['user'])) {
|
||||
$form->addError("user",USR_NT_FOUND);
|
||||
}
|
||||
if(!isset($_POST['pw']) || $_POST['pw'] == "") {
|
||||
$form->addError("pw",LOGIN_PASS_EMPTY);
|
||||
}
|
||||
else if(!$database->login($_POST['user'],$_POST['pw']) && !$database->sitterLogin($_POST['user'],$_POST['pw'])) {
|
||||
// try activation data if the user was not found
|
||||
if (!$userData) {
|
||||
$activateData = $database->getActivateField( $_POST['user'], 'act', 1 );
|
||||
|
||||
if ( $activateData != "" ) {
|
||||
$form->addError( "activate", $_POST['user'] );
|
||||
} else {
|
||||
$form->addError("pw",LOGIN_PW_ERROR);
|
||||
}
|
||||
} else {
|
||||
$form->addError("pw",LOGIN_PW_ERROR);
|
||||
}
|
||||
if(!isset($_POST['pw']) || empty($_POST['pw'])){
|
||||
$form->addError("pw", LOGIN_PASS_EMPTY);
|
||||
}else if(!$database->login($_POST['user'], $_POST['pw']) && !$database->sitterLogin($_POST['user'], $_POST['pw'])){
|
||||
// try activation data if the user was not found
|
||||
if(!$userData){
|
||||
$activateData = $database->getActivateField($_POST['user'], 'act', 1);
|
||||
|
||||
if(!empty($activateData)) $form->addError("activate", $_POST['user']);
|
||||
|
||||
else $form->addError("pw", LOGIN_PW_ERROR);
|
||||
}
|
||||
else $form->addError("pw", LOGIN_PW_ERROR);
|
||||
}
|
||||
|
||||
$userData = $database->getUserArray($_POST['user'], 0);
|
||||
|
||||
|
||||
// Vacation mode by Shadow
|
||||
if($userData["vac_mode"] == 1 && $userData["vac_time"] > time()) {
|
||||
$form->addError("vacation","Vacation mode is still enabled");
|
||||
if($userData["vac_mode"] == 1 && $userData["vac_time"] > time()){
|
||||
$form->addError("vacation", "Vacation mode is still enabled");
|
||||
}
|
||||
|
||||
|
||||
// Vacation mode by Shadow
|
||||
if($form->returnErrors() > 0) {
|
||||
if($form->returnErrors() > 0){
|
||||
$_SESSION['errorarray'] = $form->getErrors();
|
||||
$_SESSION['valuearray'] = $_POST;
|
||||
|
||||
|
||||
header("Location: login.php");
|
||||
exit;
|
||||
} else {
|
||||
// Vacation mode by Shadow
|
||||
$database->removevacationmode($userData['id']);
|
||||
// Vacation mode by Shadow
|
||||
if($database->login($_POST['user'],$_POST['pw'])){
|
||||
$database->UpdateOnline("login" ,$_POST['user'],time(),$userData['id']);
|
||||
}else if($database->sitterLogin($_POST['user'],$_POST['pw'])){
|
||||
$database->UpdateOnline("sitter" ,$_POST['user'],time(),$userData['id']);
|
||||
}
|
||||
setcookie("COOKUSR",$_POST['user'],time()+COOKIE_EXPIRE,COOKIE_PATH);
|
||||
$session->login($_POST['user']);
|
||||
exit();
|
||||
}else{
|
||||
// Vacation mode by Shadow
|
||||
$database->removevacationmode($userData['id']);
|
||||
// Vacation mode by Shadow
|
||||
if($database->login($_POST['user'], $_POST['pw'])){
|
||||
$database->UpdateOnline("login", $_POST['user'], time(), $userData['id']);
|
||||
}else if($database->sitterLogin($_POST['user'], $_POST['pw'])){
|
||||
$database->UpdateOnline("sitter", $_POST['user'], time(), $userData['id']);
|
||||
}
|
||||
setcookie("COOKUSR", $_POST['user'], time() + COOKIE_EXPIRE, COOKIE_PATH);
|
||||
$session->login($_POST['user']);
|
||||
}
|
||||
}
|
||||
|
||||
private function Logout() {
|
||||
global $session,$database;
|
||||
global $session, $database;
|
||||
|
||||
unset($_SESSION['wid']);
|
||||
$database->activeModify(addslashes($session->username),1);
|
||||
$database->UpdateOnline("logout") or die(mysqli_error($database->dblink));
|
||||
@@ -264,34 +261,18 @@ class Account {
|
||||
|
||||
private function validEmail($email) {
|
||||
$regexp="/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i";
|
||||
if ( !preg_match($regexp, $email) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
return preg_match($regexp, $email);
|
||||
}
|
||||
|
||||
function generateBase($kid,$uid,$username) {
|
||||
global $database,$message;
|
||||
if($kid == 0) {
|
||||
$kid = rand(1,4);
|
||||
}
|
||||
else{
|
||||
$kid = $_POST['kid'];
|
||||
}
|
||||
|
||||
$wid = $database->generateBase($kid,0);
|
||||
$database->setFieldTaken($wid);
|
||||
$database->addVillage($wid,$uid,$username,1);
|
||||
$database->addResourceFields($wid,$database->getVillageType($wid));
|
||||
$database->addUnits($wid);
|
||||
$database->addTech($wid);
|
||||
$database->addABTech($wid);
|
||||
$database->updateUserField($uid,"access",USER,1);
|
||||
|
||||
$message = new Message();
|
||||
$message->sendWelcome($uid,$username);
|
||||
function generateBase($kid, $uid, $username) {
|
||||
global $database, $message;
|
||||
|
||||
if($kid == 0) $kid = rand(1,4);
|
||||
else $kid = $_POST['kid'];
|
||||
|
||||
$database->generateVillages([['wid' => 0, 'kid' => $kid, 'capital' => 1]], $uid, $username);
|
||||
$message->sendWelcome($uid, $username);
|
||||
}
|
||||
|
||||
};
|
||||
$account = new Account;
|
||||
?>
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#################################################################################
|
||||
include_once("../../config.php");
|
||||
include_once("../../Session.php");
|
||||
include_once("../../Automation.php");
|
||||
|
||||
// go max 5 levels up - we don't have folders that go deeper than that
|
||||
$autoprefix = '';
|
||||
@@ -41,8 +40,6 @@ for($i=1;$i<=$amt;$i++) {
|
||||
mysqli_query($GLOBALS["link"], $q) or die(mysqli_error($database->dblink));
|
||||
$q = "insert into ".TB_PREFIX."fdata (`vref`,`f1`,`f1t`,`f2`,`f2t`,`f3`,`f3t`,`f4`,`f4t`,`f5`,`f5t`,`f6`,`f6t`,`f7`,`f7t`,`f8`,`f8t`,`f9`,`f9t`,`f10`,`f10t`,`f11`,`f11t`,`f12`,`f12t`,`f13`,`f13t`,`f14`,`f14t`,`f15`,`f15t`,`f16`,`f16t`,`f17`,`f17t`,`f18`,`f18t`,`f19`,`f19t`,`f20`,`f20t`,`f21`,`f21t`,`f22`,`f22t`,`f23`,`f23t`,`f24`,`f24t`,`f25`,`f25t`,`f26`,`f26t`,`f27`,`f27t`,`f28`,`f28t`,`f29`,`f29t`,`f30`,`f30t`,`f31`,`f31t`,`f32`,`f32t`,`f33`,`f33t`,`f34`,`f34t`,`f35`,`f35t`,`f36`,`f36t`,`f37`,`f37t`,`f38`,`f38t`,`f39`,`f39t`,`f40`,`f40t`,`f99`,`f99t`,`wwname`) values ($wid,0,1,0,4,0,1,0,3,0,2,0,2,0,3,0,4,0,4,0,3,0,3,0,4,0,4,0,1,0,4,0,2,0,1,0,2,20,17,20,11,20,15,20,10,10,22,10,25,0,0,0,0,10,19,0,0,0,0,0,0,10,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,0,0,0,40,'World Wonder')";
|
||||
mysqli_query($GLOBALS["link"], $q);
|
||||
$pop = $automation->recountPop($wid);
|
||||
$cp = $automation->recountPop($wid);
|
||||
$addTechWrefs[] = $wid;
|
||||
$addABTechWrefs[] = $wid;
|
||||
$speed = NATARS_UNITS;
|
||||
|
||||
+185
-34
@@ -28,10 +28,6 @@ class Automation {
|
||||
private $bountyOinfoarray = [];
|
||||
private $bountyOproduction = [];
|
||||
private $bountyOpop = 1;
|
||||
const bountyOWoodProd = 40 * SPEED;
|
||||
const bountyOClayProd = 40 * SPEED;
|
||||
const bountyOIronProd = 40 * SPEED;
|
||||
const bountyOCropProd = 40 * SPEED;
|
||||
|
||||
public function __construct() {
|
||||
$this->procNewClimbers();
|
||||
@@ -91,6 +87,15 @@ class Automation {
|
||||
if(!file_exists("GameEngine/Prevention/settlers.txt") or time() - filemtime("GameEngine/Prevention/settlers.txt") > 50) {
|
||||
$this->sendSettlersComplete();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/spawnNatars.txt") or time() - filemtime("GameEngine/Prevention/spawnNatars.txt") > 120) {
|
||||
$this->spawnNatars();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/spawnWWVillages.txt") or time() - filemtime("GameEngine/Prevention/spawnWWVillages.txt") > 120) {
|
||||
$this->spawnWWVillages();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/spawnWWBuildingPlans.txt") or time() - filemtime("GameEngine/Prevention/spawnWWBuildingPlans.txt") > 120) {
|
||||
$this->spawnWWBuildingPlans();
|
||||
}
|
||||
if(!file_exists("GameEngine/Prevention/artifacts.txt") or time() - filemtime("GameEngine/Prevention/artifacts.txt") > 60) {
|
||||
$this->activateArtifacts();
|
||||
}
|
||||
@@ -247,7 +252,7 @@ class Automation {
|
||||
}
|
||||
|
||||
public function getTypeLevel($tid, $vid) {
|
||||
global $village, $database;
|
||||
global $database;
|
||||
|
||||
$keyholder = [];
|
||||
|
||||
@@ -287,15 +292,21 @@ class Automation {
|
||||
}
|
||||
|
||||
private function clearDeleting() {
|
||||
global $autoprefix, $units;
|
||||
global $autoprefix, $units, $database;
|
||||
|
||||
if(file_exists($autoprefix."GameEngine/Prevention/cleardeleting.txt")) {
|
||||
unlink($autoprefix."GameEngine/Prevention/cleardeleting.txt");
|
||||
}
|
||||
global $database;
|
||||
|
||||
$ourFileHandle = fopen($autoprefix."GameEngine/Prevention/cleardeleting.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
|
||||
$needDelete = $database->getNeedDelete();
|
||||
if(count($needDelete) > 0) {
|
||||
|
||||
//Remove the time limit, otherwise deleting players with 80 or more villages couldn't be deleted in one run
|
||||
@set_time_limit(0);
|
||||
|
||||
foreach($needDelete as $need) {
|
||||
$needVillage = $database->getVillagesID($need['uid']);
|
||||
|
||||
@@ -932,7 +943,7 @@ class Automation {
|
||||
}
|
||||
|
||||
private function sendunitsComplete() {
|
||||
global $bid19, $bid23, $bid34, $u99, $database, $battle, $village, $technology, $logging, $generator, $session, $units, $autoprefix;
|
||||
global $bid19, $bid23, $bid34, $u99, $database, $battle, $technology, $logging, $generator, $units, $autoprefix;
|
||||
|
||||
if(file_exists($autoprefix."GameEngine/Prevention/sendunits.txt")) {
|
||||
unlink($autoprefix."GameEngine/Prevention/sendunits.txt");
|
||||
@@ -2748,7 +2759,7 @@ class Automation {
|
||||
}
|
||||
|
||||
private function sendreinfunitsComplete() {
|
||||
global $bid23,$database,$battle,$session,$autoprefix;
|
||||
global $bid23, $database, $battle, $autoprefix;
|
||||
|
||||
if(file_exists($autoprefix."GameEngine/Prevention/sendreinfunits.txt")) {
|
||||
unlink($autoprefix."GameEngine/Prevention/sendreinfunits.txt");
|
||||
@@ -3004,7 +3015,7 @@ class Automation {
|
||||
}
|
||||
|
||||
private function sendSettlersComplete() {
|
||||
global $database, $building, $session, $autoprefix;
|
||||
global $database, $building, $autoprefix;
|
||||
|
||||
if(file_exists($autoprefix."GameEngine/Prevention/settlers.txt")) {
|
||||
unlink($autoprefix."GameEngine/Prevention/settlers.txt");
|
||||
@@ -3093,6 +3104,160 @@ class Automation {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create the Natars account and spawn artifacts
|
||||
*
|
||||
*/
|
||||
|
||||
private function spawnNatars(){
|
||||
global $database, $autoprefix;
|
||||
|
||||
if(file_exists($autoprefix."GameEngine/Prevention/spawnNatars.txt")) {
|
||||
unlink($autoprefix."GameEngine/Prevention/spawnNatars.txt");
|
||||
}
|
||||
|
||||
//Check if Natars account is already created and if the time
|
||||
//is come and we have to create Natars and spawn their artifacts
|
||||
if($database->areArtifactsSpawned() || COMMENCE + (NATARS_SPAWN_TIME * 86400) > time()) return;
|
||||
|
||||
$ourFileHandle = fopen($autoprefix."GameEngine/Prevention/spawnNatars.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
|
||||
//Create the Natars account and his capital
|
||||
$database->createNatars();
|
||||
|
||||
//Artifacts constants
|
||||
$artifactArrays = [ARCHITECTS_DESC => [["type" => 1, "size" => 1, "name" => ARCHITECTS_SMALL, "vname" => ARCHITECTS_SMALLVILLAGE, "effect" => "(4x)", "quantity" => 6, "img" => 2],
|
||||
["type" => 1, "size" => 2, "name" => ARCHITECTS_LARGE, "vname" => ARCHITECTS_LARGEVILLAGE, "effect" => "(3x)", "quantity" => 4, "img" => 2],
|
||||
["type" => 1, "size" => 3, "name" => ARCHITECTS_UNIQUE,"vname" => ARCHITECTS_UNIQUEVILLAGE, "effect" => "(5x)", "quantity" => 1, "img" => 2]],
|
||||
|
||||
HASTE_DESC => [["type" => 2, "size" => 1, "name" => HASTE_SMALL, "vname" => HASTE_SMALLVILLAGE, "effect" => "(2x)", "quantity" => 6, "img" => 4],
|
||||
["type" => 2, "size" => 2, "name" => HASTE_LARGE, "vname" => HASTE_LARGEVILLAGE, "effect" => "(1.5x)", "quantity" => 4, "img" => 4],
|
||||
["type" => 2, "size" => 3, "name" => HASTE_UNIQUE, "vname" => HASTE_UNIQUEVILLAGE, "effect" => "(3x)", "quantity" => 1, "img" => 4]],
|
||||
|
||||
EYESIGHT_DESC => [["type" => 3, "size" => 1, "name" => EYESIGHT_SMALL, "vname" => EYESIGHT_SMALLVILLAGE, "effect" => "(5x)", "quantity" => 6, "img" => 5],
|
||||
["type" => 3, "size" => 2, "name" => EYESIGHT_LARGE, "vname" => EYESIGHT_LARGEVILLAGE, "effect" => "(3x)", "quantity" => 4, "img" => 5],
|
||||
["type" => 3, "size" => 3, "name" => EYESIGHT_UNIQUE, "vname" => EYESIGHT_UNIQUEVILLAGE, "effect" => "(10x)", "quantity" => 1, "img" => 5]],
|
||||
|
||||
DIET_DESC => [["type" => 4, "size" => 1, "name" => DIET_SMALL, "vname" => DIET_SMALLVILLAGE, "effect" => "(50%)", "quantity" => 6, "img" => 6],
|
||||
["type" => 4, "size" => 2, "name" => DIET_LARGE, "vname" => DIET_LARGEVILLAGE, "effect" => "(25%)", "quantity" => 4, "img" => 6],
|
||||
["type" => 4, "size" => 3, "name" => DIET_UNIQUE, "vname" => DIET_UNIQUEVILLAGE, "effect" => "(50%)", "quantity" => 1, "img" => 6]],
|
||||
|
||||
ACADEMIC_DESC => [["type" => 5, "size" => 1, "name" => ACADEMIC_SMALL, "vname" => ACADEMIC_SMALLVILLAGE, "effect" => "(50%)", "quantity" => 6, "img" => 8],
|
||||
["type" => 5, "size" => 2, "name" => ACADEMIC_LARGE, "vname" => ACADEMIC_LARGEVILLAGE, "effect" => "(25%)", "quantity" => 4, "img" => 8],
|
||||
["type" => 5, "size" => 3, "name" => ACADEMIC_UNIQUE, "vname" => ACADEMIC_UNIQUEVILLAGE, "effect" => "(50%)", "quantity" => 1, "img" => 8]],
|
||||
|
||||
STORAGE_DESC => [["type" => 6, "size" => 1, "name" => STORAGE_SMALL, "vname" => STORAGE_SMALLVILLAGE, "effect" => "(50%)", "quantity" => 6, "img" => 9],
|
||||
["type" => 6, "size" => 2, "name" => STORAGE_LARGE, "vname" => STORAGE_LARGEVILLAGE, "effect" => "(25%)", "quantity" => 4, "img" => 9]],
|
||||
|
||||
CONFUSION_DESC => [["type" => 7, "size" => 1, "name" => CONFUSION_SMALL, "vname" => CONFUSION_SMALLVILLAGE, "effect" => "(200)", "quantity" => 6, "img" => 10],
|
||||
["type" => 7, "size" => 2, "name" => CONFUSION_LARGE, "vname" => CONFUSION_LARGEVILLAGE, "effect" => "(100)", "quantity" => 4, "img" => 10],
|
||||
["type" => 7, "size" => 3, "name" => CONFUSION_UNIQUE, "vname" => CONFUSION_UNIQUEVILLAGE, "effect" => "(500)", "quantity" => 1, "img" => 10]],
|
||||
|
||||
FOOL_DESC => [["type" => 8, "size" => 1, "name" => FOOL_SMALL, "vname" => FOOL_SMALLVILLAGE, "effect" => "", "quantity" => 5, "img" => "fool"],
|
||||
["type" => 8, "size" => 3, "name" => FOOL_UNIQUE, "vname" => FOOL_UNIQUEVILLAGE, "effect" => "", "quantity" => 1, "img" => "fool"]]];
|
||||
|
||||
//Add artifacts and their villages
|
||||
$database->addArtifactVillages($artifactArrays);
|
||||
|
||||
//Write the system message
|
||||
$database->displaySystemMessage(ARTEFACT);
|
||||
|
||||
if(file_exists("GameEngine/Prevention/spawnNatars.txt")) {
|
||||
unlink("GameEngine/Prevention/spawnNatars.txt");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawn WW Villages
|
||||
*
|
||||
*/
|
||||
|
||||
private function spawnWWVillages(){
|
||||
global $database, $autoprefix;
|
||||
|
||||
if(file_exists($autoprefix."GameEngine/Prevention/spawnWWVillages.txt")) {
|
||||
unlink($autoprefix."GameEngine/Prevention/spawnWWVillages.txt");
|
||||
}
|
||||
|
||||
//Check if Natars account has already been created, if WW villages have already been spawned
|
||||
//and if it's the time to spawn them or not
|
||||
if(!$database->areArtifactsSpawned() || $database->areWWVillagesSpawned() || COMMENCE + (NATARS_WW_SPAWN_TIME * 86400) > time()) return;
|
||||
|
||||
$ourFileHandle = fopen($autoprefix."GameEngine/Prevention/spawnWWVillages.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
|
||||
//WW village Natars' troops
|
||||
$unitArrays = [41 => rand(50, 1200) * NATARS_UNITS,
|
||||
42 => rand(100 , 1400) * NATARS_UNITS,
|
||||
43 => rand(200, 1600) * NATARS_UNITS,
|
||||
44 => rand(10, 50) * NATARS_UNITS,
|
||||
45 => rand(48, 1700) * NATARS_UNITS,
|
||||
46 => rand(60, 1800) * NATARS_UNITS,
|
||||
47 => rand(200, 1600) * NATARS_UNITS,
|
||||
48 => rand(40, 200) * NATARS_UNITS,
|
||||
49 => rand(4, 20) * NATARS_UNITS,
|
||||
50 => rand(5, 25) * NATARS_UNITS];
|
||||
|
||||
//WW village buildings
|
||||
$buildingArrays = ["f99t" => 40, "f99" => 0, "f39t" => 16, "f39" => 1, "f19t" => 17, "f19" => 20, "f20t" => 11,
|
||||
"f20" => 20, "f21t" => 15, "f21" => 20, "f22t" => 10, "f22" => 20, "f23t" => 22, "f23" => 10,
|
||||
"f24t" => 25, "f24" => 10, "f26t" => 0, "f26" => 0, "f27t" => 19, "f27" => 10, "f31t" => 23, "f31" => 10];
|
||||
|
||||
$villageArrays = $wids = [];
|
||||
for($i = 1; $i <= 13; $i++) $villageArrays[] = ['wid' => 0, 'kid' => ($i == 13 ? rand(1, 4) : ($i % 4) + 1), 'capital' => 0];
|
||||
|
||||
$wids = $database->generateVillages($villageArrays, 3, "Natars");
|
||||
|
||||
foreach($wids as $wid){
|
||||
$database->modifyUnit($wid, array_keys($unitArrays), array_values($unitArrays), [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
$database->setVillageLevel($wid, array_keys($buildingArrays), array_values($buildingArrays));
|
||||
$database->setVillageFields($wid, ['natar', 'name'], [1, WWVILLAGE]);
|
||||
$this->recountPop($wid);
|
||||
}
|
||||
|
||||
if(file_exists("GameEngine/Prevention/spawnWWVillages.txt")) {
|
||||
unlink("GameEngine/Prevention/spawnWWVillages.txt");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Spawn WW Building plans
|
||||
*
|
||||
*/
|
||||
|
||||
private function spawnWWBuildingPlans(){
|
||||
global $database, $autoprefix;
|
||||
|
||||
if(file_exists($autoprefix."GameEngine/Prevention/spawnWWBuildingPlans.txt")) {
|
||||
unlink($autoprefix."GameEngine/Prevention/spawnWWBuildingPlans.txt");
|
||||
}
|
||||
|
||||
//Check if Natars account is already spawned, if WW building plans have already been spawned
|
||||
//and if it's the time to spawn them or not
|
||||
if(!$database->areArtifactsSpawned() || $database->areArtifactsSpawned(true) || COMMENCE + (NATARS_WW_BUILDING_PLAN_SPAWN_TIME * 86400) > time()) return;
|
||||
|
||||
$ourFileHandle = fopen($autoprefix."GameEngine/Prevention/spawnWWBuildingPlans.txt", 'w');
|
||||
fclose($ourFileHandle);
|
||||
|
||||
$artifactArrays = [PLAN_DESC => [["type" => 11, "size" => 1, "name" => PLAN,"vname" => PLANVILLAGE, "effect" => "", "quantity" => 13, "img" => 1]]];
|
||||
|
||||
//Add the artifacts and villages
|
||||
$database->addArtifactVillages($artifactArrays);
|
||||
|
||||
//Set the system message to contain the infos of the WW building plans
|
||||
$database->displaySystemMessage(PLAN_INFO);
|
||||
|
||||
if(file_exists("GameEngine/Prevention/spawnWWBuildingPlans.txt")) {
|
||||
unlink("GameEngine/Prevention/spawnWWBuildingPlans.txt");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Automatically activate all artifacts that need to be activated
|
||||
*
|
||||
*/
|
||||
|
||||
private function activateArtifacts() {
|
||||
global $database, $autoprefix;
|
||||
|
||||
@@ -3352,10 +3517,10 @@ class Automation {
|
||||
}
|
||||
|
||||
private function bountycalculateOProduction($bountywid) {
|
||||
$this->bountyOproduction['wood'] = self::bountyOWoodProd;
|
||||
$this->bountyOproduction['clay'] = self::bountyOClayProd;
|
||||
$this->bountyOproduction['iron'] = self::bountyOIronProd;
|
||||
$this->bountyOproduction['crop'] = self::bountyOCropProd;
|
||||
$this->bountyOproduction['wood'] = OASIS_WOOD_PRODUCTION;
|
||||
$this->bountyOproduction['clay'] = OASIS_CLAY_PRODUCTION;
|
||||
$this->bountyOproduction['iron'] = OASIS_IRON_PRODUCTION;
|
||||
$this->bountyOproduction['crop'] = OASIS_CROP_PRODUCTION;
|
||||
}
|
||||
|
||||
private function bountycalculateProduction($bountywid, $uid) {
|
||||
@@ -3596,7 +3761,7 @@ class Automation {
|
||||
}
|
||||
|
||||
private function demolitionComplete() {
|
||||
global $building,$database,$village,$autoprefix;
|
||||
global $building, $database, $autoprefix;
|
||||
|
||||
if(file_exists($autoprefix."GameEngine/Prevention/demolition.txt")) {
|
||||
unlink($autoprefix."GameEngine/Prevention/demolition.txt");
|
||||
@@ -3636,7 +3801,7 @@ class Automation {
|
||||
if ($level == 1) $clear = ",f".$vil['buildnumber']."t=0";
|
||||
else $clear = "";
|
||||
|
||||
if ($village->natar == 1 && $type == 40) $clear = ""; //fix by ronix
|
||||
if ($database->getVillageField($vil['vref'], 'natar') == 1 && $type == 40) $clear = ""; //fix by ronix - fixed by iopietro
|
||||
|
||||
$q = "UPDATE ".TB_PREFIX."fdata SET f".$vil['buildnumber']."=".(($level - 1 >= 0) ? $level - 1 : 0).$clear." WHERE vref=".(int) $vil['vref'];
|
||||
$database->query($q);
|
||||
@@ -3656,10 +3821,12 @@ class Automation {
|
||||
}
|
||||
|
||||
private function updateHero() {
|
||||
global $database, $hero_levels;
|
||||
|
||||
if(file_exists("GameEngine/Prevention/updatehero.txt")) {
|
||||
unlink("GameEngine/Prevention/updatehero.txt");
|
||||
unlink("GameEngine/Prevention/updatehero.txt");
|
||||
}
|
||||
global $database,$hero_levels;
|
||||
|
||||
$harray = $database->getHero();
|
||||
if(!empty($harray)){
|
||||
// first of all, prepare all unit data at once for these heroes
|
||||
@@ -4394,22 +4561,6 @@ class Automation {
|
||||
}
|
||||
}
|
||||
|
||||
private function checkReviveHero(){
|
||||
global $database, $session;
|
||||
$herodata = $database->getHero($session->uid, 1);
|
||||
if ($herodata[0]['dead'] == 1){
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET hero = 0 WHERE vref = ".(int) $session->villages[0]."");
|
||||
}
|
||||
if($herodata[0]['trainingtime'] <= time()) {
|
||||
if($herodata[0]['trainingtime'] != 0) {
|
||||
if($herodata[0]['dead'] == 0) {
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "hero SET trainingtime = '0' WHERE heroid = " . $herodata[0]['heroid']);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET hero = 1 WHERE vref = ".(int) $session->villages[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Function for automate medals - by yi12345 and Shadow
|
||||
*
|
||||
|
||||
+283
-47
@@ -1274,34 +1274,31 @@ class MYSQLi_DB implements IDbConnection {
|
||||
$count_while = 0;
|
||||
|
||||
// random position on the map - used when generating farms via Admin
|
||||
if (!$respect_gametime) {
|
||||
$rand = rand(1,4);
|
||||
}
|
||||
if (!$respect_gametime) $rand = rand(1,4);
|
||||
|
||||
while (!$num_rows) {
|
||||
if (!$mode) {
|
||||
$gamesday = time() - COMMENCE;
|
||||
// TODO: scale these with game speed?
|
||||
if ((!$respect_gametime && $rand === 1) || ($respect_gametime && $gamesday<3600*24*10 && $count_while==0)) { //10 day
|
||||
$wide1=1;
|
||||
$wide2=20;
|
||||
} elseif ((!$respect_gametime && $rand === 2) || ($respect_gametime && $gamesday<3600*24*20 && $count_while==1)) { //20 day
|
||||
$wide1=20;
|
||||
$wide2=40;
|
||||
} elseif ((!$respect_gametime && $rand === 3) || ($respect_gametime && $gamesday<3600*24*30 && $count_while==2)) { //30 day
|
||||
$wide1=40;
|
||||
$wide2=80;
|
||||
} else { // over 30 day
|
||||
$wide1=80;
|
||||
$wide2=WORLD_MAX;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$wide1=1;
|
||||
$wide2=WORLD_MAX;
|
||||
// TODO: scale these with game speed?
|
||||
if((!$respect_gametime && $rand === 1) || ($respect_gametime && $gamesday < 3600 * 24 * 10 && $count_while == 0)){ // 10 day
|
||||
$wide1 = 1;
|
||||
$wide2 = 20;
|
||||
}elseif((!$respect_gametime && $rand === 2) || ($respect_gametime && $gamesday < 3600 * 24 * 20 && $count_while == 1)){ // 20 day
|
||||
$wide1 = 20;
|
||||
$wide2 = 40;
|
||||
}elseif((!$respect_gametime && $rand === 3) || ($respect_gametime && $gamesday < 3600 * 24 * 30 && $count_while == 2)){ // 30 day
|
||||
$wide1 = 40;
|
||||
$wide2 = 80;
|
||||
}else{ // over 30 day
|
||||
$wide1 = 80;
|
||||
$wide2 = WORLD_MAX;
|
||||
}
|
||||
}else {
|
||||
$wide1 = 1;
|
||||
$wide2 = WORLD_MAX;
|
||||
}
|
||||
|
||||
switch($sector) {
|
||||
switch($sector){
|
||||
case 1:
|
||||
$q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x < -$wide1 and x > -$wide2) and (y > $wide1 and y < $wide2) and occupied = 0"; //x- y+
|
||||
break;
|
||||
@@ -1314,13 +1311,14 @@ class MYSQLi_DB implements IDbConnection {
|
||||
default:
|
||||
$q = "Select * from ".TB_PREFIX."wdata where fieldtype = 3 and (x > $wide1 and x < $wide2) and (y < -$wide1 and y > -$wide2) and occupied = 0"; //x+ y-
|
||||
}
|
||||
|
||||
$result = mysqli_query($this->dblink,$q);
|
||||
$num_rows = mysqli_num_rows($result);
|
||||
$count_while++;
|
||||
}
|
||||
|
||||
$result = $this->mysqli_fetch_all($result);
|
||||
$base = rand(0, ($num_rows-1));
|
||||
$base = rand(0, ($num_rows - 1));
|
||||
|
||||
return $result[$base]['id'];
|
||||
}
|
||||
@@ -1338,15 +1336,41 @@ class MYSQLi_DB implements IDbConnection {
|
||||
return mysqli_query($this->dblink,$q);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates new villages
|
||||
*
|
||||
* @param array $villageArrays The array of the villages which have to be created
|
||||
* @param int $uid The user ID
|
||||
* @param string $username The username of the future owner
|
||||
* @return array Returns the created villages ID
|
||||
*/
|
||||
|
||||
function generateVillages($villageArrays, $uid, $username){
|
||||
list($villageArrays, $uid, $username) = $this->escape_input($villageArrays, (int) $uid, $username);
|
||||
|
||||
$wids = [];
|
||||
foreach($villageArrays as $village){
|
||||
if($village['wid'] == 0) $village['wid'] = $this->generateBase($village['kid'], 0);
|
||||
$this->addVillage($village['wid'], $uid, $username, $village['capital']);
|
||||
$this->addResourceFields($village['wid'], $this->getVillageType($village['wid']));
|
||||
$wids[] = $village['wid'];
|
||||
}
|
||||
|
||||
$this->setFieldTaken($wids);
|
||||
$this->addUnits($wids);
|
||||
$this->addTech($wids);
|
||||
$this->addABTech($wids);
|
||||
|
||||
return count($wids) > 1 ? $wids : $wids[0];
|
||||
}
|
||||
|
||||
function addVillage($wid, $uid, $username, $capital) {
|
||||
list($wid, $uid, $username, $capital) = $this->escape_input((int) $wid, (int) $uid, $username, (int) $capital);
|
||||
|
||||
$total = count($this->getVillagesID($uid));
|
||||
if($total >= 1) {
|
||||
$vname = $username . "\'s village " . ($total + 1);
|
||||
} else {
|
||||
$vname = $username . "\'s village";
|
||||
}
|
||||
$total = count($this->getVillagesID($uid));
|
||||
if($total >= 1) $vname = $username . "\'s village " . ($total + 1);
|
||||
else $vname = $username . "\'s village";
|
||||
|
||||
$time = time();
|
||||
$q = "INSERT into " . TB_PREFIX . "vdata (wref, owner, name, capital, pop, cp, celebration, wood, clay, iron, maxstore, crop, maxcrop, lastupdate, created) values ($wid, $uid, '$vname', $capital, 2, 1, 0, 750, 750, 750, ".STORAGE_BASE.", 750, ".STORAGE_BASE.", $time, $time)";
|
||||
return mysqli_query($this->dblink,$q);
|
||||
@@ -1771,7 +1795,7 @@ class MYSQLi_DB implements IDbConnection {
|
||||
case 0: $q = "SELECT * FROM " . TB_PREFIX . "vdata WHERE owner IN(".implode(', ', $uid).") ORDER BY capital DESC,pop DESC";
|
||||
break;
|
||||
|
||||
// villages where owner is a real player (i.e. not Natars etc.)
|
||||
// capital villages where owner is a real player (i.e. not Natars etc.)
|
||||
case 1: $q = "SELECT * FROM " . TB_PREFIX . "vdata WHERE capital = 1 and owner > 5";
|
||||
break;
|
||||
|
||||
@@ -5688,7 +5712,7 @@ References: User ID/Message ID, Mode
|
||||
$vid[$index] = (int) $vidValue;
|
||||
}
|
||||
|
||||
$q = "INSERT into " . TB_PREFIX . "units (vref) values (".implode(', ', $vid).")";
|
||||
$q = "INSERT into " . TB_PREFIX . "units (vref) values (".implode('),(', $vid).")";
|
||||
return mysqli_query($this->dblink,$q);
|
||||
}
|
||||
|
||||
@@ -5873,7 +5897,7 @@ References: User ID/Message ID, Mode
|
||||
$vid[$index] = (int) $vidValue;
|
||||
}
|
||||
|
||||
$q = "INSERT INTO " . TB_PREFIX . "tdata (vref) VALUES (".implode(', ', $vid).")";
|
||||
$q = "INSERT INTO " . TB_PREFIX . "tdata (vref) VALUES (".implode('),(', $vid).")";
|
||||
return mysqli_query($this->dblink,$q);
|
||||
}
|
||||
|
||||
@@ -5887,7 +5911,7 @@ References: User ID/Message ID, Mode
|
||||
}
|
||||
|
||||
self::$abTechCache = [];
|
||||
$q = "INSERT INTO " . TB_PREFIX . "abdata (vref) VALUES (".implode(', ', $vid).")";
|
||||
$q = "INSERT INTO " . TB_PREFIX . "abdata (vref) VALUES (".implode('),(', $vid).")";
|
||||
return mysqli_query($this->dblink,$q);
|
||||
}
|
||||
|
||||
@@ -6081,12 +6105,12 @@ References: User ID/Message ID, Mode
|
||||
$units='';
|
||||
$number = count($array_unit);
|
||||
foreach($array_unit as $unit){
|
||||
if($unit == 230){$unit = 30;}
|
||||
if($unit == 231){$unit = 31;}
|
||||
if($unit == 120){$unit = 20;}
|
||||
if($unit == 121){$unit = 21;}
|
||||
if($unit =="hero"){$unit = 'hero';}
|
||||
else{$unit = 'u' . $unit;}
|
||||
if($unit == 230) $unit = 30;
|
||||
if($unit == 231) $unit = 31;
|
||||
if($unit == 120) $unit = 20;
|
||||
if($unit == 121) $unit = 21;
|
||||
if($unit =="hero") $unit = 'hero';
|
||||
else $unit = 'u' . $unit;
|
||||
|
||||
++$i;
|
||||
//Fixed part of negative troops (double troops) - by InCube
|
||||
@@ -6953,11 +6977,208 @@ References: User ID/Message ID, Mode
|
||||
return $this->mysqli_fetch_all($result)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates villages and puts the desired artifacts in it
|
||||
*
|
||||
* @param array $artifactArrays The array containing the artifacts to insert
|
||||
* @param int $uid The owner's user ID (Natars)
|
||||
*/
|
||||
|
||||
function addArtifactVillages($artifactArrays, $uid = 3) {
|
||||
list($artifactArrays, $uid) = $this->escape_input($artifactArrays, (int) $uid);
|
||||
|
||||
foreach($artifactArrays as $desc => $artifactType){
|
||||
foreach($artifactType as $artifact){
|
||||
for($i = 0; $i < $artifact['quantity']; $i++){
|
||||
$kid = rand(1, 4);
|
||||
$wid = $this->generateBase($kid, 1);
|
||||
$this->addArtefact($wid, $uid, $artifact['type'], $artifact['size'], $artifact['name'], $desc, $artifact['effect'], "type".$artifact['img'].".gif");
|
||||
$this->setFieldTaken($wid);
|
||||
$this->addVillage($wid, $uid, $artifact['vname'], 0);
|
||||
$this->addResourceFields($wid, $this->getVillageType($wid));
|
||||
$this->addUnits($wid);
|
||||
$this->addTech($wid);
|
||||
$this->addABTech($wid);
|
||||
|
||||
//Set the population to 163 and the name of the village
|
||||
$this->setVillageFields($wid, ['pop', 'name'], [163, $artifact['vname']]);
|
||||
|
||||
//Set the unit arrays (1, 2 or 4)
|
||||
$multiplier = $artifact['size'] == 3 ? 4 : $artifact['size'];
|
||||
$unitArrays = [41 => rand(1000 * $multiplier, 2000 * $multiplier) * NATARS_UNITS,
|
||||
42 => rand(1500 * $multiplier, 2000 * $multiplier) * NATARS_UNITS,
|
||||
43 => rand(2300 * $multiplier, 2800 * $multiplier) * NATARS_UNITS,
|
||||
44 => rand(25 * $multiplier, 75 * $multiplier) * NATARS_UNITS,
|
||||
45 => rand(1200 * $multiplier, 1900 * $multiplier) * NATARS_UNITS,
|
||||
46 => rand(1500 * $multiplier, 2000 * $multiplier) * NATARS_UNITS,
|
||||
47 => rand(500 * $multiplier, 900 * $multiplier) * NATARS_UNITS,
|
||||
48 => rand(100 * $multiplier, 300 * $multiplier) * NATARS_UNITS,
|
||||
49 => rand(1 * $multiplier, 5 * $multiplier) * NATARS_UNITS,
|
||||
50 => rand(1 * $multiplier, 5 * $multiplier) * NATARS_UNITS];
|
||||
|
||||
//Set the buildings and their levels
|
||||
$buildingArrays = ["f22t" => 27, "f22" => ($artifact['size'] == 1 ? 10 : 20), "f28t" => 25, "f28" => 10, "f19t" => 23, "f19" => 10, "f32t" => 23, "f32" => 10];
|
||||
|
||||
$this->modifyUnit($wid, array_keys($unitArrays), array_values($unitArrays), [1, 1, 1, 1, 1, 1, 1, 1, 1, 1]);
|
||||
$this->setVillageLevel($wid, array_keys($buildingArrays), array_values($buildingArrays));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a system message to all players
|
||||
*
|
||||
* @param string $message The text of the system message that will be written and displayed to all players
|
||||
*/
|
||||
|
||||
function displaySystemMessage($message){
|
||||
list($message) = $this->escape_input($message);
|
||||
global $autoprefix;
|
||||
|
||||
$myFile = $autoprefix."Templates/text.tpl";
|
||||
$fh = fopen($myFile, 'w');
|
||||
$text = file_get_contents($autoprefix."Templates/text_format.tpl");
|
||||
$text = preg_replace("'%TEKST%'", $message, $text);
|
||||
fwrite($fh, $text);
|
||||
|
||||
//Set "OK" to 1 to all players, so they can visualize the message
|
||||
$this->setUsersOk();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when Natars account has been created
|
||||
*
|
||||
* @param int $wid The village ID of the Natars' capital
|
||||
*/
|
||||
|
||||
function scoutAllPlayers($wid){
|
||||
list($wid) = $this->escape_input((int) $wid);
|
||||
|
||||
$array = $this->getProfileVillages(0, 1);
|
||||
$refs = [];
|
||||
$vils = [];
|
||||
|
||||
foreach($array as $vill){
|
||||
$refs[] = $this->addAttack($wid, 0, 0, 0, 1500 * NATARS_UNITS, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 0);
|
||||
$vils[] = $vill['wref'];
|
||||
}
|
||||
|
||||
$type = [];
|
||||
$from = [];
|
||||
$to = [];
|
||||
$ref = [];
|
||||
$time = [];
|
||||
$timeValue = time();
|
||||
$endtime = [];
|
||||
$endtimeValue = $timeValue + round(10000 / SPEED);
|
||||
$counter = 0;
|
||||
|
||||
foreach ($refs as $index => $refID) {
|
||||
$type[] = 3;
|
||||
$from[] = $wid;
|
||||
$to[] = $vils[$index];
|
||||
$ref[] = $refID;
|
||||
$time[] = $timeValue;
|
||||
$endtime[] = $endtimeValue;
|
||||
|
||||
// limit the insert, so it can push through any reasonable network limits imposed
|
||||
if (++$counter > 25) {
|
||||
$this->addMovement($type, $from, $to, $ref, $time, $endtime);
|
||||
|
||||
$type = [];
|
||||
$from = [];
|
||||
$to = [];
|
||||
$ref = [];
|
||||
$time = [];
|
||||
$endtime = [];
|
||||
$counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($counter > 0) $this->addMovement($type, $from, $to, $ref, $time, $endtime);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when Natars account have to be created, creates his account and capital village
|
||||
*
|
||||
*/
|
||||
|
||||
function createNatars(){
|
||||
|
||||
//Create the Natars account
|
||||
$username = "Natars";
|
||||
$password = $this->getUserField(5, 'password', 0);
|
||||
$email = "natars@noreply.com";
|
||||
$uid = 3;
|
||||
$tribe = 5;
|
||||
$desc = "***************************
|
||||
[#natars]
|
||||
***************************";
|
||||
|
||||
$q = "INSERT INTO ".TB_PREFIX."users (id, username, password, access, email, timestamp, tribe, protect, desc2) VALUES ('$uid', '$username', '$password', ".USER.", '$email', ".time().", $tribe, 0, '$desc')";
|
||||
mysqli_query($this->dblink, $q);
|
||||
|
||||
//Coordinate arrays of possible villages
|
||||
$arrayXY = [[WORLD_MAX, WORLD_MAX],
|
||||
[WORLD_MAX, -WORLD_MAX],
|
||||
[-WORLD_MAX, -WORLD_MAX],
|
||||
[WORLD_MAX - 1, WORLD_MAX],
|
||||
[WORLD_MAX, WORLD_MAX - 1],
|
||||
[-WORLD_MAX, WORLD_MAX - 1],
|
||||
[WORLD_MAX - 1, -WORLD_MAX],
|
||||
[WORLD_MAX - 1, WORLD_MAX - 1],
|
||||
[WORLD_MAX, -WORLD_MAX + 1],
|
||||
[WORLD_MAX - 1, -WORLD_MAX + 1],
|
||||
[-WORLD_MAX + 1, -WORLD_MAX + 1],
|
||||
[WORLD_MAX - 2, WORLD_MAX],
|
||||
[WORLD_MAX - 2, -WORLD_MAX],
|
||||
[WORLD_MAX - 2, WORLD_MAX - 1],
|
||||
[WORLD_MAX - 1, WORLD_MAX - 2],
|
||||
[-WORLD_MAX + 2, WORLD_MAX],
|
||||
[-WORLD_MAX + 2, WORLD_MAX - 1],
|
||||
[-WORLD_MAX + 2, -WORLD_MAX + 2]];
|
||||
|
||||
//Search if there's one spot left
|
||||
for($i = 0; $i <= 17; $i++){
|
||||
$wid = $this->getVilWref($arrayXY[$i][0], $arrayXY[$i][1]);
|
||||
$status = $this->getVillageState($wid);
|
||||
if($status == 0){
|
||||
//The village isn't taken, let's occupy it
|
||||
$this->generateVillages([['wid' => $wid, 'kid' => 0, 'capital' => 1]], $uid, $username);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//All villages are taken, then select a random village
|
||||
if($status > 0) $wid = $this->generateVillages([['wid' => 0, 'kid' => 0, 'capital' => 1]], $uid, $username);
|
||||
|
||||
//Set the capital pop to 834
|
||||
$this->setVillageField($wid, 'pop', 834);
|
||||
|
||||
//Scouts all players
|
||||
$this->scoutAllPlayers($wid);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when a system message is sent or Natars/Artifacts have been spawned
|
||||
*
|
||||
* @param int $value 1 to make a system message visible to all users, 0 to hide it
|
||||
* @return bool Returns true if the query was successful, false otherwise
|
||||
*/
|
||||
|
||||
function setUsersOk($value = 1){
|
||||
list($value) = $this->escape_input((int) $value);
|
||||
|
||||
$q = "UPDATE " . TB_PREFIX . "users SET ok = $value";
|
||||
return mysqli_query($this->dblink, $q);
|
||||
}
|
||||
|
||||
function addArtefact($vref, $owner, $type, $size, $name, $desc, $effect, $img) {
|
||||
list($vref, $owner, $type, $size, $name, $desc, $effect, $img) = $this->escape_input($vref, $owner, $type, $size, $name, $desc, $effect, $img);
|
||||
|
||||
$q = "INSERT INTO `" . TB_PREFIX . "artefacts` (`vref`, `owner`, `type`, `size`, `conquered`, `name`, `desc`, `effect`, `img`, `active`) VALUES ('$vref', '$owner', '$type', '$size', '" . time() . "', '$name', '$desc', '$effect', '$img', '0')";
|
||||
return mysqli_query($this->dblink,$q);
|
||||
return mysqli_query($this->dblink, $q);
|
||||
}
|
||||
|
||||
// no need to cache this method
|
||||
@@ -7139,16 +7360,31 @@ References: User ID/Message ID, Mode
|
||||
$q = "INSERT INTO " . TB_PREFIX . "artefacts_chrono (artefactid, uid, vref, conqueredtime) VALUES ('$artifactID', '$uid', '$vref', '$conqueredTime')";
|
||||
return mysqli_query($this->dblink, $q);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @return bool Returns if artefacts are already out or not
|
||||
* @param bool $mode true: check if WW Building plans are already out, false: check if artifacts are already out
|
||||
* @return int Returns if artifacts are already out or not
|
||||
*/
|
||||
|
||||
function areArtifactsSpawned(){
|
||||
$q = "SELECT Count(*) as Total FROM ".TB_PREFIX."artefacts LIMIT 1";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink, $q), MYSQLI_ASSOC);
|
||||
return $result['Total'] > 0;
|
||||
function areArtifactsSpawned($mode = false){
|
||||
list($mode) = $this->escape_input($mode);
|
||||
|
||||
$q = "SELECT 1 FROM ".TB_PREFIX."artefacts".($mode ? " WHERE type = 11" : "");
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink, $q), MYSQLI_ASSOC);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check if WW villages are already out or not
|
||||
*
|
||||
* @return int Returns if artifacts are already out or not
|
||||
*/
|
||||
|
||||
function areWWVillagesSpawned(){
|
||||
$q = "SELECT 1 FROM ".TB_PREFIX."vdata WHERE natar = 1";
|
||||
$result = mysqli_fetch_array(mysqli_query($this->dblink, $q), MYSQLI_ASSOC);
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -707,6 +707,7 @@ define("WEST","West");
|
||||
//other
|
||||
define("VILLAGE","Village");
|
||||
define("OASIS","Oasis");
|
||||
define("NO_OASIS", "You do not own any oases.");
|
||||
define("PLAYER","Player");
|
||||
|
||||
//LOGIN.php
|
||||
@@ -987,7 +988,7 @@ define("PALACE_DESC","The king or queen of the empire lives in the palace. Only
|
||||
|
||||
define("TREASURY","Treasury");
|
||||
define("ARTIFACTS_AREA","Artefacts in your area");
|
||||
define("NO_ARTIFACTS_AREA","There is no artefacts in your area.");
|
||||
define("NO_ARTIFACTS_AREA","There are no artefacts in your area.");
|
||||
define("OWN_ARTIFACTS","Own artefacts");
|
||||
define("CONQUERED","Conquered");
|
||||
define("DISTANCE","Distance");
|
||||
@@ -995,13 +996,14 @@ define("EFFECT","Effect");
|
||||
define("ACCOUNT","Account");
|
||||
define("SMALL_ARTIFACTS","Small artefacts");
|
||||
define("LARGE_ARTIFACTS","Large artefacts");
|
||||
define("NO_ARTIFACTS","There is no artefacts.");
|
||||
define("NO_ARTIFACTS","There are no artefacts.");
|
||||
define("ANY_ARTIFACTS","You do not own any artefacts.");
|
||||
define("OWNER","Owner");
|
||||
define("AREA_EFFECT","Area of effect");
|
||||
define("REQUIRED_LEVEL","Required level");
|
||||
define("TIME_CONQUER","Time of conquer");
|
||||
define("TIME_ACTIVATION","Time of activation");
|
||||
define("NEXT_EFFECT"," Next effect");
|
||||
define("FORMER_OWNER","Former owner(s)");
|
||||
define("BUILDING_STRONGER","Building stronger with");
|
||||
define("BUILDING_WEAKER","Building weaker with");
|
||||
|
||||
+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));
|
||||
|
||||
@@ -80,20 +80,19 @@
|
||||
if($totalUps > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".UPGRADING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($ABups as $black) {
|
||||
$ABUnit = substr($black['tech'],1,2);
|
||||
$count++;
|
||||
$ABUnit = substr($black['tech'], 1, 2);
|
||||
$abdata['b'.$ABUnit]++;
|
||||
$unit = ($session->tribe-1)*10 + $ABUnit;
|
||||
$unit = ($session->tribe - 1) * 10 + $ABUnit;
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit);
|
||||
echo "<span class=\"none\"> (".LEVEL." ".$abdata['b'.$ABUnit].")</span>";
|
||||
if($timer > 1) echo "<span class=\"none\"> ".WAITING."</span>";
|
||||
if($count > 1) echo "<span class=\"none\"> ".WAITING."</span>";
|
||||
echo "</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($black['timestamp']-time())."</span></td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($black['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($black['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
|
||||
@@ -80,20 +80,19 @@
|
||||
if($totalUps > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".UPGRADING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($ABups as $arms) {
|
||||
$ABUnit = substr($arms['tech'],1,2);
|
||||
$abdata['a'.$ABUnit]++;
|
||||
$unit = ($session->tribe-1)*10 + $ABUnit;
|
||||
$count++;
|
||||
$ABUnit = substr($arms['tech'], 1, 2);
|
||||
$abdata['a' . $ABUnit]++;
|
||||
$unit = ($session->tribe - 1) * 10 + $ABUnit;
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit);
|
||||
echo "<span class=\"none\"> (".LEVEL." ".$abdata['a'.$ABUnit].")</span>";
|
||||
if($timer > 1) echo "<span class=\"none\"> ".WAITING."</span>";
|
||||
if($count > 1) echo "<span class=\"none\"> ".WAITING."</span>";
|
||||
echo "</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($arms['timestamp']-time())."</span></td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($arms['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($arms['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
|
||||
+270
-267
@@ -1,310 +1,313 @@
|
||||
<?php
|
||||
if (isset($_GET['refresh'])) {
|
||||
$village->unitarray = $database->getUnit($village->wid, false);
|
||||
}
|
||||
?><div id="build" class="gid16"><a href="#" onClick="return Popup(16,4);" class="build_logo">
|
||||
<img class="g16" src="img/x.gif" alt="Rally point" title="<?php echo RALLYPOINT;?>" />
|
||||
</a>
|
||||
<h1><?php echo RALLYPOINT;?> <span class="level"><?php echo LEVEL;?> <?php echo $village->resarray['f'.$id]; ?></span></h1>
|
||||
<p class="build_desc"><?php echo RALLYPOINT_DESC;?></p>
|
||||
if(isset($_GET['refresh'])){
|
||||
$village->unitarray = $database->getUnit($village->wid, false);
|
||||
}
|
||||
?><div id="build" class="gid16">
|
||||
<a href="#" onClick="return Popup(16,4);" class="build_logo"> <img
|
||||
class="g16" src="img/x.gif" alt="Rally point"
|
||||
title="<?php echo RALLYPOINT;?>" />
|
||||
</a>
|
||||
<h1><?php echo RALLYPOINT;?> <span class="level"><?php echo LEVEL;?> <?php echo $village->resarray['f'.$id]; ?></span>
|
||||
</h1>
|
||||
<p class="build_desc"><?php echo RALLYPOINT_DESC;?></p>
|
||||
|
||||
<?php
|
||||
include_once("16_menu.tpl");
|
||||
$units_type = $database->getMovement("34",$village->wid,1);
|
||||
$settlers = $database->getMovement("7",$village->wid,1);
|
||||
include_once ("16_menu.tpl");
|
||||
$units_type = $database->getMovement("34", $village->wid, 1);
|
||||
$settlers = $database->getMovement("7", $village->wid, 1);
|
||||
$oasis_incoming = 0;
|
||||
$array = $database->getOasis($village->wid);
|
||||
foreach($array as $conqured){
|
||||
$oasis_incoming += count($database->getMovement(6,$conqured['wref'],0));
|
||||
$oasis_incoming += count($database->getMovement(6, $conqured['wref'], 0));
|
||||
}
|
||||
$units_incoming = count($units_type);
|
||||
$settlers_incoming = count($settlers);
|
||||
for($i=0;$i<$units_incoming;$i++){
|
||||
if($units_type[$i]['attack_type'] == 1 && $units_type[$i]['sort_type'] == 3)
|
||||
$units_incoming -= 1;
|
||||
for($i = 0; $i < $units_incoming; $i++){
|
||||
if($units_type[$i]['attack_type'] == 1 && $units_type[$i]['sort_type'] == 3) $units_incoming -= 1;
|
||||
}
|
||||
if($units_incoming > 0 or $settlers_incoming > 0 or $oasis_incoming > 0){
|
||||
?>
|
||||
if($units_incoming > 0 || $settlers_incoming > 0 || $oasis_incoming > 0){
|
||||
?>
|
||||
<h4><?php echo INCOMING_TROOPS;?> (<?php echo $units_incoming+$settlers_incoming+$oasis_incoming; ?>)</h4>
|
||||
<?php include("16_incomming.tpl");
|
||||
}
|
||||
<?php
|
||||
|
||||
include ("16_incomming.tpl");
|
||||
}
|
||||
?>
|
||||
|
||||
<h4><?php echo TROOPS_IN_THE_VILLAGE;?></h4>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td><td colspan="<?php if($village->unitarray['hero'] == 0) {echo"10";}else{echo"11";}?>">
|
||||
<a href="spieler.php?uid=<?php echo $session->uid; ?>"><?php echo OWN_TROOPS;?></a></td></tr></thead>
|
||||
<tbody class="units">
|
||||
<?php include("16_troops.tpl");
|
||||
?>
|
||||
</tbody></table>
|
||||
<table class="troop_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="role"><a
|
||||
href="karte.php?d=<?php echo $village->wid."&c=".$generator->getMapCheck($village->wid); ?>"><?php echo $village->vname; ?></a></td>
|
||||
<td
|
||||
colspan="<?php echo $village->unitarray['hero'] == 0 ? 10 : 11; ?>">
|
||||
<a href="spieler.php?uid=<?php echo $session->uid; ?>"><?php echo OWN_TROOPS;?></a>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="units">
|
||||
<?php
|
||||
if(count($village->enforcetome) > 0) {
|
||||
foreach($village->enforcetome as $enforce) {
|
||||
$colspan = 10+$enforce['hero'];
|
||||
if($enforce['from']!=0){
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
if (LANG == "es") {
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".TROOPSFROM." ".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." </a>";
|
||||
}else{ echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." ".TROOPSFROM."</a>";
|
||||
|
||||
}
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0);
|
||||
$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($enforce['hero']!=0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i=$start;$i<=($start+9);$i++) {
|
||||
if($enforce['u'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
if($enforce['hero']!=0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?w=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}else{
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
include ("16_troops.tpl");
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<?php
|
||||
if(count($village->enforcetome) > 0){
|
||||
foreach($village->enforcetome as $enforce){
|
||||
$colspan = 10 + $enforce['hero'];
|
||||
if($enforce['from'] != 0){
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
if(LANG == "es"){
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".TROOPSFROM." ".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." </a>";
|
||||
}else{
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." ".TROOPSFROM."</a>";
|
||||
}
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($enforce['from'], "owner"), "tribe", 0);
|
||||
$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($enforce['hero'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = $start; $i <= ($start + 9); $i++){
|
||||
if($enforce['u'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}else{
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?w=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}else{
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a>".TASKMASTER."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
echo "<a> ".VILLAGE_OF_THE_ELDERS_TROOPS."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = 4;
|
||||
$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($enforce['hero']!=0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i=$start;$i<=($start+9);$i++) {
|
||||
if($enforce['u'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
if($enforce['hero']!=0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><span class=none><b>".SEND_BACK."</b></span></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
echo "<a> ".VILLAGE_OF_THE_ELDERS_TROOPS."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = 4;
|
||||
$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($enforce['hero'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = $start; $i <= ($start + 9); $i++){
|
||||
if($enforce['u'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}else{
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><span class=none><b>".SEND_BACK."</b></span></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
}
|
||||
$enforcevill = array();
|
||||
$enforceoasis = array();
|
||||
$allenforce=$village->enforcetoyou;
|
||||
$enforcemeoasis=$village->enforceoasis;
|
||||
if(count($allenforce) > 0) {
|
||||
foreach($allenforce as $enforce) {
|
||||
$conquredvid=$database->getOasisField($enforce['vref'], "conqured");
|
||||
if ($conquredvid>0) {
|
||||
$enforce['conqured']=$conquredvid;
|
||||
array_push($enforceoasis,$enforce);
|
||||
} else {
|
||||
array_push($enforcevill,$enforce);
|
||||
}
|
||||
$allenforce = $village->enforcetoyou;
|
||||
$enforcemeoasis = $village->enforceoasis;
|
||||
if(count($allenforce) > 0){
|
||||
foreach($allenforce as $enforce){
|
||||
$conquredvid = $database->getOasisField($enforce['vref'], "conqured");
|
||||
if($conquredvid > 0){
|
||||
$enforce['conqured'] = $conquredvid;
|
||||
array_push($enforceoasis, $enforce);
|
||||
}else{
|
||||
array_push($enforcevill, $enforce);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(count($enforcemeoasis) > 0){
|
||||
foreach($enforcemeoasis as $enforce){
|
||||
array_push($enforceoasis, $enforce);
|
||||
}
|
||||
}
|
||||
if(count($enforcemeoasis) > 0) {
|
||||
foreach($enforcemeoasis as $enforce) {
|
||||
array_push($enforceoasis,$enforce);
|
||||
}
|
||||
}
|
||||
if (count($enforcevill)>0) {
|
||||
echo "<h4>".TROOPS_IN_OTHER_VILLAGE."</h4>";
|
||||
foreach($enforcevill as $enforce) {
|
||||
$colspan = 10+$enforce['hero'];
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a></td>
|
||||
if(count($enforcevill) > 0){
|
||||
echo "<h4>".TROOPS_IN_OTHER_VILLAGE."</h4>";
|
||||
foreach($enforcevill as $enforce){
|
||||
$colspan = 10 + $enforce['hero'];
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
echo "<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".REINFORCEMENTFOR." ".$database->getVillageField($enforce['vref'],"name")." </a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0);
|
||||
$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($enforce['hero']!=0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i=$start;$i<=($start+9);$i++) {
|
||||
if($enforce['u'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
echo "<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".REINFORCEMENTFOR." ".$database->getVillageField($enforce['vref'], "name")." </a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($enforce['from'], "owner"), "tribe", 0);
|
||||
$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($enforce['hero'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = $start; $i <= ($start + 9); $i++){
|
||||
if($enforce['u'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}else{
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
if($enforce['hero']!=0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
if(count($enforceoasis) > 0) {
|
||||
echo "<h4>".TROOPS_IN_OASIS."</h4>";
|
||||
foreach($enforceoasis as $enforce) {
|
||||
$colspan = 10+$enforce['hero'];
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".$database->getVillageField($enforce['conqured'],"name")."</a></td>
|
||||
if(count($enforceoasis) > 0){
|
||||
echo "<h4>".TROOPS_IN_OASIS."</h4>";
|
||||
foreach($enforceoasis as $enforce){
|
||||
$colspan = 10 + $enforce['hero'];
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$enforce['vref']."&c=".$generator->getMapCheck($enforce['vref'])."\">".$database->getVillageField($enforce['conqured'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
if (LANG == "es") {
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".TROOPSFROM." ".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." </a> ".FROM." <a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a>";
|
||||
}else{ echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'],"owner")."\">".$database->getUserField($database->getVillageField($enforce['from'],"owner"),"username",0)." ".TROOPSFROM."</a> ".FROM." <a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'],"name")."</a>";
|
||||
if(LANG == "es"){
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".TROOPSFROM." ".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." </a> ".FROM." <a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a>";
|
||||
}else{
|
||||
echo "<a href=\"spieler.php?uid=".$database->getVillageField($enforce['from'], "owner")."\">".$database->getUserField($database->getVillageField($enforce['from'], "owner"), "username", 0)." ".TROOPSFROM."</a> ".FROM." <a href=\"karte.php?d=".$enforce['from']."&c=".$generator->getMapCheck($enforce['from'])."\">".$database->getVillageField($enforce['from'], "name")."</a>";
|
||||
}
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($enforce['from'], "owner"), "tribe", 0);
|
||||
$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($enforce['hero'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = $start; $i <= ($start + 9); $i++){
|
||||
if($enforce['u'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}else{
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
if($enforce['hero'] != 0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce, $tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0);
|
||||
$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($enforce['hero']!=0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i=$start;$i<=($start+9);$i++) {
|
||||
if($enforce['u'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $enforce['u'.$i]."</td>";
|
||||
}
|
||||
if($enforce['hero']!=0){
|
||||
echo "<td>".$enforce['hero']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($enforce,$tribe)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?r=".$enforce['id']."'>".SEND_BACK."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
if(count($database->getPrisoners3($village->wid)) > 0) {
|
||||
echo "<h4>".PRISONERS."</h4>";
|
||||
foreach($database->getPrisoners3($village->wid) as $prisoners) {
|
||||
$colspan = 10+$prisoners['t11'];
|
||||
$colspan2 = $colspan + 1;
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".$database->getVillageField($prisoners['wref'],"name")."</a></td>
|
||||
if(count($database->getPrisoners3($village->wid)) > 0){
|
||||
echo "<h4>".PRISONERS."</h4>";
|
||||
foreach($database->getPrisoners3($village->wid) as $prisoners){
|
||||
$colspan = 10 + $prisoners['t11'];
|
||||
$colspan2 = $colspan + 1;
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".$database->getVillageField($prisoners['wref'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
echo "<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".PRISONERSIN." ".$database->getVillageField($prisoners['wref'],"name")."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
|
||||
$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($prisoners['t11']!=0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i=1;$i<=10;$i++) {
|
||||
if($prisoners['t'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $prisoners['t'.$i]."</td>";
|
||||
echo "<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".PRISONERSIN." ".$database->getVillageField($prisoners['wref'], "name")."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($prisoners['from'], "owner"), "tribe", 0);
|
||||
$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($prisoners['t11'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = 1; $i <= 10; $i++){
|
||||
if($prisoners['t'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else echo "<td>";
|
||||
echo $prisoners['t'.$i]."</td>";
|
||||
}
|
||||
if($prisoners['t11'] > 0) echo "<td>".$prisoners['t11']."</td>";
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan2\"><div class='sup'>".$technology->getUpkeep($prisoners, $tribe, 0, 1)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>".KILL."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
if($prisoners['t11']!=0){
|
||||
echo "<td>".$prisoners['t11']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><th>".UPKEEP."</th><td colspan=\"$colspan2\"><div class='sup'>".$technology->getUpkeep($prisoners,$tribe,0,1)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />".PER_HR."</div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>".KILL."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
if(count($database->getPrisoners($village->wid)) > 0) {
|
||||
echo "<h4>".PRISONERS."</h4>";
|
||||
foreach($database->getPrisoners($village->wid) as $prisoners) {
|
||||
$colspan = 10 + $prisoners['t11'];
|
||||
$colspan2 = $colspan + 1;
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".$database->getVillageField($prisoners['from'],"name")."</a></td>
|
||||
if(count($database->getPrisoners($village->wid)) > 0){
|
||||
echo "<h4>".PRISONERS."</h4>";
|
||||
foreach($database->getPrisoners($village->wid) as $prisoners){
|
||||
$colspan = 10 + $prisoners['t11'];
|
||||
$colspan2 = $colspan + 1;
|
||||
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
|
||||
<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".$database->getVillageField($prisoners['from'], "name")."</a></td>
|
||||
<td colspan=\"$colspan\">";
|
||||
echo "<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".PRISONERSFROM." ".$database->getVillageField($prisoners['from'],"name")."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
|
||||
$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($prisoners['t11']!=0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i=1;$i<=10;$i++) {
|
||||
if($prisoners['t'.$i] == 0) {
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else {
|
||||
echo "<td>";
|
||||
}
|
||||
echo $prisoners['t'.$i]."</td>";
|
||||
}
|
||||
if($prisoners['t11']!=0){
|
||||
echo "<td>".$prisoners['t11']."</td>";
|
||||
}
|
||||
echo "</tr></tbody>
|
||||
echo "<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".PRISONERSFROM." ".$database->getVillageField($prisoners['from'], "name")."</a>";
|
||||
echo "</td></tr></thead><tbody class=\"units\">";
|
||||
$tribe = $database->getUserField($database->getVillageField($prisoners['from'], "owner"), "tribe", 0);
|
||||
$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($prisoners['t11'] != 0){
|
||||
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
|
||||
}
|
||||
echo "</tr><tr><th>".TROOPS."</th>";
|
||||
for($i = 1; $i <= 10; $i++){
|
||||
if($prisoners['t'.$i] == 0){
|
||||
echo "<td class=\"none\">";
|
||||
}
|
||||
else echo "<td>";
|
||||
echo $prisoners['t'.$i]."</td>";
|
||||
}
|
||||
if($prisoners['t11'] > 0) echo "<td>".$prisoners['t11']."</td>";
|
||||
|
||||
echo "</tr></tbody>
|
||||
<tbody class=\"infos\"><tr><td colspan=\"$colspan2\"><div class='sup'><img class=\"r6\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" /></div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>".SEND_BACK."</a></div></td></tr>";
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
$units_type = $database->getMovement("3",$village->wid,0);
|
||||
$settlers = $database->getMovement("5",$village->wid,0);
|
||||
$units_type = $database->getMovement(3, $village->wid, 0);
|
||||
$settlers = $database->getMovement(5, $village->wid, 0);
|
||||
$units_incoming = count($units_type);
|
||||
for($i=0;$i<$units_incoming;$i++){
|
||||
if($units_type[$i]['vref'] != $village->wid)
|
||||
$units_incoming -= 1;
|
||||
for($i = 0; $i < $units_incoming; $i++){
|
||||
if($units_type[$i]['vref'] != $village->wid) $units_incoming -= 1;
|
||||
}
|
||||
$units_incoming += count($settlers);
|
||||
|
||||
if($units_incoming >= 1){
|
||||
echo "<h4>".TROOPS_ON_THEIR_WAY."</h4>";
|
||||
include("16_walking.tpl");
|
||||
echo "<h4>".TROOPS_ON_THEIR_WAY."</h4>";
|
||||
include ("16_walking.tpl");
|
||||
}
|
||||
|
||||
include("upgrade.tpl");
|
||||
include ("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
</p>
|
||||
</div>
|
||||
@@ -24,7 +24,6 @@
|
||||
}
|
||||
$trainlist = $technology->getTrainingList(1);
|
||||
if(count($trainlist) > 0) {
|
||||
//$timer = 2*count($trainlist);
|
||||
echo "
|
||||
<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\">
|
||||
<thead><tr>
|
||||
@@ -41,7 +40,7 @@
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
@@ -52,9 +51,9 @@
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer?>"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
?>
|
||||
</p></div>
|
||||
</p></div>
|
||||
@@ -52,7 +52,7 @@
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1) {
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
@@ -63,7 +63,7 @@
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer?>"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
?>
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
@@ -104,7 +104,7 @@
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer?>"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
|
||||
@@ -141,15 +141,13 @@ if($fail > 0) {
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
|
||||
@@ -137,15 +137,13 @@ echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">".RESEARCH_AVAILABL
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
|
||||
@@ -140,15 +140,13 @@ $acares = $technology->grabAcademyRes();
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
|
||||
@@ -134,15 +134,13 @@ echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">".RESEARCH_AVAILABL
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
|
||||
@@ -130,15 +130,13 @@ echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">".RESEARCH_AVAILABL
|
||||
if(count($acares) > 0) {
|
||||
echo "<table cellpadding=\"1\" cellspacing=\"1\" class=\"under_progress\"><thead><tr><td>".RESEARCHING."</td><td>".DURATION."</td><td>".COMPLETE."</td></tr>
|
||||
</thead><tbody>";
|
||||
$timer = 1;
|
||||
foreach($acares as $aca) {
|
||||
$unit = substr($aca['tech'],1,2);
|
||||
echo "<tr><td class=\"desc\"><img class=\"unit u$unit\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($unit)."\" title=\"".$technology->getUnitName($unit)."\" />".$technology->getUnitName($unit)."</td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer$timer\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "<td class=\"dur\"><span id=\"timer".++$session->timer."\">".$generator->getTimeFormat($aca['timestamp']-time())."</span></td>";
|
||||
$date = $generator->procMtime($aca['timestamp']);
|
||||
echo "<td class=\"fin\"><span>".$date[1]."</span><span> hrs</span></td>";
|
||||
echo "</tr>";
|
||||
$timer +=1;
|
||||
}
|
||||
echo "</tbody></table>";
|
||||
}
|
||||
|
||||
@@ -1,18 +1,14 @@
|
||||
<?php
|
||||
if(!isset($timer)) {
|
||||
$timer = 1;
|
||||
}
|
||||
$timeleft = $database->getVillageField($village->wid, 'celebration');
|
||||
if($timeleft > Time()){
|
||||
if($timeleft > time()){
|
||||
echo '</br>';
|
||||
echo '<table cellpadding="0" cellspacing="0" id="building_contract">';
|
||||
echo '<tr><td>';
|
||||
echo 'celebration still needs:';
|
||||
echo "</td><td><span id=\"timer".$timer."\">";
|
||||
echo $generator->getTimeFormat($timeleft-time());
|
||||
echo "</td><td><span id=\"timer".++$session->timer."\">";
|
||||
echo $generator->getTimeFormat($timeleft - time());
|
||||
echo "</span> hrs.</td>";
|
||||
echo "<td>done at ".date('H:i', $timeleft)."</td></tr>";
|
||||
echo "</table>";
|
||||
$timer +=1;
|
||||
}
|
||||
?>
|
||||
@@ -17,7 +17,7 @@
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
@@ -28,7 +28,7 @@
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer; ?>"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
?>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
@@ -28,7 +28,7 @@
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer; ?>"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
?>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
<?php
|
||||
$artefact = $database->getArtefactDetails($_GET['show']);
|
||||
if(empty($artefact)){
|
||||
header("location: build.php?gid=27");
|
||||
exit;
|
||||
}
|
||||
|
||||
if($artefact['size'] == 1 && $artefact['type'] != 11){
|
||||
$reqlvl = 10;
|
||||
$effect = VILLAGE;
|
||||
@@ -9,11 +14,17 @@ if($artefact['size'] == 1 && $artefact['type'] != 11){
|
||||
}
|
||||
|
||||
$activationTime = 86400 / (SPEED == 2 ? 1.5 : (SPEED == 3 ? 2 : SPEED));
|
||||
$time = time();
|
||||
$nextEffect = "-";
|
||||
|
||||
if($artefact['owner'] == 3) $active = "-";
|
||||
elseif(!$artefact['active'] && $artefact['conquered'] < time() - $activationTime) $active = "<b>Can't be activated</b>";
|
||||
elseif(!$artefact['active'] && $artefact['conquered'] < $time - $activationTime) $active = "<b>Can't be activated</b>";
|
||||
elseif (!$artefact['active']) $active = date("Y-m-d H:i:s", $artefact['conquered'] + $activationTime);
|
||||
else $active = "<b>".ACTIVE."</b>";
|
||||
else
|
||||
{
|
||||
$active = "<b>".ACTIVE."</b>";
|
||||
$nextEffect = date("Y-m-d H:i:s", $artefact['lastupdate'] + (86400 / (SPEED == 2 ? 1.5 : (SPEED == 3 ? 2 : SPEED))));
|
||||
}
|
||||
|
||||
//// Added by brainiac - thank you
|
||||
if ($artefact['type'] == 8)
|
||||
@@ -120,6 +131,14 @@ $bonus = isset($betterorbadder) ? $betterorbadder." (<b>".str_replace(["(", ")"]
|
||||
<th><?php echo TIME_ACTIVATION; ?></th>
|
||||
<td><?php echo $active;?></td>
|
||||
</tr>
|
||||
|
||||
<?php if($artefact['type'] == 8){?>
|
||||
<tr>
|
||||
<th><?php echo NEXT_EFFECT; ?></th>
|
||||
<td><?php echo $nextEffect;?></td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
|
||||
</tbody></table>
|
||||
<table class="art_details" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer; ?>"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer; ?>"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
<table id="distribution" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php echo "<tr class='next'><th>".HERO_READY."<span id=timer1>" . $timeleft . "</span></th></tr>"; ?>
|
||||
<?php echo "<tr class='next'><th>".HERO_READY."<span id=timer".++$session->timer.">" . $timeleft . "</span></th></tr>"; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ if($session->access != BANNED){
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
|
||||
for ($i=0; $i<count($oasisarray); $i++) {
|
||||
if(!empty($oasisarray)){
|
||||
for($i = 0; $i < count($oasisarray); $i++){
|
||||
$oasiscoor = $database->getCoor($oasisarray[$i]['wref']);
|
||||
?>
|
||||
<tr>
|
||||
@@ -78,6 +78,13 @@ if($session->access != BANNED){
|
||||
}
|
||||
?></td>
|
||||
</tr>
|
||||
<?php } ?>
|
||||
<?php
|
||||
}
|
||||
}else{
|
||||
?>
|
||||
<tr>
|
||||
<td class="none" colspan="4"><?php echo NO_OASIS; ?></td>
|
||||
</tr>
|
||||
<?php }?>
|
||||
</tbody>
|
||||
</table>
|
||||
@@ -6,22 +6,6 @@
|
||||
</thead>
|
||||
|
||||
<?php
|
||||
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
|
||||
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
|
||||
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
|
||||
if($artefact > 0){
|
||||
$artefact_bonus = 2;
|
||||
$artefact_bonus2 = 1;
|
||||
}else if($artefact1 > 0){
|
||||
$artefact_bonus = 2;
|
||||
$artefact_bonus2 = 1;
|
||||
}else if($artefact2 > 0){
|
||||
$artefact_bonus = 4;
|
||||
$artefact_bonus2 = 3;
|
||||
}else{
|
||||
$artefact_bonus = 1;
|
||||
$artefact_bonus2 = 1;
|
||||
}
|
||||
/*-------------------------------------------------------*\
|
||||
| ********* DO NOT REMOVE THIS COPYRIGHT NOTICE ********* |
|
||||
+---------------------------------------------------------+
|
||||
@@ -31,69 +15,63 @@
|
||||
\*-------------------------------------------------------*/
|
||||
|
||||
// check if there is a hero in revive already
|
||||
$reviving = false;
|
||||
$training = false;
|
||||
$reviving = $training = false;
|
||||
|
||||
foreach ($heroes as $hero_datarow) {
|
||||
if ($hero_datarow['inrevive']) {
|
||||
$reviving = true;
|
||||
}
|
||||
|
||||
if ($hero_datarow['intraining']) {
|
||||
$training = true;
|
||||
}
|
||||
if ($hero_datarow['inrevive']) $reviving = true;
|
||||
if ($hero_datarow['intraining']) $training = true;
|
||||
}
|
||||
|
||||
foreach ($heroes as $hero_datarow) {
|
||||
|
||||
if($hero_datarow['unit'] == 1) {
|
||||
$name = U1;
|
||||
} else if($hero_datarow['unit'] == 2) {
|
||||
$name = U2;
|
||||
} else if($hero_datarow['unit'] == 3) {
|
||||
$name = U3;
|
||||
} else if($hero_datarow['unit'] == 5) {
|
||||
$name = U5;
|
||||
} else if($hero_datarow['unit'] == 6) {
|
||||
$name = U6;
|
||||
} else if($hero_datarow['unit'] == 11) {
|
||||
$name = U11;
|
||||
} else if($hero_datarow['unit'] == 12) {
|
||||
$name = U12;
|
||||
} else if($hero_datarow['unit'] == 13) {
|
||||
$name = U13;
|
||||
} else if($hero_datarow['unit'] == 15) {
|
||||
$name = U15;
|
||||
} else if($hero_datarow['unit'] == 16) {
|
||||
$name = U16;
|
||||
} else if($hero_datarow['unit'] == 21) {
|
||||
$name = U21;
|
||||
} else if($hero_datarow['unit'] == 22) {
|
||||
$name = U22;
|
||||
} else if($hero_datarow['unit'] == 24) {
|
||||
$name = U24;
|
||||
} else if($hero_datarow['unit'] == 25) {
|
||||
$name = U25;
|
||||
} else if($hero_datarow['unit'] == 26) {
|
||||
$name = U26;
|
||||
}
|
||||
if($hero_datarow['level'] <= 60){
|
||||
$wood = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['wood']);
|
||||
$clay = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['clay']);
|
||||
$iron = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['iron']);
|
||||
$crop = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['crop']);
|
||||
$timeToTrain = round((${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['time']) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$training_time = $generator->getTimeFormat($timeToTrain);
|
||||
$training_time2 = time() + $timeToTrain;
|
||||
}else{
|
||||
$wood = (${'h'.$hero_datarow['unit'].'_full'}[60]['wood']);
|
||||
$clay = (${'h'.$hero_datarow['unit'].'_full'}[60]['clay']);
|
||||
$iron = (${'h'.$hero_datarow['unit'].'_full'}[60]['iron']);
|
||||
$crop = (${'h'.$hero_datarow['unit'].'_full'}[60]['crop']);
|
||||
$timeToTrain = round((${'h'.$hero_datarow['unit'].'_full'}[60]['time']) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$training_time = $generator->getTimeFormat($timeToTrain);
|
||||
$training_time2 = time() + $timeToTrain;
|
||||
}
|
||||
if($hero_datarow['unit'] == 1){
|
||||
$name = U1;
|
||||
}else if($hero_datarow['unit'] == 2){
|
||||
$name = U2;
|
||||
}else if($hero_datarow['unit'] == 3){
|
||||
$name = U3;
|
||||
}else if($hero_datarow['unit'] == 5){
|
||||
$name = U5;
|
||||
}else if($hero_datarow['unit'] == 6){
|
||||
$name = U6;
|
||||
}else if($hero_datarow['unit'] == 11){
|
||||
$name = U11;
|
||||
}else if($hero_datarow['unit'] == 12){
|
||||
$name = U12;
|
||||
}else if($hero_datarow['unit'] == 13){
|
||||
$name = U13;
|
||||
}else if($hero_datarow['unit'] == 15){
|
||||
$name = U15;
|
||||
}else if($hero_datarow['unit'] == 16){
|
||||
$name = U16;
|
||||
}else if($hero_datarow['unit'] == 21){
|
||||
$name = U21;
|
||||
}else if($hero_datarow['unit'] == 22){
|
||||
$name = U22;
|
||||
}else if($hero_datarow['unit'] == 24){
|
||||
$name = U24;
|
||||
}else if($hero_datarow['unit'] == 25){
|
||||
$name = U25;
|
||||
}else if($hero_datarow['unit'] == 26){
|
||||
$name = U26;
|
||||
}
|
||||
|
||||
if($hero_datarow['level'] <= 60){
|
||||
$wood = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['wood']);
|
||||
$clay = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['clay']);
|
||||
$iron = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['iron']);
|
||||
$crop = (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['crop']);
|
||||
$timeToTrain = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, (${'h'.$hero_datarow['unit'].'_full'}[$hero_datarow['level']]['time']) / SPEED);
|
||||
$training_time = $generator->getTimeFormat($timeToTrain);
|
||||
$training_time2 = time() + $timeToTrain;
|
||||
}else{
|
||||
$wood = (${'h'.$hero_datarow['unit'].'_full'}[60]['wood']);
|
||||
$clay = (${'h'.$hero_datarow['unit'].'_full'}[60]['clay']);
|
||||
$iron = (${'h'.$hero_datarow['unit'].'_full'}[60]['iron']);
|
||||
$crop = (${'h'.$hero_datarow['unit'].'_full'}[60]['crop']);
|
||||
$timeToTrain = $database->getArtifactsValueInfluence($session->uid, $village->wid, 5, (${'h'.$hero_datarow['unit'].'_full'}[60]['time']) / SPEED);
|
||||
$training_time = $generator->getTimeFormat($timeToTrain);
|
||||
$training_time2 = time() + $timeToTrain;
|
||||
}
|
||||
|
||||
if($hero_datarow['inrevive'] == 1) {
|
||||
$timeleft = $generator->getTimeFormat($hero_datarow['trainingtime'] - time());
|
||||
@@ -101,7 +79,7 @@
|
||||
<table id="distribution" cellpadding="1" cellspacing="1">
|
||||
<thead>
|
||||
<tr>
|
||||
<?php echo "<tr class='next'><th>".HERO_READY." <span id=timer1>" . $timeleft . "</span></th></tr>"; ?>
|
||||
<?php echo "<tr class='next'><th>".HERO_READY." <span id=timer".++$session->timer.">".$timeleft."</span></th></tr>"; ?>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
@@ -117,12 +95,12 @@
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
<?php }else if (!$reviving) { if($hero_datarow['unit'] == 1 OR 11 OR 21){ ?>
|
||||
<?php }else if (!$reviving) if(in_array($hero_datarow['unit'], [1, 11, 21])){ ?>
|
||||
<tr>
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $hero_datarow['unit']; ?>" src="img/x.gif" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" />
|
||||
<?php echo $name . " (Level " . $hero_datarow['level'] . ")"; ?>
|
||||
<?php echo $name." (Level ".$hero_datarow['level'].")"; ?>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" alt="Wood" title="<?php echo LUMBER; ?>" /><?php echo $wood; ?>|
|
||||
@@ -142,15 +120,15 @@
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="val" width="20%"><center>
|
||||
<td class="val" width="20%" style="text-align: center">
|
||||
<?php
|
||||
if($village->awood < $wood OR $village->aclay < $clay OR $village->airon < $iron OR $village->acrop < $crop) {
|
||||
if($village->awood < $wood || $village->aclay < $clay || $village->airon < $iron || $village->acrop < $crop) {
|
||||
echo "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else {
|
||||
echo "<a href=\"build.php?id=".$id."&revive=1&hid=".$hero_datarow['heroid']."\">".REVIVE."</a>";
|
||||
}
|
||||
|
||||
?></center></td>
|
||||
?></td>
|
||||
</tr>
|
||||
<?php }else { ?>
|
||||
|
||||
@@ -160,7 +138,7 @@
|
||||
<td class="desc">
|
||||
<div class="tit">
|
||||
<img class="unit u<?php echo $hero_datarow['unit']; ?>" src="img/x.gif" alt="<?php echo $name; ?>" title="<?php echo $name; ?>" />
|
||||
<?php echo $name . " (Level " . $hero_datarow['level'] . ")"; ?>
|
||||
<?php echo $name." (Level ".$hero_datarow['level'].")"; ?>
|
||||
</div>
|
||||
<div class="details">
|
||||
<img class="r1" src="img/x.gif" alt="Wood" title="<?php echo LUMBER; ?>" /><?php echo $wood; ?>|
|
||||
@@ -180,16 +158,16 @@
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td class="val" width="20%"><center>
|
||||
<td class="val" width="20%" style="text-align: center">
|
||||
<?php
|
||||
if($village->awood < $wood OR $village->aclay < $clay OR $village->airon < $iron OR $village->acrop < $crop) {
|
||||
if($village->awood < $wood || $village->aclay < $clay || $village->airon < $iron || $village->acrop < $crop) {
|
||||
echo "<span class=\"none\">".NOT."".ENOUGH_RESOURCES."</span>";
|
||||
}else {
|
||||
echo "<a href=\"build.php?id=".$id."&revive=1&hid=".$hero_datarow['heroid']."\">".REVIVE."</a>";
|
||||
}
|
||||
|
||||
?>
|
||||
</center></td>
|
||||
</td>
|
||||
</tr>
|
||||
<?php }
|
||||
}
|
||||
@@ -198,15 +176,7 @@
|
||||
if(isset($_GET['revive']) && $_GET['revive'] == 1 && isset($_GET['hid']) && $_GET['hid'] == $hero_datarow['heroid'] && $hero_datarow['inrevive'] == 0 && $hero_datarow['intraining'] == 0 && $hero_datarow['dead'] == 1){
|
||||
if($session->access != BANNED){
|
||||
mysqli_query($database->dblink,"UPDATE ".TB_PREFIX."hero SET `inrevive` = '1', `trainingtime` = '".(int) $training_time2."', `wref` = '".(int) $village->wid."' WHERE `heroid` = ".(int) $_GET['hid']." AND `uid` = '".(int) $session->uid."'");
|
||||
mysqli_query($database->dblink,"
|
||||
UPDATE " . TB_PREFIX . "vdata
|
||||
SET
|
||||
`wood` = `wood` - ".(int) $wood.",
|
||||
`clay` = `clay` - ".(int) $clay.",
|
||||
`iron` = `iron` - ".(int) $iron .",
|
||||
`crop` = `crop` - ".(int) $crop."
|
||||
WHERE
|
||||
`wref` = '" . (int) $village->wid . "'");
|
||||
$database->modifyResource($village->wid, $wood, $clay, $iron, $crop, 0);
|
||||
header("Location: build.php?id=".$id."");
|
||||
exit;
|
||||
} else {
|
||||
@@ -214,15 +184,11 @@
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</table><br />
|
||||
|
||||
|
||||
<?php
|
||||
if(!$reviving && !$training) {
|
||||
include ("37_train.tpl");
|
||||
}
|
||||
if(!$reviving && !$training) include ("37_train.tpl");
|
||||
?>
|
||||
@@ -15,23 +15,6 @@
|
||||
## ##
|
||||
#################################################################################
|
||||
|
||||
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,5,3,0));
|
||||
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,5,1,1));
|
||||
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,5,2,0));
|
||||
if($artefact > 0){
|
||||
$artefact_bonus = 2;
|
||||
$artefact_bonus2 = 1;
|
||||
}else if($artefact1 > 0){
|
||||
$artefact_bonus = 2;
|
||||
$artefact_bonus2 = 1;
|
||||
}else if($artefact2 > 0){
|
||||
$artefact_bonus = 4;
|
||||
$artefact_bonus2 = 3;
|
||||
}else{
|
||||
$artefact_bonus = 1;
|
||||
$artefact_bonus2 = 1;
|
||||
}
|
||||
|
||||
//check if there is unit needed in the village
|
||||
|
||||
$result = mysqli_query($database->dblink,"SELECT * FROM ".TB_PREFIX."units WHERE `vref` = ".(int) $village->wid."");
|
||||
@@ -63,7 +46,7 @@ if($session->tribe == 1) {
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u1['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
$output.=$generator->getTimeFormat(round($u1['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$output .= $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5,$u1['time'] / SPEED)*3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u1['wood'] + $u1['clay'] + $u1['iron'] + $u1['crop']);
|
||||
@@ -102,7 +85,7 @@ if($session->tribe == 1) {
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u2['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
$output.=$generator->getTimeFormat(round($u2['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$output.=$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u2['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u2['wood'] + $u2['clay'] + $u2['iron'] + $u2['crop']);
|
||||
@@ -142,7 +125,7 @@ if($session->tribe == 1) {
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
|
||||
$output.= $generator->getTimeFormat(round($u3['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$output.= $generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u3['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u3['wood'] + $u3['clay'] + $u3['iron'] + $u3['crop']);
|
||||
@@ -180,7 +163,7 @@ if($session->tribe == 1) {
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u5['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u5['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u5['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u5['wood'] + $u5['clay'] + $u5['iron'] + $u5['crop']);
|
||||
@@ -219,7 +202,7 @@ if($session->tribe == 1) {
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u6['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u6['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u6['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u6['wood'] + $u6['clay'] + $u6['iron'] + $u6['crop']);
|
||||
@@ -261,7 +244,7 @@ $output.="<tr>
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u11['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u11['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u11['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u11['wood'] + $u11['clay'] + $u11['iron'] + $u11['crop']);
|
||||
@@ -300,7 +283,7 @@ $output.="<tr>
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u12['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u12['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u12['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u12['wood'] + $u12['clay'] + $u12['iron'] + $u12['crop']);
|
||||
@@ -341,7 +324,7 @@ $output.="<tr>
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />";
|
||||
|
||||
$generator->getTimeFormat(round($u13['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u13['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u13['wood'] + $u13['clay'] + $u13['iron'] + $u13['crop']);
|
||||
@@ -380,7 +363,7 @@ $output.="<tr>
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u15['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u15['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u15['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u15['wood'] + $u15['clay'] + $u15['iron'] + $u15['crop']);
|
||||
@@ -420,7 +403,7 @@ $output.="<tr>
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u16['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u16['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u16['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u16['wood'] + $u16['clay'] + $u16['iron'] + $u16['crop']);
|
||||
@@ -462,7 +445,7 @@ $output.="<tr>
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u21['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u21['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u21['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u21['wood'] + $u21['clay'] + $u21['iron'] + $u21['crop']);
|
||||
@@ -501,7 +484,7 @@ $output.="<tr>
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u22['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u22['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u22['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u22['wood'] + $u22['clay'] + $u22['iron'] + $u22['crop']);
|
||||
@@ -541,7 +524,7 @@ $output.="<tr>
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u24['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u24['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u24['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u24['wood'] + $u24['clay'] + $u24['iron'] + $u24['crop']);
|
||||
@@ -580,7 +563,7 @@ $output.="<tr>
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u25['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u25['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u25['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u25['wood'] + $u25['clay'] + $u25['iron'] + $u25['crop']);
|
||||
@@ -620,7 +603,7 @@ $output.="<tr>
|
||||
<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"".CROP."\" />".$u26['crop']."|
|
||||
<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"".CROP_COM."\" />6|
|
||||
<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"".DURATION."\" />".
|
||||
$generator->getTimeFormat(round($u26['time'] / SPEED * $artefact_bonus2 / $artefact_bonus)*3);
|
||||
$generator->getTimeFormat($database->getArtifactsValueInfluence($session->uid, $village->wid, 5, $u26['time'] / SPEED) * 3);
|
||||
|
||||
//-- If available resources combined are not enough, remove NPC button
|
||||
$total_required = (int)($u26['wood'] + $u26['clay'] + $u26['iron'] + $u26['crop']);
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
echo $train['amt']." ".$train['name']."</td><td class=\"dur\">";
|
||||
if ($TrainCount == 1 ) {
|
||||
$NextFinished = $generator->getTimeFormat($train['timestamp2']-time());
|
||||
echo "<span id=timer1>".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
echo "<span id=timer".++$session->timer.">".$generator->getTimeFormat($train['timestamp']-time())."</span>";
|
||||
} else {
|
||||
echo $generator->getTimeFormat($train['eachtime']*$train['amt']);
|
||||
}
|
||||
@@ -51,7 +51,7 @@
|
||||
}
|
||||
echo $time[1];
|
||||
} ?>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer2"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tr><tr class="next"><td colspan="3"><?php echo UNIT_FINISHED; ?> <span id="timer<?php echo ++$session->timer; ?>"><?php echo $NextFinished; ?></span></td></tr>
|
||||
</tbody></table>
|
||||
<?php }
|
||||
include("upgrade.tpl");
|
||||
|
||||
@@ -30,9 +30,6 @@ $building->loadBuilding();
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if(!isset($timer)) {
|
||||
$timer = 1;
|
||||
}
|
||||
$BuildingList = array();
|
||||
foreach($building->buildArray as $jobs) {
|
||||
if($jobs['master'] == 0){
|
||||
@@ -43,11 +40,10 @@ $building->loadBuilding();
|
||||
if($jobs['loopcon'] == 1) {
|
||||
echo " (waiting loop)";
|
||||
}
|
||||
echo "</td><td>in <span id=\"timer".$timer."\">";
|
||||
echo "</td><td>in <span id=\"timer".++$session->timer."\">";
|
||||
echo $generator->getTimeFormat($jobs['timestamp']-time());
|
||||
echo "</span> hrs.</td>";
|
||||
echo "<td>done at ".date('H:i', $jobs['timestamp'])."</td></tr>";
|
||||
$timer +=1;
|
||||
}else{
|
||||
echo "<tr><td class=\"ico\"><a href=\"?d=".$jobs['id']."&a=0&c=$session->checker\">";
|
||||
echo "<img src=\"img/x.gif\" class=\"del\" title=\"cancel\" alt=\"cancel\" /></a></td><td>";
|
||||
|
||||
@@ -116,7 +116,7 @@ echo "<a href=\"spieler.php?s=3&id=".$session->uid."&a=1&e=4\"><img
|
||||
title=\"Cancel process\" /> </a>";
|
||||
$time=$generator->getTimeFormat(($timestamp-time()));
|
||||
echo "The account will be deleted in <span
|
||||
id=\"timer2\">".$time."</span> .</td>";
|
||||
id=\"timer".++$session->timer."\">".$time."</span> .</td>";
|
||||
}
|
||||
else {
|
||||
?>
|
||||
|
||||
+93
-82
@@ -1,22 +1,27 @@
|
||||
<?php
|
||||
include('menu.tpl');
|
||||
include ('menu.tpl');
|
||||
?>
|
||||
<table id="warehouse" cellpadding="1" cellspacing="1">
|
||||
<thead><tr><th colspan="7">Warehouse</th></tr>
|
||||
<tr><td>Village</td>
|
||||
<td><img class="r1" src="img/x.gif" title="Wood" alt="Wood"></td>
|
||||
<td><img class="r2" src="img/x.gif" title="Clay" alt="Clay"></td>
|
||||
<td><img class="r3" src="img/x.gif" title="Iron" alt="Iron"></td>
|
||||
<td><img class="clock" src="img/x.gif" title="Clock" alt="Clock"></td>
|
||||
<td><img class="r4" src="img/x.gif" title="Crop" alt="Crop"></td>
|
||||
<td><img class="clock" src="img/x.gif" title="Clock" alt="Clock"></td>
|
||||
</tr></thead><tbody>
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="7">Warehouse</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Village</td>
|
||||
<td><img class="r1" src="img/x.gif" title="Wood" alt="Wood"></td>
|
||||
<td><img class="r2" src="img/x.gif" title="Clay" alt="Clay"></td>
|
||||
<td><img class="r3" src="img/x.gif" title="Iron" alt="Iron"></td>
|
||||
<td><img class="clock" src="img/x.gif" title="Clock" alt="Clock"></td>
|
||||
<td><img class="r4" src="img/x.gif" title="Crop" alt="Crop"></td>
|
||||
<td><img class="clock" src="img/x.gif" title="Clock" alt="Clock"></td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$varray = $database->getProfileVillages($session->uid);
|
||||
$timer = 1;
|
||||
foreach($varray as $vil){
|
||||
$varray = $database->getProfileVillages($session->uid);
|
||||
foreach($varray as $vil){
|
||||
$vid = $vil['wref'];
|
||||
$vdata = $database->getVillage($vid);
|
||||
$vdata = $database->getVillage($vid);
|
||||
$pop = $vdata['pop'];
|
||||
$wood = floor($vdata['wood']);
|
||||
$clay = floor($vdata['clay']);
|
||||
@@ -24,98 +29,104 @@ foreach($varray as $vil){
|
||||
$crop = floor($vdata['crop']);
|
||||
$maxs = $vdata['maxstore'];
|
||||
$maxc = $vdata['maxcrop'];
|
||||
|
||||
|
||||
$vresarray = $database->getResourceLevel($vid);
|
||||
$prod_wood = $sawmill = 0;
|
||||
$prod_clay = $claypit = 0;
|
||||
$prod_iron = $foundry = 0;
|
||||
$prod_crop = $grainmill = $bakery = 0;
|
||||
$woodholder = array();
|
||||
$clayholder = array();
|
||||
$ironholder = array();
|
||||
$cropholder = array();
|
||||
for($i=1;$i<=38;$i++) {
|
||||
if($vresarray['f'.$i.'t'] == 1) {
|
||||
array_push($woodholder,'f'.$i);
|
||||
} elseif($vresarray['f'.$i.'t'] == 5) {
|
||||
$sawmill = $vresarray['f'.$i];
|
||||
} elseif($vresarray['f'.$i.'t'] == 2) {
|
||||
array_push($clayholder,'f'.$i);
|
||||
} elseif($vresarray['f'.$i.'t'] == 6) {
|
||||
$claypit = $vresarray['f'.$i];
|
||||
} elseif($vresarray['f'.$i.'t'] == 3) {
|
||||
array_push($ironholder,'f'.$i);
|
||||
} elseif($vresarray['f'.$i.'t'] == 7) {
|
||||
$foundry = $vresarray['f'.$i];
|
||||
} elseif($vresarray['f'.$i.'t'] == 4) {
|
||||
array_push($cropholder,'f'.$i);
|
||||
} elseif($vresarray['f'.$i.'t'] == 8) {
|
||||
$grainmill = $vresarray['f'.$i];
|
||||
} elseif($vresarray['f'.$i.'t'] == 9) {
|
||||
$bakery = $vresarray['f'.$i];
|
||||
}
|
||||
$prod_wood = $sawmill = $prod_clay = $claypit = $prod_iron = $foundry = $prod_crop = $grainmill = $bakery = 0;
|
||||
$woodholder = $clayholder = $ironholder = $cropholder = [];
|
||||
|
||||
for($i = 1; $i <= 38; $i++){
|
||||
if($vresarray['f'.$i.'t'] == 1) array_push($woodholder, 'f'.$i);
|
||||
elseif($vresarray['f'.$i.'t'] == 5) $sawmill = $vresarray['f'.$i];
|
||||
elseif($vresarray['f'.$i.'t'] == 2) array_push($clayholder, 'f'.$i);
|
||||
elseif($vresarray['f'.$i.'t'] == 6) $claypit = $vresarray['f'.$i];
|
||||
elseif($vresarray['f'.$i.'t'] == 3) array_push($ironholder, 'f'.$i);
|
||||
elseif($vresarray['f'.$i.'t'] == 7) $foundry = $vresarray['f'.$i];
|
||||
elseif($vresarray['f'.$i.'t'] == 4) array_push($cropholder, 'f'.$i);
|
||||
elseif($vresarray['f'.$i.'t'] == 8) $grainmill = $vresarray['f'.$i];
|
||||
elseif($vresarray['f'.$i.'t'] == 9) $bakery = $vresarray['f'.$i];
|
||||
}
|
||||
for($i=0;$i<=count($woodholder)-1;$i++) { $prod_wood+= $bid1[$vresarray[$woodholder[$i]]]['prod']; }
|
||||
for($i=0;$i<=count($clayholder)-1;$i++) { $prod_clay+= $bid2[$vresarray[$clayholder[$i]]]['prod']; }
|
||||
for($i=0;$i<=count($ironholder)-1;$i++) { $prod_iron+= $bid3[$vresarray[$ironholder[$i]]]['prod']; }
|
||||
for($i=0;$i<=count($cropholder)-1;$i++) { $prod_crop+= $bid4[$vresarray[$cropholder[$i]]]['prod']; }
|
||||
if($sawmill >= 1) {
|
||||
$prod_wood += $prod_wood /100 * $bid5[$sawmill]['attri'];
|
||||
for($i = 0; $i <= count($woodholder) - 1; $i++){
|
||||
$prod_wood += $bid1[$vresarray[$woodholder[$i]]]['prod'];
|
||||
}
|
||||
if($claypit >= 1) {
|
||||
$prod_clay += $prod_clay /100 * $bid6[$claypit]['attri'];
|
||||
for($i = 0; $i <= count($clayholder) - 1; $i++){
|
||||
$prod_clay += $bid2[$vresarray[$clayholder[$i]]]['prod'];
|
||||
}
|
||||
if($foundry >= 1) {
|
||||
$prod_iron += $prod_iron /100 * $bid7[$foundry]['attri'];
|
||||
for($i = 0; $i <= count($ironholder) - 1; $i++){
|
||||
$prod_iron += $bid3[$vresarray[$ironholder[$i]]]['prod'];
|
||||
}
|
||||
if ($grainmill >= 1 || $bakery >= 1) {
|
||||
$prod_crop += $prod_crop /100 * ((isset($bid8[$grainmill]['attri']) ? $bid8[$grainmill]['attri'] : 0) + (isset($bid9[$bakery]['attri']) ? $bid9[$bakery]['attri'] : 0));
|
||||
for($i = 0; $i <= count($cropholder) - 1; $i++){
|
||||
$prod_crop += $bid4[$vresarray[$cropholder[$i]]]['prod'];
|
||||
}
|
||||
|
||||
if($sawmill >= 1) $prod_wood += $prod_wood / 100 * $bid5[$sawmill]['attri'];
|
||||
if($claypit >= 1) $prod_clay += $prod_clay / 100 * $bid6[$claypit]['attri'];
|
||||
if($foundry >= 1) $prod_iron += $prod_iron / 100 * $bid7[$foundry]['attri'];
|
||||
|
||||
|
||||
if($grainmill >= 1 || $bakery >= 1){
|
||||
$prod_crop += $prod_crop / 100 * ((isset($bid8[$grainmill]['attri']) ? $bid8[$grainmill]['attri'] : 0) + (isset($bid9[$bakery]['attri']) ? $bid9[$bakery]['attri'] : 0));
|
||||
}
|
||||
|
||||
$oasisowned = $database->getOasis($vid);
|
||||
//more oasis logic required
|
||||
if($session->plus) {
|
||||
// more oasis logic required
|
||||
if($session->plus){
|
||||
$prod_wood *= 1.25;
|
||||
$prod_clay *= 1.25;
|
||||
$prod_iron *= 1.25;
|
||||
$prod_crop *= 1.25;
|
||||
}
|
||||
|
||||
$prod_wood *= SPEED;
|
||||
$prod_clay *= SPEED;
|
||||
$prod_iron *= SPEED;
|
||||
$prod_crop *= SPEED;
|
||||
|
||||
|
||||
$prod_crop -= $pop;
|
||||
$prod_crop -= $technology->getUpkeep($technology->getAllUnits($vid),0);
|
||||
$prod_crop -= $technology->getUpkeep($technology->getAllUnits($vid), 0);
|
||||
|
||||
$percentW = floor($wood / ($maxs / 100));
|
||||
$percentC = floor($clay / ($maxs / 100));
|
||||
$percentI = floor($iron / ($maxs / 100));
|
||||
$percentCr = floor($crop / ($maxc / 100));
|
||||
|
||||
if($vid == $village->wid) $class = 'hl';
|
||||
else $class = '';
|
||||
|
||||
$cr = 95; // warning percentage
|
||||
if($percentW >= $cr) $critW = 'crit';
|
||||
else $critW = '';
|
||||
|
||||
$percentW = floor($wood/($maxs/100));
|
||||
$percentC = floor($clay/($maxs/100));
|
||||
$percentI = floor($iron/($maxs/100));
|
||||
$percentCr = floor($crop/($maxc/100));
|
||||
|
||||
if($vid == $village->wid) {$class = 'hl';} else {$class = '';}
|
||||
$cr = 95; //warning percentage
|
||||
if($percentW >= $cr) {$critW = 'crit';} else {$critW = '';}
|
||||
if($percentC >= $cr) {$critC = 'crit';} else {$critC = '';}
|
||||
if($percentI >= $cr) {$critI = 'crit';} else {$critI = '';}
|
||||
if($percentCr >= $cr) {$critCR = 'crit';} else {$critCR = '';}
|
||||
|
||||
$timerwood = floor(($maxs-$wood)/$prod_wood*3600);
|
||||
$timerclay = floor(($maxs-$clay)/$prod_clay*3600);
|
||||
$timeriron = floor(($maxs-$iron)/$prod_iron*3600);
|
||||
$timer1 = min($timerwood,$timerclay,$timeriron);
|
||||
$timer2 = floor(($maxc-$crop)/$prod_crop*3600);
|
||||
|
||||
if($percentC >= $cr) $critC = 'crit';
|
||||
else $critC = '';
|
||||
|
||||
if($percentI >= $cr) $critI = 'crit';
|
||||
else $critI = '';
|
||||
|
||||
if($percentCr >= $cr) $critCR = 'crit';
|
||||
else $critCR = '';
|
||||
|
||||
if($prod_crop < 0) $critCR = $critNCR = 'crit';
|
||||
else $critNCR = '';
|
||||
|
||||
$timerwood = floor(($maxs - $wood) / $prod_wood * 3600);
|
||||
$timerclay = floor(($maxs - $clay) / $prod_clay * 3600);
|
||||
$timeriron = floor(($maxs - $iron) / $prod_iron * 3600);
|
||||
$timer1 = min($timerwood, $timerclay, $timeriron);
|
||||
$timer2 = floor(($prod_crop >= 0 ? $maxc - $crop : $crop) / abs($prod_crop) * 3600);
|
||||
|
||||
if($timer1 > 0) $session->timer++;
|
||||
echo '<tr class="'.$class.'">
|
||||
<td class="vil fc"><a href="dorf1.php?newdid='.$vid.'">'.$vdata['name'].'</a></td>
|
||||
<td class="lum '.$critW.'" title="'.$wood.'/'.$maxs.'">'.$percentW.'%</td>
|
||||
<td class="clay '.$critC.'" title="'.$clay.'/'.$maxs.'">'.$percentC.'%</td>
|
||||
<td class="iron '.$critI.'" title="'.$iron.'/'.$maxs.'">'.$percentI.'%</td>
|
||||
<td class="max123"><span '.($timer1>0?'id="timer'.$timer.'"':'').'>'.($timer1>=0?$generator->getTimeFormat($timer1):'never').'</span></td>';
|
||||
if($timer1 >0) { $timer++; }
|
||||
<td class="max123"><span '.($timer1 > 0 ? 'id="timer'.$session->timer.'"' : '').'>'.($timer1 >= 0 ? $generator->getTimeFormat($timer1) : 'Never').'</span></td>';
|
||||
|
||||
if($timer2 > 0) $session->timer++;
|
||||
echo '
|
||||
<td class="crop '.$critCR.'" title="'.$crop.'/'.$maxc.'">'.$percentCr.'%</td>
|
||||
<td class="max4 lc"><span '.($timer2>0?'id="timer'.$timer.'"':'').'>'.($timer2>=0?$generator->getTimeFormat($timer2):'never').'</span></td></tr>';
|
||||
if($timer1 >0) { $timer++; }
|
||||
<td class="max4 '.$critNCR.'"><span '.($timer2 > 0 ? 'id="timer'.$session->timer.'"' : '').'>'.($timer2 >= 0 ? $generator->getTimeFormat($timer2) : 'Never').'</span></td></tr>';
|
||||
}
|
||||
?>
|
||||
</tbody></table>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<?php
|
||||
$FLData = $database->getFLData($_GET['lid']);
|
||||
if($FLData['owner'] == $session->uid){
|
||||
if(isset($_POST['action']) == 'addSlot' && $_POST['lid']) {
|
||||
|
||||
$troops = 0;
|
||||
@@ -56,7 +54,7 @@ if(isset($_POST['action']) == 'addSlot' && $_POST['lid']) {
|
||||
return round($dist, 1);
|
||||
}
|
||||
|
||||
$distance = getDistance($coor['x'], $coor['y'], $WrefX, $WrefY);
|
||||
$distance = getDistance($coor['x'], $coor['y'], $WrefX, $WrefY);
|
||||
$database->addSlotFarm($_POST['lid'], $session->uid, $Wref, $WrefX, $WrefY, $distance, $_POST['t1'], $_POST['t2'], $_POST['t3'], $_POST['t4'], $_POST['t5'], $_POST['t6'], $_POST['t7'], $_POST['t8'], $_POST['t9'], $_POST['t10']);
|
||||
|
||||
header("Location: build.php?id=39&t=99");
|
||||
@@ -71,7 +69,7 @@ if(isset($_POST['action']) == 'addSlot' && $_POST['lid']) {
|
||||
<?php echo $errormsg; ?>
|
||||
</b></font>
|
||||
|
||||
<form action="build.php?id=39&t=99&action=addraid&lid=<?php echo $_GET['lid']; ?>" method="post">
|
||||
<form action="build.php?id=39&t=99&action=addraid" method="post">
|
||||
<div class="boxes boxesColor gray"><div class="boxes-tl"></div><div class="boxes-tr"></div><div class="boxes-tc"></div><div class="boxes-ml"></div><div class="boxes-mr"></div><div class="boxes-mc"></div><div class="boxes-bl"></div><div class="boxes-br"></div><div class="boxes-bc"></div><div class="boxes-contents cf">
|
||||
<input type="hidden" name="action" value="addSlot">
|
||||
<table cellpadding="1" cellspacing="1" class="transparent" id="raidList">
|
||||
@@ -81,17 +79,16 @@ if(isset($_POST['action']) == 'addSlot' && $_POST['lid']) {
|
||||
<select name="lid">
|
||||
<?php
|
||||
|
||||
$sql = mysqli_query($database->dblink,"SELECT id, name, owner, wref FROM ".TB_PREFIX."farmlist WHERE owner = ".(int) $session->uid." ORDER BY name ASC");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$lid = $row["id"];
|
||||
$lname = $row["name"];
|
||||
$lowner = $row["owner"];
|
||||
$lwref = $row["wref"];
|
||||
$lvname = $database->getVillageField($row["wref"], 'name');
|
||||
if($_GET['lid']==$lid){
|
||||
$selected = 'selected=""';
|
||||
}else{ $selected = ''; }
|
||||
echo '<option value="'.$lid.'" '.$selected.'>'.$lvname.' - '.$lname.'</option>';
|
||||
$sql = mysqli_query($database->dblink, "SELECT id, name, owner, wref FROM ".TB_PREFIX."farmlist WHERE owner = ".(int)$session->uid." ORDER BY name ASC");
|
||||
while($row = mysqli_fetch_array($sql)){
|
||||
$lid = $row["id"];
|
||||
$lname = $row["name"];
|
||||
$lowner = $row["owner"];
|
||||
$lwref = $row["wref"];
|
||||
$lvname = $database->getVillageField($row["wref"], 'name');
|
||||
if($_GET['lid'] == $lid) $selected = 'selected=""';
|
||||
else $selected = '';
|
||||
echo '<option value="'.$lid.'" '.$selected.'>'.$lvname.' - '.$lname.'</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
@@ -126,12 +123,11 @@ if(mysqli_num_rows(mysqli_query($database->dblink,$getwref)) != 0){
|
||||
$towref = $row["towref"];
|
||||
$tocoor = $database->getCoor($towref);
|
||||
$totype = $database->getVillageType2($towref);
|
||||
$tooasistype = $type['oasistype'];
|
||||
if($tooasistype == 0) $tovname = $database->getVillageField($towref, 'name');
|
||||
if($totype == 0) $tovname = $database->getVillageField($towref, 'name');
|
||||
else $tovname = $database->getOasisField($towref, 'name');
|
||||
|
||||
if($vill[$towref] == 0){
|
||||
echo '<option value="'.$towref.'">'.$tovname.'('.$tocoor['x'].'|'.$tocoor['y'].')</option>';
|
||||
echo '<option value="'.$towref.'">'.$tovname.' ('.$tocoor['x'].'|'.$tocoor['y'].')</option>';
|
||||
}
|
||||
$vill[$towref] = 1;
|
||||
}
|
||||
@@ -147,13 +143,6 @@ if(mysqli_num_rows(mysqli_query($database->dblink,$getwref)) != 0){
|
||||
</div>
|
||||
<?php include("Templates/goldClub/trooplist2.tpl"); ?>
|
||||
<br />
|
||||
<button type="submit" value="save" name="save" id="save" class="trav_buttons">Save</button>
|
||||
|
||||
<button type="submit" value="save" name="save" id="save" class="trav_buttons">Create</button>
|
||||
</form>
|
||||
</div>
|
||||
<?php
|
||||
}else{
|
||||
header("Location: build.php?id=39&t=99");
|
||||
exit;
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -135,14 +135,14 @@ if(mysqli_num_rows(mysqli_query($database->dblink, $getwref)) != 0){
|
||||
$towref = $row["towref"];
|
||||
$tocoor = $database->getCoor($towref);
|
||||
$totype = $database->getVillageType2($towref);
|
||||
$tooasistype = $type['oasistype'];
|
||||
if($tooasistype == 0) $tovname = $database->getVillageField($towref, 'name');
|
||||
if($totype == 0) $tovname = $database->getVillageField($towref, 'name');
|
||||
else $tovname = $database->getOasisField($towref, 'name');
|
||||
|
||||
if($row["id"] == $_GET['eid']) $selected = 'selected=""';
|
||||
else $selected = '';
|
||||
|
||||
if($vill[$towref] == 0){
|
||||
echo '<option value="' . $towref . '" ' . $selected . '>' . $tovname . '(' . $tocoor['x'] . '|' . $tocoor['y'] . ')</option>';
|
||||
echo '<option value="'.$towref.'" '.$selected.'>'.$tovname.' ('.$tocoor['x'].'|'.$tocoor['y'].')</option>';
|
||||
}
|
||||
$vill[$towref] = 1;
|
||||
}
|
||||
|
||||
+11
-8
@@ -67,20 +67,23 @@ div.c1 {text-align: center}
|
||||
<?php
|
||||
}
|
||||
include("Templates/links.tpl");
|
||||
include("Templates/natars.tpl")
|
||||
?>
|
||||
</p>
|
||||
<?php
|
||||
$timestamp = $database->isDeleting($session->uid);
|
||||
if($timestamp) {
|
||||
if($timestamp){
|
||||
echo "<br /><td colspan=\"2\" class=\"count\">";
|
||||
if($timestamp > time()+48*3600) {
|
||||
echo "<a href=\"spieler.php?s=3&id=".$session->uid."&a=1&e=4\"><img
|
||||
class=\"del\" src=\"img/x.gif\" alt=\"Cancel process\"
|
||||
title=\"Cancel process\" /> </a>";
|
||||
|
||||
if($timestamp > time() + 172800){
|
||||
echo "<a href=\"spieler.php?s=3&id=" . $session->uid . "&a=1&e=4\"><img
|
||||
class=\"del\" src=\"img/x.gif\" alt=\"Cancel process\"
|
||||
title=\"Cancel process\" /> </a>";
|
||||
}
|
||||
$time=$generator->getTimeFormat(($timestamp-time()));
|
||||
echo "<a href=\"spieler.php?s=3\"> The account will be deleted in <span
|
||||
id=\"timer1\">".$time."</span> .</a></td><br />";
|
||||
|
||||
$time = $generator->getTimeFormat(($timestamp - time()));
|
||||
echo "<a href=\"spieler.php?s=3\"> The account will be deleted in <span
|
||||
id=\"timer" . ++$session->timer . "\">" . $time . "</span> .</a></td><br />";
|
||||
}
|
||||
?>
|
||||
</div><?php
|
||||
|
||||
+7
-21
@@ -20,13 +20,7 @@ if($aantal > 0){
|
||||
echo '<table id="movements" cellpadding="1" cellspacing="1"><thead><tr><th colspan="3">'.TROOP_MOVEMENTS.'</th></tr></thead><tbody>';
|
||||
}
|
||||
|
||||
$NextArrival = array();
|
||||
$NextArrival1 = array();
|
||||
$NextArrival2 = array();
|
||||
$NextArrival3 = array();
|
||||
$NextArrival4 = array();
|
||||
$NextArrival5 = array();
|
||||
$NextArrival6 = array();
|
||||
$NextArrival = $NextArrival1 = $NextArrival2 = $NextArrival3 = $NextArrival4 = $NextArrival5 = $NextArrival6 = [];
|
||||
|
||||
/* Units coming back from Reinf,attack,raid,evasion or reinf to my town */
|
||||
$aantal = count($database->getMovement(4,$village->wid,1))+count($database->getMovement(7,$village->wid,1));
|
||||
@@ -64,8 +58,7 @@ if($aantal > 0){
|
||||
}
|
||||
}
|
||||
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;
|
||||
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.' '.$short.'</span></div><div class="dur_r">in <span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
}
|
||||
|
||||
/* attack/raid on you! */
|
||||
@@ -89,8 +82,7 @@ if($aantal > 0){
|
||||
}
|
||||
}
|
||||
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($NextArrival1)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
$timer += 1;
|
||||
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.' '.$short.'</span></div><div class="dur_r">in <span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival1)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
}
|
||||
|
||||
/* on attack, raid */
|
||||
@@ -112,8 +104,7 @@ if($aantal > 0){
|
||||
}
|
||||
}
|
||||
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($NextArrival2)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
$timer += 1;
|
||||
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.' '.$short.'</span></div><div class="dur_r">in <span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival2)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
}
|
||||
|
||||
/* Units send to reinf. (to other town) */
|
||||
@@ -135,8 +126,7 @@ if($lala > 0){
|
||||
}
|
||||
}
|
||||
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.'">'.$lala.' '.$short.'</span></div><div class="dur_r">in <span id="timer'.$timer.'">'.$generator->getTimeFormat(min($NextArrival3)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
$timer += 1;
|
||||
<td><div class="mov"><span class="'.$aclass.'">'.$lala.' '.$short.'</span></div><div class="dur_r">in <span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival3)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
}
|
||||
|
||||
/* Found NEW VILLAGE by Shadow */
|
||||
@@ -154,9 +144,7 @@ if($aantal > 0){
|
||||
}
|
||||
|
||||
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($NextArrival5)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
$timer += 1;
|
||||
|
||||
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.' '.$short.'</span></div><div class="dur_r">in <span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival5)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
}
|
||||
|
||||
/* Attacks on Oasis (to my oasis) by Shadow */
|
||||
@@ -186,7 +174,5 @@ if($aantal > 0){
|
||||
}
|
||||
|
||||
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($NextArrival6)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
$timer += 1;
|
||||
|
||||
<td><div class="mov"><span class="'.$aclass.'">'.$aantal.' '.$short.'</span></div><div class="dur_r">in <span id="timer'.++$session->timer.'">'.$generator->getTimeFormat(min($NextArrival6)-time()).'</span> '.HOURS.'</div></div></td></tr>';
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
$time = time();
|
||||
$artifactsSpawn = (COMMENCE + NATARS_SPAWN_TIME * 86400) - $time;
|
||||
$wwSpawn = (COMMENCE + NATARS_WW_SPAWN_TIME * 86400) - $time;
|
||||
$wwBuildingPlansSpawn = (COMMENCE + NATARS_WW_BUILDING_PLAN_SPAWN_TIME * 86400) - $time;
|
||||
$daysToDisplay = 432000 / SPEED; //5 days / SPEED of the server
|
||||
|
||||
if($artifactsSpawn <= $daysToDisplay && $artifactsSpawn > 0){
|
||||
?>
|
||||
<br /><br />
|
||||
<div>
|
||||
<span><b>Artifacts</b> will spawn in: </span>
|
||||
<span id="timer<?php echo ++$session->timer; ?>"><?php echo $generator->getTimeFormat($artifactsSpawn); ?></span>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
if($wwSpawn <= $daysToDisplay && $wwSpawn > 0){
|
||||
?>
|
||||
<br /><br />
|
||||
<div>
|
||||
<span><b>WW villages</b> will spawn in: </span>
|
||||
<span id="timer<?php echo ++$session->timer; ?>"><?php echo $generator->getTimeFormat($wwSpawn); ?></span>
|
||||
</div>
|
||||
<?php }
|
||||
|
||||
if($wwBuildingPlansSpawn <= $daysToDisplay && $wwBuildingPlansSpawn > 0){ ?>
|
||||
<br /><br />
|
||||
<div>
|
||||
<span><b>WW building plans</b> will spawn in: </span>
|
||||
<span id="timer<?php echo ++$session->timer; ?>"><?php echo $generator->getTimeFormat($wwBuildingPlansSpawn); ?></span>
|
||||
</div>
|
||||
<?php } ?>
|
||||
+42
-449
@@ -93,466 +93,59 @@ AccessLogger::logRequest();
|
||||
/**
|
||||
* Functions
|
||||
*/
|
||||
if(isset($_POST['password']) && $_POST['password'] != ""){
|
||||
function generateBase($kid, $uid, $username) {
|
||||
global $database, $message;
|
||||
if($kid == 0) {
|
||||
$kid = rand(1, 4);
|
||||
} else {
|
||||
$kid = (isset($_POST['kid']) ? $_POST['kid'] : '');
|
||||
}
|
||||
|
||||
$wid = $database->generateBase($kid);
|
||||
$database->setFieldTaken($wid);
|
||||
$database->addVillage($wid, $uid, $username, 1);
|
||||
$database->addResourceFields($wid, $database->getVillageType($wid));
|
||||
$database->addUnits($wid);
|
||||
$database->addTech($wid);
|
||||
$database->addABTech($wid);
|
||||
$database->updateUserField($uid, "access", USER, 1);
|
||||
$message->sendWelcome($uid, $username);
|
||||
}
|
||||
if(!User::exists($database, 'Natars')){
|
||||
|
||||
/**
|
||||
* Creating account & capital village - Fixed by Shadow - cata7007@gmail.com / Skype : cata7007
|
||||
* Creating account & capital village - Fixed by Shadow - cata7007@gmail.com / Skype : cata7007 - reworked by iopietro
|
||||
*/
|
||||
|
||||
$username = "Natars";
|
||||
$password = password_hash($_POST['password'], PASSWORD_BCRYPT,['cost' => 12]);
|
||||
$email = "natars@noreply.com";
|
||||
$tribe = 5;
|
||||
$desc = "***************************
|
||||
[#natars]
|
||||
***************************";
|
||||
$database->createNatars();
|
||||
|
||||
$q = "INSERT INTO " . TB_PREFIX . "users (id,username,password,access,email,timestamp,tribe,location,act,protect) VALUES (3, '$username', '$password', " . USER . ", '$email', ".time().", $tribe, '', '', 0)";
|
||||
mysqli_query($database->dblink,$q);
|
||||
unset($q);
|
||||
$uid = $database->getUserField($username, 'id', 1);
|
||||
$arrayXY=array();
|
||||
$arrayXY=array
|
||||
(
|
||||
array(WORLD_MAX, WORLD_MAX),
|
||||
array(WORLD_MAX, -WORLD_MAX),
|
||||
array(-WORLD_MAX, -WORLD_MAX),
|
||||
array(WORLD_MAX-1, WORLD_MAX),
|
||||
array(WORLD_MAX, WORLD_MAX-1),
|
||||
array(-WORLD_MAX, WORLD_MAX-1),
|
||||
array(WORLD_MAX-1, -WORLD_MAX),
|
||||
array(WORLD_MAX-1, WORLD_MAX-1),
|
||||
array(WORLD_MAX, -WORLD_MAX+1),
|
||||
array(WORLD_MAX-1, -WORLD_MAX+1),
|
||||
array(-WORLD_MAX+1, -WORLD_MAX+1),
|
||||
array(WORLD_MAX-2, WORLD_MAX),
|
||||
array(WORLD_MAX-2, -WORLD_MAX),
|
||||
array(WORLD_MAX-2, WORLD_MAX-1),
|
||||
array(WORLD_MAX-1, WORLD_MAX-2),
|
||||
array(-WORLD_MAX+2, WORLD_MAX),
|
||||
array(-WORLD_MAX+2, WORLD_MAX-1),
|
||||
array(-WORLD_MAX+2, -WORLD_MAX+2)
|
||||
);
|
||||
$status=0;
|
||||
$i=0;
|
||||
while ($i<=17) {
|
||||
$wid = $database->getVilWref($arrayXY[$i][0],$arrayXY[$i][1]);
|
||||
$status = $database->getVillageState($wid);
|
||||
$i++;
|
||||
if ($status==0) break;
|
||||
}
|
||||
if($status != 0) { //have taken then random
|
||||
generateBase(0, $uid, $username);
|
||||
$status = 1;
|
||||
}
|
||||
if($status == 0) {
|
||||
$database->setFieldTaken($wid);
|
||||
$database->addVillage($wid, $uid, $username, 1);
|
||||
$database->addResourceFields($wid, $database->getVillageType($wid));
|
||||
$database->addUnits($wid);
|
||||
$database->addTech($wid);
|
||||
$database->addABTech($wid);
|
||||
$database->updateUserField($uid, "access", USER, 1);
|
||||
}
|
||||
|
||||
$wid = $database->getVillage($uid, 2);
|
||||
$q = "UPDATE " . TB_PREFIX . "vdata SET pop = 834 WHERE owner = ".(int) $uid;
|
||||
mysqli_query($database->dblink,$q) or die(mysqli_error($database->dblink));
|
||||
$q2 = "UPDATE " . TB_PREFIX . "users SET access = 2 WHERE id = ".(int) $uid;
|
||||
mysqli_query($database->dblink,$q2) or die(mysqli_error($database->dblink));
|
||||
if(SPEED > 3) {
|
||||
$speed = 5;
|
||||
} else {
|
||||
$speed = SPEED;
|
||||
}
|
||||
$q3 = "UPDATE " . TB_PREFIX . "units SET u41 = " . (64700 * $speed) . ", u42 = " . (295231 * $speed) . ", u43 = " . (180747 * $speed) . ", u44 = " . (20000 * $speed) . ", u45 = " . (364401 * $speed) . ", u46 = " . (217602 * $speed) . ", u47 = " . (2034 * $speed) . ", u48 = " . (1040 * $speed) . " , u49 = " . (1 * $speed) . ", u50 = " . (9 * $speed) . " WHERE vref = " . (int) $wid['wref'] . "";
|
||||
mysqli_query($database->dblink,$q3) or die(mysqli_error($database->dblink));
|
||||
$q4 = "UPDATE " . TB_PREFIX . "users SET desc2 = '$desc' WHERE id = ".(int) $uid;
|
||||
mysqli_query($database->dblink,$q4) or die(mysqli_error($database->dblink));
|
||||
|
||||
/**
|
||||
* SCOUTING ALL PLAYERS FIX BY MisterX
|
||||
*/
|
||||
$natar = $database->getVillage($uid, 3);
|
||||
$multiplier = NATARS_UNITS;
|
||||
$array = $database->getProfileVillages(0, 1);
|
||||
$sendspytroops = 1500 * $multiplier;
|
||||
$refs = [];
|
||||
$vils = [];
|
||||
foreach($array as $vill){
|
||||
$refs[] = $database->addAttack($natar['wref'], 0, 0, 0, $sendspytroops, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 20, 0, 0, 0, 0);
|
||||
$vils[] = $vill['wref'];
|
||||
}
|
||||
|
||||
$type = [];
|
||||
$from = [];
|
||||
$to = [];
|
||||
$ref = [];
|
||||
$time = [];
|
||||
$timeValue = time();
|
||||
$endtime = [];
|
||||
$endtimeValue = $timeValue + 10000;
|
||||
$counter = 0;
|
||||
|
||||
foreach ($refs as $index => $refID) {
|
||||
$type[] = 3;
|
||||
$from[] = $natar['wref'];
|
||||
$to[] = $vils[$index];
|
||||
$ref[] = $refID;
|
||||
$time[] = $timeValue;
|
||||
$endtime[] = $endtimeValue;
|
||||
|
||||
// limit the insert, so it can push through any reasonable network limits imposed
|
||||
if (++$counter > 25) {
|
||||
$database->addMovement($type, $from, $to, $ref, $time, $endtime);
|
||||
|
||||
$type = [];
|
||||
$from = [];
|
||||
$to = [];
|
||||
$ref = [];
|
||||
$time = [];
|
||||
$endtime = [];
|
||||
$counter = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if ($counter > 0) $database->addMovement($type, $from, $to, $ref, $time, $endtime);
|
||||
|
||||
/**
|
||||
* SMALL ARTEFACTS
|
||||
*/
|
||||
function Artefact($uid, $type, $size, $art_name, $village_name, $desc, $effect, $img) {
|
||||
global $database;
|
||||
$kid = rand(1, 4);
|
||||
$wid = $database->generateBase($kid, 1);
|
||||
$database->addArtefact($wid, $uid, $type, $size, $art_name, $desc, $effect, $img);
|
||||
$database->setFieldTaken($wid);
|
||||
$database->addVillage($wid, $uid, $village_name, '0');
|
||||
$database->addResourceFields($wid, $database->getVillageType($wid));
|
||||
$database->addUnits($wid);
|
||||
$database->addTech($wid);
|
||||
$database->addABTech($wid);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "vdata SET pop = 163 WHERE wref = ".(int) $wid);
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "vdata SET name = '$village_name' WHERE wref = ".(int) $wid);
|
||||
if(SPEED > 3) {
|
||||
$speed = 5;
|
||||
} else {
|
||||
$speed = SPEED;
|
||||
}
|
||||
if($size == 1) {
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(1000, 2000) * $speed) . ", u42 = " . (rand(1500, 2000) * $speed) . ", u43 = " . (rand(2300, 2800) * $speed) . ", u44 = " . (rand(25, 75) * $speed) . ", u45 = " . (rand(1200, 1900) * $speed) . ", u46 = " . (rand(1500, 2000) * $speed) . ", u47 = " . (rand(500, 900) * $speed) . ", u48 = " . (rand(100, 300) * $speed) . " , u49 = " . (rand(1, 5) * $speed) . ", u50 = " . (rand(1, 5) * $speed) . " WHERE vref = " . (int) $wid . "");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 10, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = ".(int) $wid);
|
||||
} elseif($size == 2) {
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(2000, 4000) * $speed) . ", u42 = " . (rand(3000, 4000) * $speed) . ", u43 = " . (rand(4600, 5600) * $speed) . ", u44 = " . (rand(50, 150) * $speed) . ", u45 = " . (rand(2400, 3800) * $speed) . ", u46 = " . (rand(3000, 4000) * $speed) . ", u47 = " . (rand(1000, 1800) * $speed) . ", u48 = " . (rand(200, 600) * $speed) . " , u49 = " . (rand(2, 10) * $speed) . ", u50 = " . (rand(2, 10) * $speed) . " WHERE vref = " . (int) $wid . "");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 20, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = ".(int) $wid);
|
||||
} elseif($size == 3) {
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "units SET u41 = " . (rand(4000, 8000) * $speed) . ", u42 = " . (rand(6000, 8000) * $speed) . ", u43 = " . (rand(9200, 11200) * $speed) . ", u44 = " . (rand(100, 300) * $speed) . ", u45 = " . (rand(4800, 7600) * $speed) . ", u46 = " . (rand(6000, 8000) * $speed) . ", u47 = " . (rand(2000, 3600) * $speed) . ", u48 = " . (rand(400, 1200) * $speed) . " , u49 = " . (rand(4, 20) * $speed) . ", u50 = " . (rand(4, 20) * $speed) . " WHERE vref = " . (int) $wid . "");
|
||||
mysqli_query($database->dblink,"UPDATE " . TB_PREFIX . "fdata SET f22t = 27, f22 = 10, f28t = 25, f28 = 20, f19t = 23, f19 = 10, f32t = 23, f32 = 10 WHERE vref = ".(int) $wid);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* THE ARCHITECTS
|
||||
*/
|
||||
|
||||
$desc = ARCHITECTS_DESC;
|
||||
|
||||
|
||||
$vname = ARCHITECTS_SMALLVILLAGE;
|
||||
$effect = '(4x)';
|
||||
for($i = 0; $i < 6; $i++) {
|
||||
Artefact($uid, 1, 1, ARCHITECTS_SMALL, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type2.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = ARCHITECTS_LARGEVILLAGE;
|
||||
$effect = '(3x)';
|
||||
for($i = 0; $i < 4; $i++) {
|
||||
Artefact($uid, 1, 2, ARCHITECTS_LARGE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type2.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = ARCHITECTS_UNIQUEVILLAGE;
|
||||
$effect = '(5x)';
|
||||
for($i = 0; $i < 1; $i++) {
|
||||
Artefact($uid, 1, 3, ARCHITECTS_UNIQUE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type2.gif');
|
||||
}
|
||||
|
||||
/**
|
||||
* MILITARY HASTE
|
||||
*/
|
||||
|
||||
|
||||
$desc = HASTE_DESC;
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = HASTE_SMALLVILLAGE;
|
||||
$effect = '(2x)';
|
||||
for($i = 0; $i < 6; $i++) {
|
||||
Artefact($uid, 2, 1, HASTE_SMALL, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type4.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = HASTE_LARGEVILLAGE;
|
||||
$effect = '(1.5x)';
|
||||
for($i = 0; $i < 4; $i++) {
|
||||
Artefact($uid, 2, 2, HASTE_LARGE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type4.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = HASTE_UNIQUEVILLAGE;
|
||||
$effect = '(3x)';
|
||||
for($i = 0; $i < 1; $i++) {
|
||||
Artefact($uid, 2, 3, HASTE_UNIQUE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type4.gif');
|
||||
}
|
||||
|
||||
/**
|
||||
* HAWK'S EYESIGHT
|
||||
*/
|
||||
|
||||
|
||||
$desc = EYESIGHT_DESC;
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = EYESIGHT_SMALLVILLAGE;
|
||||
$effect = '(5x)';
|
||||
for($i = 0; $i < 6; $i++) {
|
||||
Artefact($uid, 3, 1, EYESIGHT_SMALL, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type5.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = EYESIGHT_LARGEVILLAGE;
|
||||
$effect = '(3x)';
|
||||
for($i = 0; $i < 4; $i++) {
|
||||
Artefact($uid, 3, 2, EYESIGHT_LARGE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type5.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = EYESIGHT_UNIQUEVILLAGE;
|
||||
$effect = '(10x)';
|
||||
for($i = 0; $i < 1; $i++) {
|
||||
Artefact($uid, 3, 3, EYESIGHT_UNIQUE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type5.gif');
|
||||
}
|
||||
|
||||
/**
|
||||
* THE DIET
|
||||
*/
|
||||
|
||||
|
||||
$desc = DIET_DESC;
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = DIET_SMALLVILLAGE;
|
||||
$effect = '(50%)';
|
||||
for($i = 0; $i < 6; $i++) {
|
||||
Artefact($uid, 4, 1, DIET_SMALL, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type6.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = DIET_LARGEVILLAGE;
|
||||
$effect = '(25%)';
|
||||
for($i = 0; $i < 4; $i++) {
|
||||
Artefact($uid, 4, 2, DIET_LARGE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type6.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = DIET_UNIQUEVILLAGE;
|
||||
$effect = '(50%)';
|
||||
for($i = 0; $i < 1; $i++) {
|
||||
Artefact($uid, 4, 3, DIET_UNIQUE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type6.gif');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ACADEMIC ADVANCEMENT
|
||||
*/
|
||||
|
||||
|
||||
$desc = ACADEMIC_DESC;
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = ACADEMIC_SMALLVILLAGE;
|
||||
$effect = '(50%)';
|
||||
for($i = 0; $i < 6; $i++) {
|
||||
Artefact($uid, 5, 1, ACADEMIC_SMALL, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type8.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = ACADEMIC_LARGEVILLAGE;
|
||||
$effect = '(25%)';
|
||||
for($i = 0; $i < 4; $i++) {
|
||||
Artefact($uid, 5, 2, ACADEMIC_LARGE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type8.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = ACADEMIC_UNIQUEVILLAGE;
|
||||
$effect = '(50%)';
|
||||
for($i = 0; $i < 1; $i++) {
|
||||
Artefact($uid, 5, 3, ACADEMIC_UNIQUE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type8.gif');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* STORAGE MASTER PLAN
|
||||
*/
|
||||
|
||||
|
||||
$desc = STORAGE_DESC;
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);;
|
||||
$vname = STORAGE_SMALLVILLAGE;
|
||||
$effect = '(GG&GW)';
|
||||
for($i = 0; $i < 6; $i++) {
|
||||
Artefact($uid, 6, 1, STORAGE_SMALL, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type9.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = STORAGE_LARGEVILLAGE;
|
||||
$effect = '(GG&GW)';
|
||||
for($i = 0; $i < 4; $i++) {
|
||||
Artefact($uid, 6, 2, STORAGE_LARGE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type9.gif');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* RIVAL'S CONFUSION
|
||||
*/
|
||||
|
||||
|
||||
$desc = CONFUSION_DESC;
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = CONFUSION_SMALLVILLAGE;
|
||||
$effect = '(200)';
|
||||
for($i = 0; $i < 6; $i++) {
|
||||
Artefact($uid, 7, 1, CONFUSION_SMALL, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type10.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = CONFUSION_LARGEVILLAGE;
|
||||
$effect = '(100)';
|
||||
for($i = 0; $i < 4; $i++) {
|
||||
Artefact($uid, 7, 2, CONFUSION_LARGE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type10.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = CONFUSION_UNIQUEVILLAGE;
|
||||
$effect = '(500)';
|
||||
for($i = 0; $i < 1; $i++) {
|
||||
Artefact($uid, 7, 3, CONFUSION_UNIQUE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'type10.gif');
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ARTEFACT OF THE FOOL
|
||||
*/
|
||||
|
||||
|
||||
$desc = FOOL_DESC;
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = FOOL_SMALLVILLAGE;
|
||||
$effect = '';
|
||||
for($i = 0; $i < 5; $i++) {
|
||||
Artefact($uid, 8, 1, FOOL_SMALL, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'typefool.gif');
|
||||
}
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = FOOL_UNIQUEVILLAGE;
|
||||
$effect = '';
|
||||
for($i = 0; $i < 1; $i++) {
|
||||
Artefact($uid, 8, 3, FOOL_UNIQUE, '' . $vname . '', '' . $desc . '', '' . $effect . '', 'typefool.gif');
|
||||
}
|
||||
$artifactArrays = [ARCHITECTS_DESC => [["type" => 1, "size" => 1, "name" => ARCHITECTS_SMALL, "vname" => ARCHITECTS_SMALLVILLAGE, "effect" => "(4x)", "quantity" => 6, "img" => 2],
|
||||
["type" => 1, "size" => 2, "name" => ARCHITECTS_LARGE, "vname" => ARCHITECTS_LARGEVILLAGE, "effect" => "(3x)", "quantity" => 4, "img" => 2],
|
||||
["type" => 1, "size" => 3, "name" => ARCHITECTS_UNIQUE,"vname" => ARCHITECTS_UNIQUEVILLAGE, "effect" => "(5x)", "quantity" => 1, "img" => 2]],
|
||||
|
||||
HASTE_DESC => [["type" => 2, "size" => 1, "name" => HASTE_SMALL, "vname" => HASTE_SMALLVILLAGE, "effect" => "(2x)", "quantity" => 6, "img" => 4],
|
||||
["type" => 2, "size" => 2, "name" => HASTE_LARGE, "vname" => HASTE_LARGEVILLAGE, "effect" => "(1.5x)", "quantity" => 4, "img" => 4],
|
||||
["type" => 2, "size" => 3, "name" => HASTE_UNIQUE, "vname" => HASTE_UNIQUEVILLAGE, "effect" => "(3x)", "quantity" => 1, "img" => 4]],
|
||||
|
||||
EYESIGHT_DESC => [["type" => 3, "size" => 1, "name" => EYESIGHT_SMALL, "vname" => EYESIGHT_SMALLVILLAGE, "effect" => "(5x)", "quantity" => 6, "img" => 5],
|
||||
["type" => 3, "size" => 2, "name" => EYESIGHT_LARGE, "vname" => EYESIGHT_LARGEVILLAGE, "effect" => "(3x)", "quantity" => 4, "img" => 5],
|
||||
["type" => 3, "size" => 3, "name" => EYESIGHT_UNIQUE, "vname" => EYESIGHT_UNIQUEVILLAGE, "effect" => "(10x)", "quantity" => 1, "img" => 5]],
|
||||
|
||||
DIET_DESC => [["type" => 4, "size" => 1, "name" => DIET_SMALL, "vname" => DIET_SMALLVILLAGE, "effect" => "(50%)", "quantity" => 6, "img" => 6],
|
||||
["type" => 4, "size" => 2, "name" => DIET_LARGE, "vname" => DIET_LARGEVILLAGE, "effect" => "(25%)", "quantity" => 4, "img" => 6],
|
||||
["type" => 4, "size" => 3, "name" => DIET_UNIQUE, "vname" => DIET_UNIQUEVILLAGE, "effect" => "(50%)", "quantity" => 1, "img" => 6]],
|
||||
|
||||
ACADEMIC_DESC => [["type" => 5, "size" => 1, "name" => ACADEMIC_SMALL, "vname" => ACADEMIC_SMALLVILLAGE, "effect" => "(50%)", "quantity" => 6, "img" => 8],
|
||||
["type" => 5, "size" => 2, "name" => ACADEMIC_LARGE, "vname" => ACADEMIC_LARGEVILLAGE, "effect" => "(25%)", "quantity" => 4, "img" => 8],
|
||||
["type" => 5, "size" => 3, "name" => ACADEMIC_UNIQUE, "vname" => ACADEMIC_UNIQUEVILLAGE, "effect" => "(50%)", "quantity" => 1, "img" => 8]],
|
||||
|
||||
STORAGE_DESC => [["type" => 6, "size" => 1, "name" => STORAGE_SMALL, "vname" => STORAGE_SMALLVILLAGE, "effect" => "(50%)", "quantity" => 6, "img" => 9],
|
||||
["type" => 6, "size" => 2, "name" => STORAGE_LARGE, "vname" => STORAGE_LARGEVILLAGE, "effect" => "(25%)", "quantity" => 4, "img" => 9]],
|
||||
|
||||
CONFUSION_DESC => [["type" => 7, "size" => 1, "name" => CONFUSION_SMALL, "vname" => CONFUSION_SMALLVILLAGE, "effect" => "(200)", "quantity" => 6, "img" => 10],
|
||||
["type" => 7, "size" => 2, "name" => CONFUSION_LARGE, "vname" => CONFUSION_LARGEVILLAGE, "effect" => "(100)", "quantity" => 4, "img" => 10],
|
||||
["type" => 7, "size" => 3, "name" => CONFUSION_UNIQUE, "vname" => CONFUSION_UNIQUEVILLAGE, "effect" => "(500)", "quantity" => 1, "img" => 10]],
|
||||
|
||||
FOOL_DESC => [["type" => 8, "size" => 1, "name" => FOOL_SMALL, "vname" => FOOL_SMALLVILLAGE, "effect" => "", "quantity" => 5, "img" => "fool"],
|
||||
["type" => 8, "size" => 3, "name" => FOOL_UNIQUE, "vname" => FOOL_UNIQUEVILLAGE, "effect" => "", "quantity" => 1, "img" => "fool"]]];
|
||||
|
||||
$myFile = "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 = preg_replace("'%TEKST%'",ARTEFACT ,$text);
|
||||
fwrite($fh, $text);
|
||||
|
||||
$query = "UPDATE ".TB_PREFIX."users SET ok = 1";
|
||||
echo "Done";
|
||||
}elseif(User::exists($database, 'Natars')) {
|
||||
//Add artefacts and their villages
|
||||
$database->addArtifactVillages($artifactArrays);
|
||||
|
||||
//Write the system message
|
||||
$database->displaySystemMessage(ARTEFACT);
|
||||
|
||||
echo '<p><span class=\"c2\">Done: Natars created and artifacts spawned!</span></p>';
|
||||
}else{
|
||||
?>
|
||||
<p>
|
||||
<span class="c2">Error: Natar account already exist</span>
|
||||
<span class="c2">Error: Natar account already exists</span>
|
||||
</p>
|
||||
<?php
|
||||
}else {
|
||||
}
|
||||
?>
|
||||
<form action="create_account.php" method="post">
|
||||
|
||||
<p>
|
||||
<span>Choose Password</span>
|
||||
</p>
|
||||
<table>
|
||||
<tr><td>Password:</td><td><input type="password" name="password" value="" /></td></tr>
|
||||
</table>
|
||||
|
||||
<div style="text-align: center">
|
||||
<input type="submit" name="Submit" id="Submit" value="Submit" /></div>
|
||||
</form>
|
||||
<?php } ?>
|
||||
</div>
|
||||
<br /><br /><br /><br /><div id="side_info">
|
||||
<?php
|
||||
|
||||
@@ -116,9 +116,24 @@ define("SHOW_NATARS",%SHOW_NATARS%);
|
||||
// ***** Natars Units Multiplier
|
||||
define("NATARS_UNITS",%NATARS_UNITS%);
|
||||
|
||||
// ***** Natars Spawn Time
|
||||
define("NATARS_SPAWN_TIME",%NATARS_SPAWN_TIME%);
|
||||
define("NATARS_WW_SPAWN_TIME",%NATARS_WW_SPAWN_TIME%);
|
||||
define("NATARS_WW_BUILDING_PLAN_SPAWN_TIME",%NATARS_WW_BUILDING_PLAN_SPAWN_TIME%);
|
||||
|
||||
// ***** Nature troops regeneration time
|
||||
define("NATURE_REGTIME",%NATURE_REGTIME%);
|
||||
|
||||
// ***** Oasis production
|
||||
define("OASIS_WOOD_MULTIPLIER",%OASIS_WOOD_MULTIPLIER%);
|
||||
define("OASIS_CLAY_MULTIPLIER",%OASIS_CLAY_MULTIPLIER%);
|
||||
define("OASIS_IRON_MULTIPLIER",%OASIS_IRON_MULTIPLIER%);
|
||||
define("OASIS_CROP_MULTIPLIER",%OASIS_CROP_MULTIPLIER%);
|
||||
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);
|
||||
|
||||
// ***** Enable T4 is Coming screen
|
||||
define("T4_COMING",%T4_COMING%);
|
||||
|
||||
|
||||
@@ -130,7 +130,14 @@ class Process {
|
||||
$findReplace["%WW%"] = $_POST['ww'];
|
||||
$findReplace["%SHOW_NATARS%"] = $_POST['show_natars'];
|
||||
$findReplace["%NATARS_UNITS%"] = $_POST['natars_units'];
|
||||
$findReplace["%NATARS_SPAWN_TIME%"] = $_POST['natars_spawn_time'];
|
||||
$findReplace["%NATARS_WW_SPAWN_TIME%"] = $_POST['natars_ww_spawn_time'];
|
||||
$findReplace["%NATARS_WW_BUILDING_PLAN_SPAWN_TIME%"] = $_POST['natars_ww_building_plan_spawn_time'];
|
||||
$findReplace["%NATURE_REGTIME%"] = $_POST['nature_regtime'];
|
||||
$findReplace["%OASIS_WOOD_MULTIPLIER%"] = $_POST['oasis_wood_multiplier'];
|
||||
$findReplace["%OASIS_CLAY_MULTIPLIER%"] = $_POST['oasis_clay_multiplier'];
|
||||
$findReplace["%OASIS_IRON_MULTIPLIER%"] = $_POST['oasis_iron_multiplier'];
|
||||
$findReplace["%OASIS_CROP_MULTIPLIER%"] = $_POST['oasis_crop_multiplier'];
|
||||
$findReplace["%T4_COMING%"] = $_POST['t4_coming'];
|
||||
$findReplace["%REG_OPEN%"] = $_POST['reg_open'];
|
||||
$findReplace["%PEACE%"] = $_POST['peace'];
|
||||
|
||||
@@ -95,7 +95,19 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Natars Units Multiplier:</span></td>
|
||||
<td width="140"><input type="text" name="natars_units" id="natars_units" value="100" size="3"></td>
|
||||
<td width="140"><input type="text" name="natars_units" id="natars_units" value="100" size="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Natars Spawn (Days):</span></td>
|
||||
<td width="140"><input type="text" name="natars_spawn_time" id="natars_spawn_time" value="260" size="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">WW building plan spawn (Days):</span></td>
|
||||
<td width="140"><input type="text" name="natars_ww_spawn_time" id="natars_ww_spawn_time" value="260" size="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">WW spawn (Days):</span></td>
|
||||
<td width="140"><input type="text" name="natars_ww_building_plan_spawn_time" id="natars_ww_building_plan_spawn_time" value="260" size="3"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">World size:</span></td>
|
||||
@@ -177,6 +189,22 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Oasis wood production multiplier:</span></td>
|
||||
<td width="140"><input type="text" name="oasis_wood_multiplier" id="oasis_wood_multiplier" value="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Oasis clay production multiplier:</span></td>
|
||||
<td width="140"><input type="text" name="oasis_clay_multiplier" id="oasis_clay_multiplier" value="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Oasis iron production multiplier:</span></td>
|
||||
<td width="140"><input type="text" name="oasis_iron_multiplier" id="oasis_iron_multiplier" value="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><span class="f9 c6">Oasis crop production multiplier:</span></td>
|
||||
<td width="140"><input type="text" name="oasis_crop_multiplier" id="oasis_crop_multiplier" value="40"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<tr class="hover">
|
||||
<td><span class="f9 c6">Medal Interval:</span></td>
|
||||
|
||||
Reference in New Issue
Block a user