more big update

This commit is contained in:
unknown
2012-05-15 23:23:19 +03:00
parent 0583888a14
commit 1215e1c42f
50 changed files with 478 additions and 498 deletions
+1 -1
View File
@@ -39,5 +39,5 @@ for($i=1;$i<=$amt;$i++) {
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$id,'Added <b>$amt</b> WW Buildingplan Villages',".time().")");
header("Location: ../../../admin.php?p=natarbuildingplan&g");
header("Location: ../../../Admin/admin.php?p=natarbuildingplan&g");
?>
+2 -2
View File
@@ -24,7 +24,7 @@ for($i=1;$i<=$amt;$i++) {
$wid = $database->generateBase($kid);
$database->setFieldTaken($wid);
$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`) 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,1314968914)";
$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')";
mysql_query($q);
@@ -39,5 +39,5 @@ for($i=1;$i<=$amt;$i++) {
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$id,'Added <b>$amt</b> WW Villages',".time().")");
header("Location: ../../../admin.php?p=natarend&g");
header("Location: ../../../Admin/admin.php?p=natarend&g");
?>
+60 -36
View File
@@ -19,42 +19,13 @@ class Automation {
private $bountyOpop = 1;
public function isWinner() {
for ($i = 1; $i <= 40; $i++) {
$q = mysql_query("SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40' or f".$i." = '100' and f".$i."t = '40'");
$q = mysql_query("SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
$isThere = mysql_num_rows($q);
if($isThere > 0)
{
header('Location: /winner.php');
}else{
## there is no winner
}
}
}
private function getWWRankInfo() {
global $database;
for ($i = 1; $i <= 40; $i++) {
$q = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE f99t = '40' or f".$i."t = '40'");
$ww = mysql_fetch_array($q);
if($ww['f99'] > 0){
$i = 99;
}
if(mysql_num_rows($q) > 0){
$database->setVillageLevel($ww['vref'], "wwlevel", $ww['f'.$i]);
}
}
}
private function checkWWLevel() {
global $database;
$q = mysql_query("SELECT * FROM ".TB_PREFIX."fdata WHERE wwlevel != 0");
$ww = mysql_fetch_array($q);
for ($i = 1; $i <= 40; $i++) {
if(mysql_num_rows($q) > 0){
if($ww['f99t'] != 40 && $ww['f'.$i.'t'] != 40){
$database->setVillageLevel($ww['vref'], "wwlevel", 0);
}
}
}
}
@@ -147,6 +118,7 @@ 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();
}
@@ -193,8 +165,6 @@ class Automation {
$this->demolitionComplete();
}
$this->updateStore();
$this->getWWRankInfo();
$this->checkWWLevel();
}
function activeCropDead(){
@@ -548,10 +518,10 @@ private function loyaltyRegeneration() {
global $database,$bid18,$bid10,$bid11,$bid38,$bid39;
$time = time();
$array = array();
$q = "SELECT * FROM ".TB_PREFIX."bdata where timestamp < $time";
$q = "SELECT * FROM ".TB_PREFIX."bdata where timestamp < $time and master = 0";
$array = $database->query_return($q);
foreach($array as $indi) {
$q = "UPDATE ".TB_PREFIX."fdata set f".$indi['field']." = f".$indi['field']." + 1, f".$indi['field']."t = ".$indi['type']." where vref = ".$indi['wid'];
$q = "UPDATE ".TB_PREFIX."fdata set f".$indi['field']." = ".$indi['level'].", f".$indi['field']."t = ".$indi['type']." where vref = ".$indi['wid'];
if($database->query($q)) {
$level = $database->getFieldLevel($indi['wid'],$indi['field']);
$pop = $this->getPop($indi['type'],($level-1));
@@ -1894,8 +1864,6 @@ ${dead.$i}=$data['t'.$i];
$database->setVillageLevel($data['to'],"f40",0);
$database->setVillageLevel($data['to'],"f40t",0);
$database->clearExpansionSlot($data['to']);
//kill a chief
$database->modifyAttack($data['ref'],9,1);
$exp1 = $database->getVillageField($data['from'],'exp1');
@@ -2923,6 +2891,62 @@ private function demolitionComplete() {
$database->updateOasis($getoasis['wref']);
}
}
private function MasterBuilder() {
global $database;
$q = "SELECT * FROM ".TB_PREFIX."bdata WHERE master = 1";
$array = $database->query_return($q);
foreach($array as $master) {
$villwood = $database->getVillageField($master['wid'],'wood');
$villclay = $database->getVillageField($master['wid'],'clay');
$villiron = $database->getVillageField($master['wid'],'iron');
$villcrop = $database->getVillageField($master['wid'],'crop');
$type = $master['type'];
$level = $master['level'];
$buildarray = $GLOBALS["bid".$type];
$buildwood = $buildarray[$level]['wood'];
$buildclay = $buildarray[$level]['clay'];
$buildiron = $buildarray[$level]['iron'];
$buildcrop = $buildarray[$level]['crop'];
$ww = count($database->getBuildingByType($master['wid'],40));
if($master['field'] < 19){
$bdata = count($database->getDorf1Building($master['wid']));
$bbdata = count($database->getDorf2Building($master['wid']));
$bdata1 = $database->getDorf1Building($master['wid']);
}else{
$bdata = count($database->getDorf2Building($master['wid']));
$bbdata = count($database->getDorf1Building($master['wid']));
$bdata1 = $database->getDorf2Building($master['wid']);
}
$owner = $database->getVillageField($master['wid'],'owner');
if($database->getUserField($owner,'plus',0) > time() or $ww > 0){
if($bbdata < 2){
$inbuild = 2;
}else{
$inbuild = 1;
}
}else{
$inbuild = 1;
}
if($bdata < $inbuild && $buildwood < $villwood && $buildclay < $villclay && $buildiron < $villiron && $buildcrop < $villcrop){
$time = $master['timestamp']+time();
if(!empty($bdata1)){
foreach($bdata1 as $master1) {
$time += ($master1['timestamp']-time());
}
}
if($bdata == 0){
$database->updateBuildingWithMaster($master['id'],$time,0);
}else{
$database->updateBuildingWithMaster($master['id'],$time,1);
}
$usergold = $database->getUserField($owner,'gold',0);
$gold = $usergold;
$database->updateUserField($owner,'gold',$gold,1);
$database->modifyResource($master['wid'],$buildwood,$buildclay,$buildiron,$buildcrop,0);
}
}
}
}
$automation = new Automation;
+12 -6
View File
@@ -260,7 +260,9 @@ class Building {
if($jobs['id'] == $d) {
$uprequire = $this->resourceRequired($jobs['field'],$jobs['type']);
if($database->removeBuilding($d)) {
if($jobs['master'] == 0){
$database->modifyResource($village->wid,$uprequire['wood'],$uprequire['clay'],$uprequire['iron'],$uprequire['crop'],1);
}
if($jobs['field'] >= 19) {
header("Location: dorf2.php");
}
@@ -307,7 +309,8 @@ class Building {
$time = $this->buildArray[0]['timestamp'] + $uprequire['time'];
}
}
if($database->addBuilding($village->wid,$id,$village->resarray['f'.$id.'t'],$loop,$time+($loop==1?ceil(60/SPEED):0))) {
$level = $database->getResourceLevel($village->wid);
if($database->addBuilding($village->wid,$id,$village->resarray['f'.$id.'t'],$loop,$time+($loop==1?ceil(60/SPEED):0),0,$level['f'.$id] + 1 + count($database->getBuildingByField($village->wid,$id)))) {
$database->modifyResource($village->wid,$uprequire['wood'],$uprequire['clay'],$uprequire['iron'],$uprequire['crop'],0);
$logging->addBuildLog($village->wid,$this->procResType($village->resarray['f'.$id.'t']),($village->resarray['f'.$id]+($loopsame>0?2:1)),0);
if($id >= 19) {
@@ -347,7 +350,8 @@ class Building {
$time = $this->buildArray[0]['timestamp'] + round($dataarray[$village->resarray['f'.$id]-1]['time'] / 4);
}
}
if($database->addBuilding($village->wid,$id,$village->resarray['f'.$id.'t'],$loop,$time,0)) {
$level = $database->getResourceLevel($village->wid);
if($database->addBuilding($village->wid,$id,$village->resarray['f'.$id.'t'],$loop,$time,0,0,$level['f'.$id] + 1 + count($database->getBuildingByField($village->wid,$id)))) {
$logging->addBuildLog($village->wid,$this->procResType($village->resarray['f'.$id.'t']),($village->resarray['f'.$id]-1),2);
header("Location: dorf2.php");
}
@@ -377,7 +381,8 @@ class Building {
}
}
if($this->meetRequirement($tid)) {
if($database->addBuilding($village->wid,$id,$tid,$loop,$time)) {
$level = $database->getResourceLevel($village->wid);
if($database->addBuilding($village->wid,$id,$tid,$loop,$time,0,$level['f'.$id] + 1 + count($database->getBuildingByField($village->wid,$id)))) {
$logging->addBuildLog($village->wid,$this->procResType($tid),($village->resarray['f'.$id]+1),1);
$database->modifyResource($village->wid,$uprequire['wood'],$uprequire['clay'],$uprequire['iron'],$uprequire['crop'],0);
header("Location: dorf2.php");
@@ -486,7 +491,8 @@ class Building {
if($this->getTypeLevel(15) >= 10 && $village->capital == 0) { return true; } else { return false; }
break;
case 40:
return false; //not implemented
//need to check if have ww buildplan too
if($village->natar == 1) { return true; } else { return false; }
break;
case 41:
if($this->getTypeLevel(16) >= 10 && $this->getTypeLevel(20) == 20) { return true; } else { return false; }
@@ -625,8 +631,8 @@ class Building {
foreach($this->buildArray as $jobs) {
if($jobs['wid']==$village->wid){
$wwvillage = $database->getResourceLevel($jobs['wid']);
if($wwvillage['f99t']!=40 && $wwvillage['f1t']!=40 && $wwvillage['f2t']!=40 && $wwvillage['f3t']!=40 && $wwvillage['f4t']!=40 && $wwvillage['f5t']!=40 && $wwvillage['f6t']!=40 && $wwvillage['f7t']!=40 && $wwvillage['f8t']!=40 && $wwvillage['f9t']!=40 && $wwvillage['f10t']!=40 && $wwvillage['f11t']!=40 && $wwvillage['f12t']!=40 && $wwvillage['f13t']!=40 && $wwvillage['f14t']!=40 && $wwvillage['f15t']!=40 && $wwvillage['f16t']!=40 && $wwvillage['f17t']!=40 && $wwvillage['f18t']!=40 && $wwvillage['f19t']!=40 && $wwvillage['f20t']!=40 && $wwvillage['f21t']!=40 && $wwvillage['f22t']!=40 && $wwvillage['f23t']!=40 && $wwvillage['f24t']!=40 && $wwvillage['f25t']!=40 && $wwvillage['f26t']!=40 && $wwvillage['f27t']!=40 && $wwvillage['f28t']!=40 && $wwvillage['f29t']!=40 && $wwvillage['f30t']!=40 && $wwvillage['f31t']!=40 && $wwvillage['f32t']!=40 && $wwvillage['f33t']!=40 && $wwvillage['f34t']!=40 && $wwvillage['f35t']!=40 && $wwvillage['f36t']!=40 && $wwvillage['f37t']!=40 && $wwvillage['f38t']!=40 && $wwvillage['f39t']!=40 && $wwvillage['f40t']!=40){
$level = $database->getFieldLevel($jobs['wid'],$jobs['field']);
if($wwvillage['f99t']!=40){
$level = $database->getFieldLevel($jobs['wid'],$jobs['field']);
$level = ($level == -1) ? 0 : $level;
if($jobs['type'] != 25 AND $jobs['type'] != 26 AND $jobs['type'] != 40) {
$gold=$database->getUserField($_SESSION['username'],'gold','username');
+71 -12
View File
@@ -1498,7 +1498,8 @@
function getDelArchive($uid) {
$q = "SELECT * FROM " . TB_PREFIX . "mdata WHERE target = $uid and archived = 1 and deltarget = 1 OR owner = $uid and archived = 1 and delowner = 1 ORDER BY time DESC";
return mysql_query($q, $this->connection);
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function unarchiveNotice($id) {
@@ -1548,10 +1549,10 @@
return $dbarray[$field];
}
function addBuilding($wid, $field, $type, $loop, $time) {
function addBuilding($wid, $field, $type, $loop, $time, $master, $level) {
$x = "UPDATE " . TB_PREFIX . "fdata SET f" . $field . "t=" . $type . " WHERE vref=" . $wid;
mysql_query($x, $this->connection) or die(mysql_error());
$q = "INSERT into " . TB_PREFIX . "bdata values (0,$wid,$field,$type,$loop,$time)";
$q = "INSERT into " . TB_PREFIX . "bdata values (0,$wid,$field,$type,$loop,$time,$master,$level)";
return mysql_query($q, $this->connection);
}
@@ -1567,6 +1568,9 @@
if($jobs[$i]['loopcon'] == 1) {
$jobLoopconID = $i;
}
if($jobs[$i]['master'] == 1) {
$jobMaster = $i;
}
}
if(count($jobs) > 1 && ($jobs[0]['field'] == $jobs[1]['field'])) {
$SameBuildCount = 1;
@@ -1577,10 +1581,26 @@
if(count($jobs) > 2 && ($jobs[1]['field'] == $jobs[2]['field'])) {
$SameBuildCount = 3;
}
if(count($jobs) > 2 && ($jobs[0]['field'] == ($jobs[1]['field'] == $jobs[2]['field']))) {
$SameBuildCount = 4;
}
if($SameBuildCount > 0) {
if($d == $jobs[floor($SameBuildCount / 3)]['id'] || $d == $jobs[floor($SameBuildCount / 2) + 1]['id']) {
$q = "UPDATE " . TB_PREFIX . "bdata SET loopcon=0,timestamp=" . $jobs[floor($SameBuildCount / 3)]['timestamp'] . " WHERE ID=" . $jobs[floor($SameBuildCount / 3)]['id'] . " OR ID=" . $jobs[floor($SameBuildCount / 2) + 1]['id'];
if($SameBuildCount == 4){
if($jobDeleted == 0){
$uprequire = $building->resourceRequired($jobs[1]['field'],$jobs[1]['type'],1);
$time = $uprequire['time'];
$timestamp = $time+time();
$q = "UPDATE " . TB_PREFIX . "bdata SET loopcon=0,level=level-1,timestamp=".$timestamp." WHERE id=".$jobs[1]['id']."";
mysql_query($q, $this->connection);
}
$uprequire1 = $building->resourceRequired($jobs[$jobMaster]['field'],$jobs[$jobMaster]['type'],2);
$time1 = $uprequire1['time'];
$timestamp1 = $time1;
$q1 = "UPDATE " . TB_PREFIX . "bdata SET level=level-1,timestamp=".$timestamp1." WHERE id=".$jobs[$jobMaster]['id']."";
mysql_query($q1, $this->connection);
}else if($d == $jobs[floor($SameBuildCount / 3)]['id'] || $d == $jobs[floor($SameBuildCount / 2) + 1]['id']) {
$q = "UPDATE " . TB_PREFIX . "bdata SET loopcon=0,level=level-1,timestamp=" . $jobs[floor($SameBuildCount / 3)]['timestamp'] . " WHERE master = 0 AND id > ".$d." and (ID=" . $jobs[floor($SameBuildCount / 3)]['id'] . " OR ID=" . $jobs[floor($SameBuildCount / 2) + 1]['id'] . ")";
mysql_query($q, $this->connection);
}
} else {
@@ -1596,7 +1616,7 @@
if(($jobLoopconID >= 0) && ($jobs[$jobDeleted]['loopcon'] != 1)) {
if(($jobs[$jobLoopconID]['field'] <= 18 && $jobs[$jobDeleted]['field'] <= 18) || ($jobs[$jobLoopconID]['field'] >= 19 && $jobs[$jobDeleted]['field'] >= 19)) {
$uprequire = $building->resourceRequired($jobs[$jobLoopconID]['field'], $jobs[$jobLoopconID]['type']);
$x = "UPDATE " . TB_PREFIX . "bdata SET loopcon=0,timestamp=" . (time() + $uprequire['time']) . " WHERE wid=" . $jobs[$jobDeleted]['wid'] . " AND loopcon=1";
$x = "UPDATE " . TB_PREFIX . "bdata SET loopcon=0,timestamp=" . (time() + $uprequire['time']) . " WHERE wid=" . $jobs[$jobDeleted]['wid'] . " AND loopcon=1 AND master=0";
mysql_query($x, $this->connection) or die(mysql_error());
}
}
@@ -1640,10 +1660,51 @@
}
function getJobs($wid) {
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid order by timestamp ASC";
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid order by master,timestamp ASC";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getMasterJobs($wid) {
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and master = 1 order by master,timestamp ASC";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getMasterJobsByField($wid,$field) {
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and field = $field and master = 1 order by master,timestamp ASC";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getBuildingByField($wid,$field) {
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and field = $field and master = 0";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getBuildingByType($wid,$type) {
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and type = $type and master = 0";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getDorf1Building($wid) {
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and field < 19 and master = 0";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getDorf2Building($wid) {
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and field > 18 and master = 0";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function updateBuildingWithMaster($id, $time,$loop) {
$q = "UPDATE " . TB_PREFIX . "bdata SET master = 0, timestamp = ".$time.",loopcon = ".$loop." WHERE id = ".$id."";
return mysql_query($q, $this->connection);
}
function getVillageByName($name) {
$q = "SELECT wref FROM " . TB_PREFIX . "vdata where name = '$name' limit 1";
@@ -2175,15 +2236,13 @@
***************************/
function getWW() {
for($i=1; $i<=40; $i++) {
$q = "SELECT * FROM " . TB_PREFIX . "fdata WHERE f99t = 40 or f".$i."t = 40";
$q = "SELECT * FROM " . TB_PREFIX . "fdata WHERE f99t = 40";
$result = mysql_query($q, $this->connection);
if(mysql_num_rows($result)) {
return true;
} else {
return false;
}
}
}
/***************************
@@ -2192,10 +2251,10 @@
***************************/
function getWWLevel($vref) {
$q = "SELECT wwlevel FROM " . TB_PREFIX . "fdata WHERE vref = $vref";
$q = "SELECT f99 FROM " . TB_PREFIX . "fdata WHERE vref = $vref";
$result = mysql_query($q, $this->connection) or die(mysql_error());
$dbarray = mysql_fetch_array($result);
return $dbarray['wwlevel'];
return $dbarray['f99'];
}
/***************************
+1 -1
View File
@@ -243,7 +243,7 @@ class Market {
private function tradeResource($post) {
global $session,$database,$village;
$wwvillage = $database->getResourceLevel($village->wid);
if($wwvillage['f99t']!=40 && $wwvillage['f1t']!=40 && $wwvillage['f2t']!=40 && $wwvillage['f3t']!=40 && $wwvillage['f4t']!=40 && $wwvillage['f5t']!=40 && $wwvillage['f6t']!=40 && $wwvillage['f7t']!=40 && $wwvillage['f8t']!=40 && $wwvillage['f9t']!=40 && $wwvillage['f10t']!=40 && $wwvillage['f11t']!=40 && $wwvillage['f12t']!=40 && $wwvillage['f13t']!=40 && $wwvillage['f14t']!=40 && $wwvillage['f15t']!=40 && $wwvillage['f16t']!=40 && $wwvillage['f17t']!=40 && $wwvillage['f18t']!=40 && $wwvillage['f19t']!=40 && $wwvillage['f20t']!=40 && $wwvillage['f21t']!=40 && $wwvillage['f22t']!=40 && $wwvillage['f23t']!=40 && $wwvillage['f24t']!=40 && $wwvillage['f25t']!=40 && $wwvillage['f26t']!=40 && $wwvillage['f27t']!=40 && $wwvillage['f28t']!=40 && $wwvillage['f29t']!=40 && $wwvillage['f30t']!=40 && $wwvillage['f31t']!=40 && $wwvillage['f32t']!=40 && $wwvillage['f33t']!=40 && $wwvillage['f34t']!=40 && $wwvillage['f35t']!=40 && $wwvillage['f36t']!=40 && $wwvillage['f37t']!=40 && $wwvillage['f38t']!=40 && $wwvillage['f39t']!=40 && $wwvillage['f40t']!=40){
if($wwvillage['f99t']!=40){
if($session->userinfo['gold'] >= 3) {
//kijken of ze niet meer gs invoeren dan ze hebben
if($session->access == BANNED){
-34
View File
@@ -33,52 +33,31 @@
}
public function procMessage($post) {
global $session;
if(isset($post['ft'])) {
switch($post['ft']) {
case "m1":
if($session->access!=BANNED){
$this->quoteMessage($post['id']);
}else{
header("Location: banned.php");
}
break;
case "m2":
if($session->access!=BANNED or $post['an']==strtolower("multihunter")){
if ($post['an'] == "[ally]"){
$this->sendAMessage($post['an'],$post['be'],$post['message']);
}else{
$this->sendMessage($post['an'],$post['be'],$post['message']);
}
header("Location: nachrichten.php?t=2");
}else{
header("Location: banned.php");
}
break;
case "m3":
case "m4":
case "m5":
if(isset($post['delmsg_x'])) {
if($session->access!=BANNED){
$this->removeMessage($post);
$this->header($get);
}else{
header("Location: banned.php");
}
}
if(isset($post['archive_x'])) {
if($session->access!=BANNED){
$this->archiveMessage($post);
}else{
header("Location: banned.php");
}
}
if(isset($post['start_x'])) {
if($session->access!=BANNED){
$this->unarchiveMessage($post);
}else{
header("Location: banned.php");
}
}
break;
case "m6":
@@ -120,27 +99,14 @@
}
public function procNotice($post) {
global $session;
if(isset($post["del_x"])) {
if($session->access != BANNED){
$this->removeNotice($post);
}else{
header("Location: banned.php");
}
}
if(isset($post['archive_x'])) {
if($session->access != BANNED){
$this->archiveNotice($post);
}else{
header("Location: banned.php");
}
}
if(isset($post['start_x'])) {
if($session->access != BANNED){
$this->unarchiveNotice($post);
}else{
header("Location: banned.php");
}
}
}
+3 -1
View File
@@ -19,7 +19,7 @@ class Village {
public $type;
public $coor = array();
public $awood,$aclay,$airon,$acrop,$pop,$maxstore,$maxcrop;
public $wid,$vname,$capital;
public $wid,$vname,$capital,$natar,$master;
public $resarray = array();
public $unitarray,$techarray,$unitall,$researching,$abarray = array();
private $infoarray = array();
@@ -72,6 +72,7 @@ class Village {
$this->researching = $database->getResearching($this->wid);
$this->capital = $this->infoarray['capital'];
$this->natar = $this->infoarray['natar'];
$this->currentcel = $this->infoarray['celebration'];
$this->wid = $this->infoarray['wref'];
$this->vname = $this->infoarray['name'];
@@ -84,6 +85,7 @@ class Village {
$this->maxcrop = $this->infoarray['maxcrop'];
$this->allcrop = $this->getCropProd();
$this->loyalty = $this->infoarray['loyalty'];
$this->master = count($database->getMasterJobs($this->wid));
//de gs in town, zetten op max pakhuisinhoud
if($this->awood>$this->maxstore){ $this->awood=$this->maxstore; $database->updateResource($this->wid,'wood',$this->maxstore); }
if($this->aclay>$this->maxstore){ $this->aclay=$this->maxstore; $database->updateResource($this->wid,'clay',$this->maxstore); }
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid1"><a href="#" onClick="return Popup(0,4);" class="build_logo">
<img class="building g1" src="img/x.gif" alt="<?php echo B1; ?>" title="<?php echo B1; ?>" />
@@ -14,7 +13,7 @@
</tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid10"><a href="#" onClick="return Popup(10,4);" class="build_logo">
<img class="building g10" src="img/x.gif" alt="Warehouse" title="Warehouse" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid11"><a href="#" onClick="return Popup(11,4);" class="build_logo">
<img class="building g11" src="img/x.gif" alt="Granary" title="Granary" />
@@ -18,7 +17,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid14"><a href="#" onClick="return Popup(14,4);" class="build_logo">
<img class="building g14" src="img/x.gif" alt="Tournament Square" title="Tournament Square" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Speed bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid15"><a href="#" onClick="return Popup(15,4);" class="build_logo">
<img class="building g15" src="img/x.gif" alt="Main Building" title="Main Building" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Construction time at level <?php echo $next; ?>:</th>
+8
View File
@@ -1,17 +1,25 @@
<?php
if($_REQUEST["cancel"] == "1") {
if($session->access != BANNED){
$database->delDemolition($village->wid);
header("Location: build.php?gid=15&amp;cancel=0&amp;demolish=0");
}else{
header("Location: banned.php");
}
}
if(!empty($_REQUEST["demolish"]) && $_REQUEST["c"] == $session->mchecker) {
if($session->access != BANNED){
if($_REQUEST["type"] != null) {
$type = $_REQUEST['type'];
$database->addDemolition($village->wid,$type);
$session->changeChecker();
header("Location: build.php?gid=15&amp;cancel=0&amp;demolish=0");
}
}else{
header("Location: banned.php");
}
}
if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
+2 -2
View File
@@ -169,8 +169,8 @@ function testSum() {
<?php
$wwvillage = $database->getResourceLevel($village->wid);
if($wwvillage['f99t']!=40 && $wwvillage['f1t']!=40 && $wwvillage['f2t']!=40 && $wwvillage['f3t']!=40 && $wwvillage['f4t']!=40 && $wwvillage['f5t']!=40 && $wwvillage['f6t']!=40 && $wwvillage['f7t']!=40 && $wwvillage['f8t']!=40 && $wwvillage['f9t']!=40 && $wwvillage['f10t']!=40 && $wwvillage['f11t']!=40 && $wwvillage['f12t']!=40 && $wwvillage['f13t']!=40 && $wwvillage['f14t']!=40 && $wwvillage['f15t']!=40 && $wwvillage['f16t']!=40 && $wwvillage['f17t']!=40 && $wwvillage['f18t']!=40 && $wwvillage['f19t']!=40 && $wwvillage['f20t']!=40 && $wwvillage['f21t']!=40 && $wwvillage['f22t']!=40 && $wwvillage['f23t']!=40 && $wwvillage['f24t']!=40 && $wwvillage['f25t']!=40 && $wwvillage['f26t']!=40 && $wwvillage['f27t']!=40 && $wwvillage['f28t']!=40 && $wwvillage['f29t']!=40 && $wwvillage['f30t']!=40 && $wwvillage['f31t']!=40 && $wwvillage['f32t']!=40 && $wwvillage['f33t']!=40 && $wwvillage['f34t']!=40 && $wwvillage['f35t']!=40 && $wwvillage['f36t']!=40 && $wwvillage['f37t']!=40 && $wwvillage['f38t']!=40 && $wwvillage['f39t']!=40 && $wwvillage['f40t']!=40){
?>
if($wwvillage['f99t']!=40){
?>
<table id="npc" cellpadding="1" cellspacing="1">
<thead>
<tr>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid2"><a href="#" onClick="return Popup(2,4);" class="build_logo">
<img class="building g2" src="img/x.gif" alt="<?php echo B2; ?>" title="<?php echo B2; ?>" />
@@ -15,7 +14,7 @@
</tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
-145
View File
@@ -1,145 +0,0 @@
<table cellpadding="1" cellspacing="1" class="build_details">
<thead><tr>
<td>Academy</td>
<td>Action</td>
</tr></thead>
<tbody>
<?php
$fail = $success = 0;
for($i=2;$i<=9;$i++) {
if($technology->meetRRequirement($i) && !$technology->getTech($i) && !$technology->isResearch($i,1)) {
echo "<tr><td class=\"desc\">
<div class=\"tit\">
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a>
</div>
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'r'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'r'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'r'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'r'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
echo $generator->getTimeFormat(round(${'r'.$i}['time'] * ($bid22[$village->resarray['f'.$id]]['attri'] / 100)/SPEED));
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
}
if(${'r'.$i}['wood'] > $village->maxstore || ${'r'.$i}['clay'] > $village->maxstore || ${'r'.$i}['iron'] > $village->maxstore) {
echo "<br><span class=\"none\">Expand warehouse</span></div></td>";
echo "<td class=\"act\">
<div class=\"none\">Expand<br>warehouse</div>
</td></tr>";
}
else if(${'r'.$i}['crop'] > $village->maxcrop) {
echo "<br><span class=\"none\">Expand granary</span></div></td>";
echo "<td class=\"act\">
<div class=\"none\">Expand<br>granary</div>
</td></tr>";
}
else if(${'r'.$i}['wood'] > $village->awood || ${'r'.$i}['clay'] > $village->aclay || ${'r'.$i}['iron'] > $village->airon || ${'r'.$i}['crop'] > $village->acrop) {
$time = $technology->calculateAvaliable($i);
echo "<br><span class=\"none\">Enough resources ".$time[0]." at ".$time[1]."</span></div></td>";
echo "<td class=\"act\">
<div class=\"none\">Too few<br>resources</div>
</td></tr>";
}
else if($session->access != BANNED){
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"build.php?id=$id&amp;a=$i&amp;c=".$session->mchecker."\">Research</a></td></tr>";
}else{
echo "</td>";
echo "<td class=\"act\">
<a class=\"research\" href=\"banned.php\">Research</a></td></tr>";
}
$success += 1;
}
else {
$fail += 1;
}
}
if($success == 0) {
echo "<td colspan=\"2\"><div class=\"none\" align=\"center\">There are no researches avaliable</div></td>";
}
?>
</tbody>
</table>
<?php
if($fail > 0) {
echo "<p class=\"switch\"><a id=\"researchFutureLink\" href=\"#\" onclick=\"return $('researchFuture').toggle();\">show more</a></p>
<table id=\"researchFuture\" class=\"build_details hide\" cellspacing=\"1\" cellpadding=\"1\">
<thead><tr><td colspan=\"2\">Prerequisites</td></tr><tbody>";
if(!$technology->meetRRequirement(2) && !$technology->getTech(2)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u2\" title=\"Praetorian\" alt=\"Praetorian\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(2, 1);\" href=\"#\">Praetorian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 1);\">Academy</a>
<span title=\"+2\">Level 1</span><br /><a href=\"#\" onclick=\"return Popup(13, 4);\">Armoury </a><span title=\"+1\">Level 1</span></td></tr>";
}
if(!$technology->meetRRequirement(3) && !$technology->getTech(3)) {
echo"<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u3\" title=\"Imperian\" alt=\"Imperian\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(3, 1);\" href=\"#\">Imperian</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
<span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(12, 4);\">Blacksmith </a><span title=\"+1\">Level 1</span> </td></tr>";
}
if(!$technology->meetRRequirement(4) && !$technology->getTech(4)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u4\" title=\"Equites Legati\" alt=\"Equites Legati\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(4, 1);\" href=\"#\">Equites Legati</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+1\">Level 1</span> </td></tr>";
}
if(!$technology->meetRRequirement(5) && !$technology->getTech(5)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u5\" title=\"Equites Imperatoris\" alt=\"Equites Imperatoris\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(5, 1);\" href=\"#\">Equites Imperatoris</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+2\">Level 5</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">Stable</a><span title=\"+5\">Level 5</span> </td></tr>";
}
if(!$technology->meetRRequirement(6) && !$technology->getTech(6)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u6\" title=\"Equites Caesaris\" alt=\"Equites Caesaris\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(6, 1);\" href=\"#\">Equites Caesaris</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">Level 15</span><br /><a href=\"#\" onclick=\"return Popup(20, 4);\">
Stable</a><span title=\"+10\">Level 10</span> </td></tr>";
}
if(!$technology->meetRRequirement(7) && !$technology->getTech(7)) {
echo "
<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u7\" title=\"Battering Ram\" alt=\"Battering Ram\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(7, 1);\" href=\"#\">Battering Ram</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a>
<span title=\"+7\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a><span title=\"+1\">Level 1</span></td></tr>";
}
if(!$technology->meetRRequirement(8) && !$technology->getTech(8)) {
echo "<tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u8\" title=\"Fire Catapult\" alt=\"Fire Catapult\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(8, 1);\" href=\"#\">Fire Catapult</a></div></td><td class=\"cond\"><a href=\"#\" onclick=\"return Popup(21, 4);\">Workshop</a>
<span title=\"+10\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">Academy</a><span title=\"+12\">Level 15</span> </td>
</tr>";
}
if(!$technology->meetRRequirement(9) && !$technology->getTech(9)) {
echo " <tr><td class=\"desc\"><div class=\"tit\"><img class=\"unit u9\" title=\"Senator\" alt=\"Senator\" src=\"img/x.gif\"/>
<a onclick=\"return Popup(9, 1);\" href=\"#\">Senator</a></div></td><td class=\"cond\">
<a href=\"#\" onclick=\"return Popup(16, 4);\">Rally Point</a><span title=\"+9\">Level 10</span><br /><a href=\"#\" onclick=\"return Popup(22, 4);\">
Academy</a><span title=\"+17\">Level 20</span></td></tr>";
}
echo "<script type=\"text/javascript\">
//<![CDATA[
$(\"researchFuture\").toggle = (function()
{
this.toggleClass(\"hide\");
$(\"researchFutureLink\").set(\"text\",
this.hasClass(\"hide\")
? \"show more\"
: \"hide more\"
);
return false;
}).bind($(\"researchFuture\"));
//]]>
</script>";
echo "</tbody></table>";
}
$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 "</tr>";
$timer +=1;
}
echo "</tbody></table>";
}
?>
+4 -5
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid23"><a href="#" onClick="return Popup(23,4);" class="build_logo">
<img class="building g23" src="img/x.gif" alt="Cranny" title="Cranny" />
@@ -29,15 +28,15 @@
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
if($next<=10){
?>
<th>Hidden units per resource at level <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild; ?>:</th>
<th>Hidden units per resource at level <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:</th>
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild]['attri']*2; ?></b> units</td>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*2; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild]['attri']; ?></b> units</td>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']; ?></b> units</td>
<?php
}}else{
?>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid28"><a href="#" onClick="return Popup(28,4);" class="build_logo">
<img class="building g28" src="img/x.gif" alt="Trade Office" title="Trade Office" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Merchant load at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid3"><a href="#" onClick="return Popup(3,4);" class="build_logo">
<img class="building g3" src="img/x.gif" alt="<?php echo B3; ?>" title="<?php echo B3; ?>" />
@@ -17,7 +16,7 @@
</tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid31">
<h1>City Wall <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
@@ -13,7 +12,7 @@
</tr><tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Defence Bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid32">
<h1>Earth Wall <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
@@ -13,7 +12,7 @@
</tr><tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Defence Bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid33">
<h1>Palisade <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
@@ -13,7 +12,7 @@
</tr><tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Defence Bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid34"><a href="#" onClick="return Popup(34,4);" class="build_logo">
<img class="building g34" src="img/x.gif" alt="Stonemason's Lodge" title="Stonemason's Lodge" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Stability bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid35"><a href="#" onClick="return Popup(35,4);" class="build_logo">
<img class="building g35" src="img/x.gif" alt="Brewery" title="Brewery" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=10){
?>
<th>Bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid36"><h1>Trapper <span class="level">Level <?php echo $village->resarray['f'.$id]; ?></span></h1>
<p class="build_desc">
@@ -20,7 +19,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Maximum traps to train at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid38"><a href="#" onClick="return Popup(38,4);" class="build_logo">
<img class="building g38" src="img/x.gif" alt="Great Warehouse" title="Great Warehouse" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid39"><a href="#" onClick="return Popup(39,4);" class="build_logo">
<img class="building g39" src="img/x.gif" alt="Great Granary" title="Great Granary" />
@@ -18,7 +17,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=20){
?>
<th>Capacity at level <?php echo $next ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid4"><a href="#" onClick="return Popup(4,4);" class="build_logo">
<img class="building g4" src="img/x.gif" alt="<?php echo B4; ?>" title="<?php echo B4; ?>" />
@@ -16,7 +15,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($village->capital == 1) {
if($next<=20){
?>
-106
View File
@@ -1,106 +0,0 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename ww.tpl ##
## Developed by: Dixie ##
## Edited by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
?>
<div id="build" class="gid40"><a href="#" onClick="return Popup(5,4);" class="build_logo">
<img class="building g40" src="img/x.gif" alt="Sawmill" title="Sawmill" />
</a>
<h1>Wonder of the World <br /><span class="level">Level <?php echo $village->resarray['f'.$id];?></span></h1>
<p class="build_desc">The World Wonder (otherwise known as a Wonder of the World) is as wonderful as it sounds. "This building" is built in order to win the server. Each level of the World Wonder costs hundreds of thousands (even millions) of resources to build.</p>
<form action="GameEngine/Game/WorldWonderName.php" method="POST">
<input type="hidden" name="vref" value="<?php echo $_SESSION['wid']; ?>" />
<?php
$vref = $_SESSION['wid'];
$wwname = $database->getWWName($vref);
if($village->resarray['f'.$id] < 0){
echo 'You need to have World Wonder level 1 to be able to change its name.
<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" disabled="disabled" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" disabled="disabled" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
} else if($village->resarray['f'.$id] > 0 and $village->resarray['f'.$id] < 11) {
echo '<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
} else if ($village->resarray['f'.$id] > 10){
echo 'You can not change the name of the World Wonder after level 10.
<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" disabled="disabled" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" disabled="disabled" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
}?>
</form>
<?php
if(isset($_GET['n'])) {
echo '<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color="Red"><b>Name changed.</b></font>';
}
?>
<?php
$bindicate = $building->canBuild($id,$village->resarray['f'.$id.'t']);
if($village->resarray['f'.$id] == 100) {
echo "<p><span class=\"none\">Building already at max level</span></p>";
}
else {
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],($loopsame > 0 ? 2:1)+$doublebuild);
?>
<p id="contract"><b>Costs</b> for upgrading to level <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild; ?>:<br />
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><span class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><span class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><span class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><span class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
} ?><br />
<?php
if($bindicate == 2) {
echo "<span class=\"none\">The workers are already at work.</span>";
}
else if($bindicate == 3) {
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
}
else if($bindicate == 4) {
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
}
else if($bindicate == 5) {
echo "<span class=\"none\">Upgrade Warehouse.</span>";
}
else if($bindicate == 6) {
echo "<span class=\"none\">Upgrade Granary.</span>";
}
else if($bindicate == 7) {
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id]);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
}
else if($bindicate == 8) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
}
else if($id <= 18) {
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
}
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
echo ".</a>";
}
else if($bindicate == 9) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
}
else if($id <= 18) {
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
}
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
echo ".</a> <span class=\"none\">(waiting loop)</span> ";
}
}
?>
</p></div>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid5"><a href="#" onClick="return Popup(5,4);" class="build_logo">
<img class="building g5" src="img/x.gif" alt="Sawmill" title="Sawmill" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Wood bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid6"><a href="#" onClick="return Popup(6,4);" class="build_logo">
<img class="building g6" src="img/x.gif" alt="Brickyard" title="Brickyard" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Clay bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid7"><a href="#" onClick="return Popup(7,4);" class="build_logo">
<img class="building g7" src="img/x.gif" alt="Iron Foundry" title="Iron Foundry" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Iron bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid8"><a href="#" onClick="return Popup(8,4);" class="build_logo">
<img class="building g8" src="img/x.gif" alt="Grain Mill" title="Grain Mill" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Crop bonus at level <?php echo $next; ?>:</th>
+2 -3
View File
@@ -1,6 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
include("next.tpl");
?>
<div id="build" class="gid9"><a href="#" onClick="return Popup(9,4);" class="build_logo">
<img class="building g9" src="img/x.gif" alt="Bakery" title="Bakery" />
@@ -17,7 +16,7 @@
<tr>
<?php
if(!$building->isMax($village->resarray['f'.$id.'t'],$id)) {
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild;
$next = $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master;
if($next<=5){
?>
<th>Crop bonus at level <?php echo $next; ?>:</th>
+6 -3
View File
@@ -42,6 +42,8 @@ $herosmansion = $building->getTypeLevel(37);
$greatwarehouse = $building->getTypeLevel(38);
$greatgranary = $building->getTypeLevel(39);
$greatworkshop = $building->getTypeLevel(42);
$ww = $building->getTypeLevel(40);
$wwinbuild = count($database->getBuildingByType($village->wid,40));
foreach ($database->getJobs($_SESSION['wid']) as $bdata) {
$UnderConstruction = strtolower(str_replace(array(" ","'"),"",$building->procResType($bdata['type'])));
@@ -52,6 +54,9 @@ foreach ($database->getJobs($_SESSION['wid']) as $bdata) {
?>
<div id="build" class="gid0"><h1>Construct new building</h1>
<?php
if($ww == 0 && $wwinbuild == 0 && $village->natar == 1){ //need to check if have ww buildplan too
include("avaliable/ww.tpl");
}
if($mainbuilding == 0 && $id != 39 && $id != 40) {
include("avaliable/mainbuilding.tpl");
}
@@ -391,6 +396,7 @@ if($greatworkshop == 0 && $workshop >= 18 && $village->capital == 0 && GREAT_WKS
if($greatworkshop == 0 && $workshop >= 15 && $village->capital == 0 && GREAT_WKS) {
include("soon/greatworkshop.tpl");
}
}
?>
</div><script language="JavaScript" type="text/javascript">
function show_build_list(list) {
@@ -429,7 +435,4 @@ function show_build_list(list) {
}
}
</script>
<?php
}
?>
</div>
@@ -2,7 +2,10 @@
$bid = $_GET['bid'];
unset($_GET['bid']);
$bindicator = $building->canBuild($id,$bid);
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
$uprequire = $building->resourceRequired($id,$bid);
$mastertime = $uprequire['time'];
?>
<td class="res">
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $uprequire['wood']; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $uprequire['clay']; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $uprequire['iron']; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $uprequire['crop']; ?> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
@@ -16,9 +19,31 @@ $uprequire = $building->resourceRequired($id,$bid);
<?php
if($bindicator == 2) {
echo "<span class=\"none\">The workers are already at work.</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 3) {
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 4) {
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
@@ -32,6 +57,17 @@ $uprequire = $building->resourceRequired($id,$bid);
else if($bindicator == 7) {
$neededtime = $building->calculateAvaliable($id,$bid);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 8) {
if($session->access!=BANNED){
+16
View File
@@ -0,0 +1,16 @@
<h2>Wonder Of The World</h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc">The wonder of the world represents the pride of creation. Only the mightiest and richest are able to build such a masterwork and defend it against envious enemies.</td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(40,4);">
<img class="building g40" src="img/x.gif" alt="Wonder Of The World" title="Wonder Of The World" /></a>
</td>
</tr>
<tr>
<?php
$_GET['bid'] = 40;
include("wwavailupgrade.tpl");
?>
</tr></tbody>
</table>
@@ -0,0 +1,84 @@
<?php
$bid = $_GET['bid'];
unset($_GET['bid']);
$bindicator = $building->canBuild(99,$bid);
$uprequire = $building->resourceRequired(99,$bid);
?>
<td class="res">
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $uprequire['wood']; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $uprequire['clay']; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $uprequire['iron']; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $uprequire['crop']; ?> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
} ?></td>
</tr>
<tr>
<td class="link">
<?php
if($bindicator == 2) {
echo "<span class=\"none\">The workers are already at work.</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1){
echo "<a class=\"build\" href=\"dorf2.php?master=99\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 3) {
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1){
echo "<a class=\"build\" href=\"dorf2.php?master=99\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 4) {
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
}
else if($bindicator == 5) {
echo "<span class=\"none\">Upgrade Warehouse.</span>";
}
else if($bindicator == 6) {
echo "<span class=\"none\">Upgrade Granary.</span>";
}
else if($bindicator == 7) {
$neededtime = $building->calculateAvaliable(99,$bid);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
if($session->goldclub){
?> </br>
<?php
if($session->gold >= 1){
echo "<a class=\"build\" href=\"dorf2.php?master=99\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
else if($bindicator == 8) {
if($session->access!=BANNED){
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=99&c=".$session->checker."\">Construct building.</a>";
}else{
echo "<a class=\"build\" href=\"banned.php\">Construct building.</a>";
}
}
else if($bindicator == 9) {
if($session->access!=BANNED){
echo "<a class=\"build\" href=\"dorf2.php?a=$bid&id=99&c=".$session->checker."\">Construct building. (waiting loop)</a>";
}else{
echo "<a class=\"build\" href=\"banned.php?a=$bid&id=99&c=".$session->checker."\">Construct building. (waiting loop)</a>";
}
}
?>
</td>
+5
View File
@@ -0,0 +1,5 @@
<?php
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
$master = count($database->getMasterJobsByField($village->wid,$id));
?>
+71 -5
View File
@@ -1,5 +1,6 @@
<?php
$bindicate = $building->canBuild($id,$village->resarray['f'.$id.'t']);
$bid = $village->resarray['f'.$id.'t'];
$bindicate = $building->canBuild($id,$bid);
if($bindicate == 1) {
echo "<p><span class=\"none\">Building already at max level</span></p>";
} else if($bindicate == 10) {
@@ -9,9 +10,11 @@ if($bindicate == 1) {
} else {
$loopsame = ($building->isCurrent($id) || $building->isLoop($id))?1:0;
$doublebuild = ($building->isCurrent($id) && $building->isLoop($id))?1:0;
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],($loopsame > 0 ? 2:1)+$doublebuild);
$master = count($database->getMasterJobsByField($village->wid,$id));
$uprequire = $building->resourceRequired($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
$mastertime = $uprequire['time'];
?>
<p id="contract"><b>Costs</b> for upgrading to level <?php echo $village->resarray['f'.$id]+($loopsame > 0 ? 2:1)+$doublebuild; ?>:<br />
<p id="contract"><b>Costs</b> for upgrading to level <?php echo $village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master; ?>:<br />
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><span class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><span class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><span class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><span class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
@@ -19,9 +22,51 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
<?php
if($bindicate == 2) {
echo "<span class=\"none\">The workers are already at work.</span>";
if($session->goldclub){
?> </br>
<?php
if($id <= 18) {
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}else{
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
}
else if($bindicate == 3) {
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
if($session->goldclub){
?> </br>
<?php
if($id <= 18) {
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}else{
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
}
else if($bindicate == 4) {
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
@@ -33,8 +78,29 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "<span class=\"none\">Upgrade Granary.</span>";
}
else if($bindicate == 7) {
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],($loopsame > 0 ? 2:1));
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
if($session->goldclub){
?> </br>
<?php
if($id <= 18) {
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf1.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}else{
if($session->gold >= 1 && $village->master == 0){
echo "<a class=\"build\" href=\"dorf2.php?master=$bid&id=$id&time=$mastertime\">Constructing with master builder </a>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}else{
echo "<span class=\"none\">Constructing with master builder</span>";
echo '<font color="#B3B3B3">(costs: <img src="'.GP_LOCATE.'img/a/gold_g.gif" alt="Gold" title="Gold"/>1)</font>';
}
}
}
}
else if($bindicate == 8) {
if($session->access==BANNED){
@@ -48,7 +114,7 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
}
echo $village->resarray['f'.$id]+1;
echo ".</a>";
}
}
else if($bindicate == 9) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
+6 -65
View File
@@ -15,9 +15,9 @@
?>
<div id="build" class="gid40"><a href="#" onClick="return Popup(5,4);" class="build_logo">
<img class="building g40" src="img/x.gif" alt="Sawmill" title="Sawmill" />
<img class="building g40" src="img/x.gif" alt="World Wonder" title="World Wonder" />
</a>
<h1>Wonder of the World <br /><span class="level">Level <?php echo $village->resarray['f99'];?></span></h1>
<h1>Wonder of the World <br /><span class="level">Level <?php echo $village->resarray['f'.$id];?></span></h1>
<p class="build_desc">The World Wonder (otherwise known as a Wonder of the World) is as wonderful as it sounds. "This building" is built in order to win the server. Each level of the World Wonder costs hundreds of thousands (even millions) of resources to build.</p>
<form action="GameEngine/Game/WorldWonderName.php" method="POST">
<input type="hidden" name="vref" value="<?php echo $_SESSION['wid']; ?>" />
@@ -25,12 +25,12 @@
$vref = $_SESSION['wid'];
$wwname = $database->getWWName($vref);
if($village->resarray['f99'] < 0){
if($village->resarray['f'.$id] < 0){
echo 'You need to have World Wonder level 1 to be able to change its name.
<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" disabled="disabled" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" disabled="disabled" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
} else if($village->resarray['f99'] > 0 and $village->resarray['f99'] < 11) {
} else if($village->resarray['f'.$id] > 0 and $village->resarray['f'.$id] < 11) {
echo '<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
} else if ($village->resarray['f99'] > 10){
} else if ($village->resarray['f'.$id] > 10){
echo 'You can not change the name of the World Wonder after level 10.
<center><br />World Wonder name: <input class="text" name="wwname" id="wwname" disabled="disabled" value="'.$wwname.'" maxlength="20"></center><p class="btn"><input type="image" value="" tabindex="9" name="s1" disabled="disabled" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>';
}?>
@@ -42,65 +42,6 @@ echo 'You can not change the name of the World Wonder after level 10.
?>
<?php
$bindicate = $building->canBuild($id,$village->resarray['f99t']);
if($village->resarray['f99'] == 100) {
echo "<p><span class=\"none\">Building already at max level</span></p>";
}
else {
$uprequire = $building->resourceRequired($id,$village->resarray['f99t'],($loopsame > 0 ? 2:1)+$doublebuild);
?>
<p id="contract"><b>Costs</b> for upgrading to level <?php echo $village->resarray['f99']+1+$loopsame+$doublebuild; ?>:<br />
<img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><span class="little_res"><?php echo $uprequire['wood']; ?></span> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><span class="little_res"><?php echo $uprequire['clay']; ?></span> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><span class="little_res"><?php echo $uprequire['iron']; ?></span> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><span class="little_res"><?php echo $uprequire['crop']; ?></span> | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" /><?php echo $uprequire['pop']; ?> | <img class="clock" src="img/x.gif" alt="duration" title="duration" /><?php echo $generator->getTimeFormat($uprequire['time']);
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "|<a href=\"build.php?gid=17&t=3&r1=".$uprequire['wood']."&r2=".$uprequire['clay']."&r3=".$uprequire['iron']."&r4=".$uprequire['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
} ?><br />
<?php
if($bindicate == 2) {
echo "<span class=\"none\">The workers are already at work.</span>";
}
else if($bindicate == 3) {
echo "<span class=\"none\">The workers are already at work. (waiting loop)</span>";
}
else if($bindicate == 4) {
echo "<span class=\"none\">Not enough food. Expand cropland.</span>";
}
else if($bindicate == 5) {
echo "<span class=\"none\">Upgrade Warehouse.</span>";
}
else if($bindicate == 6) {
echo "<span class=\"none\">Upgrade Granary.</span>";
}
else if($bindicate == 7) {
$neededtime = $building->calculateAvaliable($id,$village->resarray['f99']);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
}
else if($bindicate == 8) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
}
else if($id <= 18) {
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
}
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f99']+1+$loopsame+$doublebuild;
echo ".</a>";
}
else if($bindicate == 9) {
if($session->access==BANNED){
echo "<a class=\"build\" href=\"banned.php\">Upgrade to level ";
}
else if($id <= 18) {
echo "<a class=\"build\" href=\"dorf1.php?a=$id&c=$session->checker\">Upgrade to level ";
}
else {
echo "<a class=\"build\" href=\"dorf2.php?a=$id&c=$session->checker\">Upgrade to level ";
}
echo $village->resarray['f99']+1+$loopsame+$doublebuild;
echo ".</a> <span class=\"none\">(waiting loop)</span> ";
}
}
include("upgrade.tpl");
?>
</p></div>
+7 -1
View File
@@ -34,9 +34,10 @@
}
$BuildingList = array();
foreach($building->buildArray as $jobs) {
if($jobs['master'] == 0){
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>";
echo $building->procResType($jobs['type'])." (Level ".($village->resarray['f'.$jobs['field']]+(in_array($jobs['field'],$BuildingList)?2:1 )).")";
echo $building->procResType($jobs['type'])." (Level ".$jobs['level'].")";
if($jobs['loopcon'] == 0) { $BuildingList[] = $jobs['field']; }
if($jobs['loopcon'] == 1) {
echo " (waiting loop)";
@@ -46,6 +47,11 @@
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>";
echo $building->procResType($jobs['type'])."<span class=\"none\"> (Level ".$jobs['level'].")</span>";
}
}
?>
</tbody>
+3 -3
View File
@@ -1,10 +1,10 @@
<?php
if(WW==True){
$result = mysql_query("select ".TB_PREFIX."users.id, ".TB_PREFIX."users.username,".TB_PREFIX."users.alliance, ".TB_PREFIX."fdata.wwname, ".TB_PREFIX."fdata.wwlevel, ".TB_PREFIX."vdata.name, ".TB_PREFIX."fdata.vref
$result = mysql_query("select ".TB_PREFIX."users.id, ".TB_PREFIX."users.username,".TB_PREFIX."users.alliance, ".TB_PREFIX."fdata.wwname, ".TB_PREFIX."fdata.f99, ".TB_PREFIX."vdata.name, ".TB_PREFIX."fdata.vref
FROM ".TB_PREFIX."users
INNER JOIN ".TB_PREFIX."vdata ON ".TB_PREFIX."users.id = ".TB_PREFIX."vdata.owner
INNER JOIN ".TB_PREFIX."fdata ON ".TB_PREFIX."fdata.vref = ".TB_PREFIX."vdata.wref
WHERE ".TB_PREFIX."fdata.wwlevel > 0 ORDER BY ".TB_PREFIX."fdata.wwlevel Desc ");
WHERE ".TB_PREFIX."fdata.f99 > 0 ORDER BY ".TB_PREFIX."fdata.f99 Desc ");
?>
<table cellpadding="1" cellspacing="1" id="villages" class="row_table_data">
@@ -43,7 +43,7 @@
</td>
<td><?php echo $row['wwname'];?></td>
<td><a href="allianz.php?aid=<?php echo $ally['id'];?>"><?php echo $ally['tag'];?></a></td>
<td><?php echo $row['wwlevel'];?></td>
<td><?php echo $row['f99'];?></td>
</tr>
+5 -1
View File
@@ -25,7 +25,10 @@ else {
<map name="map2" id="map2">
<?php
$coords = array(19=>"53,91,91,71,127,91,91,112","136,66,174,46,210,66,174,87","196,56,234,36,270,56,234,77","270,69,308,49,344,69,308,90","327,117,365,97,401,117,365,138","14,129,52,109,88,129,52,150","97,137,135,117,171,137,135,158","182,119,182,65,257,65,257,119,220,140","337,156,375,136,411,156,375,177","2,199,40,179,76,199,40,220","129,164,167,144,203,164,167,185","92,189,130,169,166,189,130,210","342,216,380,196,416,216,380,237","22,238,60,218,96,238,60,259","167,232,205,212,241,232,205,253","290,251,328,231,364,251,328,272","95,273,133,253,169,273,133,294","222,284,260,264,296,284,260,305","80,306,118,286,154,306,118,327","199,316,237,296,273,316,237,337","270,158,303,135,316,155,318,178,304,211,288,227,263,238,250,215");
for($t=19;$t<=40;$t++) {
for($t=19;$t<=39;$t++) {
if(($village->resarray['f99t'] == 40 AND ($t)=='25') or ($village->resarray['f99t'] == 40 AND ($t)=='26') or ($village->resarray['f99t'] == 40 AND ($t)=='29') or ($village->resarray['f99t'] == 40 AND ($t)=='30') or ($village->resarray['f99t'] == 40 AND ($t)=='33')) {
echo "<area href=\"build.php?id=99\" title=\"WorldWonder Level ".$village->resarray['f99']."\" coords=\"$coords[$t]\" shape=\"poly\"/>";
} else {
if($village->resarray['f'.$t.'t'] != 0) {
$title = $building->procResType($village->resarray['f'.$t.'t']). " Level ".$village->resarray['f'.$t];
}
@@ -37,6 +40,7 @@ else {
}
echo "<area href=\"build.php?id=$t\" title=\"$title\" coords=\"$coords[$t]\" shape=\"poly\"/>";
}
}
?>
<area href="build.php?id=40" title="<?php echo $wtitle; ?>" coords="312,338,347,338,377,320,406,288,421,262,421,222,396,275,360,311" shape="poly" alt="" />
+8
View File
@@ -100,6 +100,14 @@ else if(isset($_GET['vill']) && isset($_GET['id'])) {
<td class="dot '.(($_SESSION['wid'] == $returnVillageArray[$i-1]['wref'] ) ? 'hl':'').'">●</td>
<td class="link"><a href="?newdid='.$returnVillageArray[$i-1]['wref'].(($id>=19) ? "&id=".$id : "&id=".$_GET['id'])."&vill=".$_GET['vill'].'">'.$returnVillageArray[$i-1]['name'].'</a></td>
<td class="aligned_coords"><div class="cox">('.$returnVillageArray[$i-1]['x'].'</div><div class="pi">|</div><div class="coy">'.$returnVillageArray[$i-1]['y'].')</div></td></tr>';
}
}
else if(isset($_GET['t']) && isset($_GET['id'])) {
for($i=1;$i<=count($session->villages);++$i){echo'
<tr>
<td class="dot '.(($_SESSION['wid'] == $returnVillageArray[$i-1]['wref'] ) ? 'hl':'').'">●</td>
<td class="link"><a href="?newdid='.$returnVillageArray[$i-1]['wref'].(($id>=19) ? "&id=".$id : "&id=".$_GET['id'])."&t=".$_GET['t'].'">'.$returnVillageArray[$i-1]['name'].'</a></td>
<td class="aligned_coords"><div class="cox">('.$returnVillageArray[$i-1]['x'].'</div><div class="pi">|</div><div class="coy">'.$returnVillageArray[$i-1]['y'].')</div></td></tr>';
}}else{
for($i=1;$i<=count($session->villages);++$i){echo'
<tr>
+9
View File
@@ -20,6 +20,15 @@ if(isset($_GET['newdid'])) {
}else{
$building->procBuild($_GET);
}
if(isset($_GET['master']) && isset($_GET['id']) && isset($_GET['time']) && $session->gold >= 1 && $session->goldclub) {
if($session->access!=BANNED){
$level = $database->getResourceLevel($village->wid);
$database->addBuilding($village->wid, $_GET['id'], $_GET['master'], 1, $_GET['time'], 1, $level['f'.$_GET['id']] + 1 + count($database->getBuildingByField($village->wid,$_GET['id'])));
header("Location: ".$_SERVER['PHP_SELF']);
}else{
header("Location: banned.php");
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
+9
View File
@@ -17,6 +17,15 @@ if(isset($_GET['newdid'])) {
}else{
$building->procBuild($_GET);
}
if(isset($_GET['master']) && isset($_GET['id']) && isset($_GET['time']) && $session->gold >= 1 && $session->goldclub) {
if($session->access!=BANNED){
$level = $database->getResourceLevel($village->wid);
$database->addBuilding($village->wid, $_GET['id'], $_GET['master'], 1, $_GET['time'], 1, $level['f'.$_GET['id']] + 1 + count($database->getBuildingByField($village->wid,$_GET['id'])));
header("Location: ".$_SERVER['PHP_SELF']);
}else{
header("Location: banned.php");
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+3 -1
View File
@@ -370,6 +370,8 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%bdata` (
`type` tinyint(2) unsigned NOT NULL,
`loopcon` tinyint(1) unsigned NOT NULL,
`timestamp` int(10) unsigned NOT NULL,
`master` tinyint(1) unsigned NOT NULL,
`level` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -650,7 +652,6 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%fdata` (
`f99` tinyint(2) unsigned NOT NULL DEFAULT '0',
`f99t` tinyint(2) unsigned NOT NULL DEFAULT '0',
`wwname` varchar(25) NOT NULL DEFAULT 'World Wonder',
`wwlevel` tinyint(2) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`vref`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;
@@ -1338,6 +1339,7 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%vdata` (
`exp2` int(10) NOT NULL,
`exp3` int(10) NOT NULL,
`created` int(11) NOT NULL,
`natar` tinyint(1) unsigned NOT NULL,
PRIMARY KEY (`wref`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
+2 -2
View File
@@ -109,7 +109,7 @@ $q = "
}
## Get WW Winner Details
$sql = mysql_query("SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40' OR f1 = '100' and f1t = '40' OR f2 = '100' and f2t = '40' OR f3 = '100' and f3t = '40' OR f4 = '100' and f4t = '40' OR f5 = '100' and f5t = '40' OR f6 = '100' and f6t = '40' OR f7 = '100' and f7t = '40' OR f8 = '100' and f8t = '40' OR f9 = '100' and f9t = '40' OR f10 = '100' and f10t = '40' OR f11 = '100' and f11t = '40' OR f12 = '100' and f12t = '40' OR f13 = '100' and f13t = '40' OR f14 = '100' and f14t = '40' OR f15 = '100' and f15t = '40' OR f16 = '100' and f16t = '40' OR f17 = '100' and f17t = '40' OR f18 = '100' and f18t = '40' OR f19 = '100' and f19t = '40' OR f20 = '100' and f20t = '40' OR f21 = '100' and f21t = '40' OR f22 = '100' and f22t = '40' OR f23 = '100' and f23t = '40' OR f24 = '100' and f24t = '40' OR f25 = '100' and f25t = '40' OR f26 = '100' and f26t = '40' OR f27 = '100' and f27t = '40' OR f28 = '100' and f28t = '40' OR f29 = '100' and f29t = '40' OR f30 = '100' and f30t = '40' OR f31 = '100' and f31t = '40' OR f32 = '100' and f32t = '40' OR f33 = '100' and f33t = '40' OR f34 = '100' and f34t = '40' OR f35 = '100' and f35t = '40' OR f36 = '100' and f36t = '40' OR f37 = '100' and f37t = '40' OR f38 = '100' and f38t = '40' OR f39 = '100' and f39t = '40' OR f40 = '100' and f40t = '40'")or die(mysql_error());
$sql = mysql_query("SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
$vref = mysql_result($sql, 0);
$sql = mysql_query("SELECT name FROM ".TB_PREFIX."vdata WHERE wref = '$vref'")or die(mysql_error());
@@ -130,7 +130,7 @@ $q = "
$sql = mysql_query("SELECT tag FROM ".TB_PREFIX."alidata WHERE id = '$allianceid'")or die(mysql_error());
$winningalliancetag = mysql_result($sql, 0);
$sql = mysql_query("SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40' OR f1 = '100' and f1t = '40' OR f2 = '100' and f2t = '40' OR f3 = '100' and f3t = '40' OR f4 = '100' and f4t = '40' OR f5 = '100' and f5t = '40' OR f6 = '100' and f6t = '40' OR f7 = '100' and f7t = '40' OR f8 = '100' and f8t = '40' OR f9 = '100' and f9t = '40' OR f10 = '100' and f10t = '40' OR f11 = '100' and f11t = '40' OR f12 = '100' and f12t = '40' OR f13 = '100' and f13t = '40' OR f14 = '100' and f14t = '40' OR f15 = '100' and f15t = '40' OR f16 = '100' and f16t = '40' OR f17 = '100' and f17t = '40' OR f18 = '100' and f18t = '40' OR f19 = '100' and f19t = '40' OR f20 = '100' and f20t = '40' OR f21 = '100' and f21t = '40' OR f22 = '100' and f22t = '40' OR f23 = '100' and f23t = '40' OR f24 = '100' and f24t = '40' OR f25 = '100' and f25t = '40' OR f26 = '100' and f26t = '40' OR f27 = '100' and f27t = '40' OR f28 = '100' and f28t = '40' OR f29 = '100' and f29t = '40' OR f30 = '100' and f30t = '40' OR f31 = '100' and f31t = '40' OR f32 = '100' and f32t = '40' OR f33 = '100' and f33t = '40' OR f34 = '100' and f34t = '40' OR f35 = '100' and f35t = '40' OR f36 = '100' and f36t = '40' OR f37 = '100' and f37t = '40' OR f38 = '100' and f38t = '40' OR f39 = '100' and f39t = '40' OR f40 = '100' and f40t = '40'")or die(mysql_error());
$sql = mysql_query("SELECT vref FROM ".TB_PREFIX."fdata WHERE f99 = '100' and f99t = '40'");
$winner = mysql_num_rows($sql);
if($winner!=0){