mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-22 12:36:09 +00:00
now you cannot build WW without building plan (did not tested, but should to work)
This commit is contained in:
@@ -33,6 +33,13 @@ for($i=1;$i<=$amt;$i++) {
|
||||
$database->addABTech($wid);
|
||||
$q = "UPDATE ".TB_PREFIX."units SET u41 = u41 + '150000', u42 = u42 + '150000', u43 = u43 + '150000', u44 = u44 + '150000', u45 = u45 + '150000', u46 = u46 + '150000', u47 = u47 + '150000', u48 = u48 + '150000' , u49 = u49 + '150000', u50 = u50 + '150000' WHERE vref = '".$wid."'";
|
||||
mysql_query($q);
|
||||
$desc = 'With this ancient construction plan you will able to build World Wonder to level 50. to build further, your alliance must hold at least two plans.';
|
||||
|
||||
unset($i);
|
||||
unset($vname);
|
||||
unset($effect);
|
||||
$vname = 'Ancient Construction Plan';
|
||||
$database->addArtefact($wid, 3, 11, 3, 'Ancient Construction Plan', $desc, 0, 'typeww.gif');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ for($i=1;$i<=$amt;$i++) {
|
||||
$time = time();
|
||||
$q = "insert into `s1_vdata`(`wref`,`owner`,`name`,`capital`,`pop`,`cp`,`celebration`,`type`,`wood`,`clay`,`iron`,`maxstore`,`crop`,`maxcrop`,`lastupdate`,`loyalty`,`exp1`,`exp2`,`exp3`,`created`,`natar`) values ('$wid','3','WW village',0,233,232,0,0,80000.00,80000.00,80000.00,80000,80000.00,80000,1314974534,100,0,0,0,$time,1)";
|
||||
mysql_query($q) or die(mysql_error());
|
||||
$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,1,40,'World Wonder')";
|
||||
$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,0,'World Wonder')";
|
||||
mysql_query($q);
|
||||
$database->addUnits($wid);
|
||||
$database->addTech($wid);
|
||||
|
||||
@@ -118,7 +118,6 @@ class Automation {
|
||||
$this->oasisResoucesProduce();
|
||||
$this->pruneResource();
|
||||
$this->pruneOResource();
|
||||
$this->MasterBuilder();
|
||||
if(!file_exists("GameEngine/Prevention/culturepoints.txt") or time()-filemtime("GameEngine/Prevention/culturepoints.txt")>10) {
|
||||
$this->culturePoints();
|
||||
}
|
||||
@@ -165,6 +164,7 @@ class Automation {
|
||||
$this->demolitionComplete();
|
||||
}
|
||||
$this->updateStore();
|
||||
$this->MasterBuilder();
|
||||
}
|
||||
|
||||
function activeCropDead(){
|
||||
@@ -2928,7 +2928,8 @@ private function demolitionComplete() {
|
||||
}else{
|
||||
$inbuild = 1;
|
||||
}
|
||||
if($bdata < $inbuild && $buildwood < $villwood && $buildclay < $villclay && $buildiron < $villiron && $buildcrop < $villcrop){
|
||||
$usergold = $database->getUserField($owner,'gold',0);
|
||||
if($bdata < $inbuild && $buildwood < $villwood && $buildclay < $villclay && $buildiron < $villiron && $buildcrop < $villcrop && $usergold > 0){
|
||||
$time = $master['timestamp']+time();
|
||||
if(!empty($bdata1)){
|
||||
foreach($bdata1 as $master1) {
|
||||
@@ -2940,7 +2941,6 @@ private function demolitionComplete() {
|
||||
}else{
|
||||
$database->updateBuildingWithMaster($master['id'],$time,1);
|
||||
}
|
||||
$usergold = $database->getUserField($owner,'gold',0);
|
||||
$gold = $usergold-1;
|
||||
$database->updateUserField($owner,'gold',$gold,1);
|
||||
$database->modifyResource($master['wid'],$buildwood,$buildclay,$buildiron,$buildcrop,0);
|
||||
|
||||
@@ -64,7 +64,9 @@ class Building {
|
||||
return 10;
|
||||
} else if($this->isMax($tid,$id,2) && $this->isLoop($id) && $this->isCurrent($id)) {
|
||||
return 10;
|
||||
}
|
||||
} else if($this->isMax($tid,$id,3) && $this->isLoop($id) && $this->isCurrent($id) && count($database->getMasterJobs($village->wid)) > 0) {
|
||||
return 10;
|
||||
}
|
||||
else {
|
||||
if($this->allocated <= $this->maxConcurrent) {
|
||||
$resRequired = $this->resourceRequired($id,$village->resarray['f'.$id.'t']);
|
||||
@@ -392,7 +394,7 @@ class Building {
|
||||
}
|
||||
|
||||
private function meetRequirement($id) {
|
||||
global $village;
|
||||
global $village,$database;
|
||||
switch($id) {
|
||||
case 1:
|
||||
case 2:
|
||||
@@ -491,8 +493,8 @@ class Building {
|
||||
if($this->getTypeLevel(15) >= 10 && $village->capital == 0) { return true; } else { return false; }
|
||||
break;
|
||||
case 40:
|
||||
//need to check if have ww buildplan too
|
||||
if($village->natar == 1) { return true; } else { return false; }
|
||||
$wwbuildingplan = count($database->getOwnArtefactInfoByType2($village->wid,11));
|
||||
if($village->natar == 1 && $wwbuildingplan > 0) { return true; } else { return false; }
|
||||
break;
|
||||
case 41:
|
||||
if($this->getTypeLevel(16) >= 10 && $this->getTypeLevel(20) == 20) { return true; } else { return false; }
|
||||
|
||||
@@ -1997,6 +1997,12 @@
|
||||
function getUserByTribe($tribe){
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "users where tribe = $tribe";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
}
|
||||
|
||||
function getUserByAlliance($aid){
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "users where alliance = $aid";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
}
|
||||
|
||||
@@ -2612,11 +2618,19 @@
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return mysql_fetch_array($result);
|
||||
}
|
||||
|
||||
function getOwnArtefactInfoByType($vref, $type) {
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $vref AND type = $type";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return mysql_fetch_array($result);
|
||||
}
|
||||
|
||||
function getOwnArtefactInfoByType2($vref, $type) {
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $vref AND type = $type";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return $this->mysql_fetch_all($result);
|
||||
}
|
||||
|
||||
function getOwnUniqueArtefactInfo($id, $type, $size) {
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE owner = $id AND type = $type AND size=$size";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
|
||||
Reference in New Issue
Block a user