diff --git a/Admin/Templates/ban_msg.tpl b/Admin/Templates/ban_msg.tpl
index b1d44113..ea8e991e 100644
--- a/Admin/Templates/ban_msg.tpl
+++ b/Admin/Templates/ban_msg.tpl
@@ -8,7 +8,7 @@
## ##
#################################################################################
$time = time();
-$ban = mysql_query("SELECT * FROM ".TB_PREFIX."banlist WHERE `uid` = '".$session->uid."' and `end` < '".$time."'");
+$ban = mysql_query("SELECT * FROM ".TB_PREFIX."banlist WHERE `uid` = '".$session->uid."' and `end` < '".$time."' and active = 1");
$ban1 = mysql_fetch_array($ban);
?>
diff --git a/GameEngine/Admin/Mods/natarbuildingplan.php b/GameEngine/Admin/Mods/natarbuildingplan.php
index e4f1d876..219fbf7b 100644
--- a/GameEngine/Admin/Mods/natarbuildingplan.php
+++ b/GameEngine/Admin/Mods/natarbuildingplan.php
@@ -37,7 +37,7 @@ for($i=1;$i<=$amt;$i++) {
$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.';
- $database->addArtefact($wid, 3, 11, 3, 'Ancient Construction Plan', $desc, 0, 'typeww.gif');
+ $database->addArtefact($wid, 3, 11, 1, 'Ancient Construction Plan', $desc, '', 'typeww.gif');
}
diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php
index 5b632149..64d0ffef 100644
--- a/GameEngine/Automation.php
+++ b/GameEngine/Automation.php
@@ -1075,6 +1075,22 @@ class Automation {
$heroxp = $totaldead_def;
$database->modifyHeroXp("experience",$heroxp,$from['owner']);
}
+ $Defender1 = $database->getUnit($data['to']);
+ if($Defender1['hero'] > 0){
+ $defheroowner = $database->getVillageField($Defender1['vref'],"owner");
+ $defheroxp = $totaldead_att;
+ $database->modifyHeroXp("experience",$defheroxp,$defheroowner);
+ }
+ $enforcementarray1 = $database->getEnforceVillage($data['to'],0);
+ if(count($enforcementarray1) > 0) {
+ foreach($enforcementarray1 as $enforce1) {
+ if($enforce1['hero'] > 0){
+ $enforceowner = $database->getVillageField($enforce1['from'],"owner");
+ $reinfheroxp = $totaldead_att;
+ $database->modifyHeroXp("experience",$reinfheroxp,$enforceowner);
+ }
+ }
+ }
$database->modifyPoints($toF['owner'],'dpall',$totaldead_att );
$database->modifyPoints($from['owner'],'apall',$totaldead_def);
$database->modifyPoints($toF['owner'],'dp',$totaldead_att );
@@ -1913,8 +1929,8 @@ if($data['t11'] > 0){
$walllevel =0;
$rplevel =0;
}
-$palaceimg = "img/g/g26.gif\" height=\"30\" width=\"24\" alt=\"Palace\" title=\"Palace\" />";
-$crannyimg = "
img/g/g23.gif\" height=\"30\" width=\"24\" alt=\"Cranny\" title=\"Cranny\" />";
+$palaceimg = "
";
+$crannyimg = "
";
$info_spy = "".$spy_pic.",".$palaceimg." Residance/Palace Level : ".$rplevel."
".$crannyimg." Cranny level: ".$crannylevel."
Wall Level : ".$walllevel."";
@@ -2035,7 +2051,7 @@ $crannyimg = "img/g/g23.gif\" height=\"30\" w
}
unset($Attacker);
unset($Defender);
- unset($Enforce);
+ unset($enforce);
unset($unitssend_att);
unset($unitssend_def);
unset($battlepart);
@@ -2056,7 +2072,6 @@ $crannyimg = "
img/g/g23.gif\" height=\"30\" w
unset($herosend_def);
unset($deadhero);
unset($heroxp);
- unset($dead11);
unset($AttackerID);
unset($DefenderID);
unset($totalsend_alldef);
@@ -2064,6 +2079,12 @@ $crannyimg = "
img/g/g23.gif\" height=\"30\" w
unset($totaldead_def);
unset($unitsdead_att_check);
unset($totalattackdead);
+ unset($Defender1);
+ unset($enforce1);
+ unset($defheroowner);
+ unset($enforceowner);
+ unset($defheroxp);
+ unset($reinfheroxp);
}
if(file_exists("GameEngine/Prevention/sendunits.txt")) {
@unlink("GameEngine/Prevention/sendunits.txt");
diff --git a/GameEngine/Building.php b/GameEngine/Building.php
index 9ab462b8..cb3ef8d7 100644
--- a/GameEngine/Building.php
+++ b/GameEngine/Building.php
@@ -394,7 +394,7 @@ class Building {
}
private function meetRequirement($id) {
- global $village,$database;
+ global $village,$session,$database;
switch($id) {
case 1:
case 2:
@@ -493,8 +493,20 @@ class Building {
if($this->getTypeLevel(15) >= 10 && $village->capital == 0) { return true; } else { return false; }
break;
case 40:
- $wwbuildingplan = count($database->getOwnArtefactInfoByType2($village->wid,11));
- if($village->natar == 1 && $wwbuildingplan > 0) { return true; } else { return false; }
+ $wwlevel = $village->resarray['f'.$id];
+ if($wwlevel > 50){
+ $needed_plan = 1;
+ }else{
+ $needed_plan = 0;
+ }
+ $wwvillages = $database->getVillagesID($session->uid);
+ foreach($wwvillages as $wwvillage){
+ $plan = count($database->getOwnArtefactInfoByType2($wwvillage,11));
+ if($plan > 0){
+ $wwbuildingplan += 1;
+ }
+ }
+ if($village->natar == 1 && $wwbuildingplan > $needed_plan) { return true; } else { return false; }
break;
case 41:
if($this->getTypeLevel(16) >= 10 && $this->getTypeLevel(20) == 20) { return true; } else { return false; }
@@ -626,7 +638,7 @@ class Building {
return false;
}
- private function finishAll() {
+ public function finishAll() {
global $database,$session,$logging,$village,$bid18,$bid10,$bid11,$technology,$_SESSION;
if($session->access!=BANNED){
foreach($this->buildArray as $jobs) {
@@ -638,11 +650,10 @@ class Building {
if($jobs['type'] != 25 AND $jobs['type'] != 26 AND $jobs['type'] != 40) {
$finish = 1;
$resource = $this->resourceRequired($jobs['field'],$jobs['type']);
- $q = "UPDATE ".TB_PREFIX."fdata set f".$jobs['field']." = f".$jobs['field']." + 1, f".$jobs['field']."t = ".$jobs['type']." where vref = ".$jobs['wid'];
+ $q = "UPDATE ".TB_PREFIX."fdata set f".$jobs['field']." = ".$jobs['level'].", f".$jobs['field']."t = ".$jobs['type']." where vref = ".$jobs['wid'];
if($database->query($q)) {
$database->modifyPop($jobs['wid'],$resource['pop'],0);
$database->addCP($jobs['wid'],$resource['cp']);
- $database->finishDemolition($village->wid);
$q = "DELETE FROM ".TB_PREFIX."bdata where id = ".$jobs['id'];
$database->query($q);
if($jobs['type'] == 18) {
@@ -650,41 +661,14 @@ class Building {
$max = $bid18[$level]['attri'];
$q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $owner";
$database->query($q);
- }
- if($jobs['type'] == 10) {
- $max=$database->getVillageField($jobs['wid'],"maxstore");
- if($level=='0' && $this->getTypeLevel(10) != 20){ $max-=STORAGE_BASE; }
- $max-=$bid10[$level]['attri']*STORAGE_MULTIPLIER;
- $max+=$bid10[$level+1]['attri']*STORAGE_MULTIPLIER;
- $database->setVillageField($jobs['wid'],"maxstore",$max);
- }
- if($jobs['type'] == 11) {
- $max=$database->getVillageField($jobs['wid'],"maxcrop");
- if($level=='0' && $this->getTypeLevel(11) != 20){ $max-=STORAGE_BASE; }
- $max-=$bid11[$level]['attri']*STORAGE_MULTIPLIER;
- $max+=$bid11[$level+1]['attri']*STORAGE_MULTIPLIER;
- $database->setVillageField($jobs['wid'],"maxcrop",$max);
- }
- if($jobs['type'] == 38) {
- $max=$database->getVillageField($jobs['wid'],"maxstore");
- if($level=='0' && $this->getTypeLevel(38) != 20){ $max-=STORAGE_BASE; }
- $max-=$bid38[$level]['attri']*STORAGE_MULTIPLIER;
- $max+=$bid38[$level+1]['attri']*STORAGE_MULTIPLIER;
- $database->setVillageField($jobs['wid'],"maxstore",$max);
- }
- if($jobs['type'] == 39) {
- $max=$database->getVillageField($jobs['wid'],"maxcrop");
- if($level=='0' && $this->getTypeLevel(39) != 20){ $max-=STORAGE_BASE; }
- $max-=$bid39[$level]['attri']*STORAGE_MULTIPLIER;
- $max+=$bid39[$level+1]['attri']*STORAGE_MULTIPLIER;
- $database->setVillageField($jobs['wid'],"maxcrop",$max);
- }
+ }
}
if(($jobs['field'] >= 19 && ($session->tribe == 1 || ALLOW_ALL_TRIBE)) || (!ALLOW_ALL_TRIBE && $session->tribe != 1)) { $innertimestamp = $jobs['timestamp']; }
}
}
}
}
+ $database->finishDemolition($village->wid);
$technology->finishTech();
$logging->goldFinLog($village->wid);
$database->modifyGold($session->uid,2,0);
diff --git a/GameEngine/Technology.php b/GameEngine/Technology.php
index 81c7c4d9..a5b657c3 100644
--- a/GameEngine/Technology.php
+++ b/GameEngine/Technology.php
@@ -459,7 +459,7 @@ private function trainUnit($unit,$amt,$great=false) {
foreach($trainlist as $train) {
$train_amt += $train['amt'];
}
- $max = $bid36[$village->resarray['f'.$id]]['attri'] - ($village->unitarray['u99'] + $train_amt);
+ $max = $bid36[$building->getTypeLevel(36)]['attri'] - ($village->unitarray['u99'] + $train_amt);
if($max < $amt) {
$amt = 0;
}
diff --git a/Templates/Build/15_1.tpl b/Templates/Build/15_1.tpl
index cdf83882..0ff19492 100644
--- a/Templates/Build/15_1.tpl
+++ b/Templates/Build/15_1.tpl
@@ -31,6 +31,9 @@ if($village->resarray['f'.$id] >= DEMOLISH_LEVEL_REQ) {
echo "";
echo "
";
echo "Demolition of ".$building->procResType($VillageResourceLevels['f'.$Demolition['buildnumber'].'t']).": ".$generator->getTimeFormat($Demolition['timetofinish']-time())."";
+ ?>
+
+ ";
} else {
echo "
diff --git a/Templates/Build/36.tpl b/Templates/Build/36.tpl
index 0978b73d..ffe9e82e 100644
--- a/Templates/Build/36.tpl
+++ b/Templates/Build/36.tpl
@@ -86,7 +86,7 @@ include("next.tpl");
-
Building already at max level
"; } else if($bindicate == 10) { @@ -149,8 +149,12 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) { echo ". (waiting loop) "; } } + }else{ + if($needed_plan == 0){ + echo "Need WW construction plan."; }else{ echo "Need more WW construction plan."; } + } ?> diff --git a/Templates/Ranking/alliance.tpl b/Templates/Ranking/alliance.tpl index 7b0500b1..f48e3bcd 100644 --- a/Templates/Ranking/alliance.tpl +++ b/Templates/Ranking/alliance.tpl @@ -1,6 +1,8 @@ The alliance ".$_SESSION['search']." does not exist."; +?> +The alliance "" does not exist.
The alliance "" does not exist.
The alliance "" does not exist.
The user " . $_SESSION['search'] . " does not exist or has no hero.
"; - $search = 0; - } else { + if(!is_numeric($_SESSION['search'])) { + ?> +The user "" does not exist or has no hero.
The user "" does not exist.
The user "" does not exist.
The user "" does not exist.
The user "" does not exist.
The user "" does not exist.
The user "" does not exist.
The village "" does not exist.