fixed bugs from the list of NarcisRO and more

This commit is contained in:
unknown
2012-05-23 20:44:10 +03:00
parent b8c8643133
commit ba723dce9d
23 changed files with 122 additions and 75 deletions
+1 -1
View File
@@ -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');
}
+25 -4
View File
@@ -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 src=\"<?php echo GP_LOCATE; ?>img/g/g26.gif\" height=\"30\" width=\"24\" alt=\"Palace\" title=\"Palace\" />";
$crannyimg = "<img src=\"<?php echo GP_LOCATE; ?>img/g/g23.gif\" height=\"30\" width=\"24\" alt=\"Cranny\" title=\"Cranny\" />";
$palaceimg = "<img src=\"".GP_LOCATE."img/g/g26.gif\" height=\"20\" width=\"15\" alt=\"Palace\" title=\"Palace\" />";
$crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\" alt=\"Cranny\" title=\"Cranny\" />";
$info_spy = "".$spy_pic.",".$palaceimg." Residance/Palace Level : ".$rplevel."
<br>".$crannyimg." Cranny level: ".$crannylevel."<br><br>Wall Level : ".$walllevel."";
@@ -2035,7 +2051,7 @@ $crannyimg = "<img src=\"<?php echo GP_LOCATE; ?>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 src=\"<?php echo GP_LOCATE; ?>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 src=\"<?php echo GP_LOCATE; ?>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");
+19 -35
View File
@@ -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);
+1 -1
View File
@@ -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;
}