mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-21 20:16:11 +00:00
fix bugs in admin panel, ban message and some conquer village bugs
This commit is contained in:
+64
-19
@@ -1069,9 +1069,21 @@ class Automation {
|
||||
//top 10 attack and defence update
|
||||
$totaldead_att = $dead1+$dead2+$dead3+$dead4+$dead5+$dead6+$dead7+$dead8+$dead9+$dead10+$dead11;
|
||||
$totalattackdead += $totaldead_att;
|
||||
$troopsdead1 = $dead1;
|
||||
$troopsdead2 = $dead2;
|
||||
$troopsdead3 = $dead3;
|
||||
$troopsdead4 = $dead4;
|
||||
$troopsdead5 = $dead5;
|
||||
$troopsdead6 = $dead6;
|
||||
$troopsdead7 = $dead7;
|
||||
$troopsdead8 = $dead8;
|
||||
$troopsdead9 = $dead9;
|
||||
$troopsdead10 = $dead10;
|
||||
$troopsdead11 = $dead11;
|
||||
for($i=1;$i<=50;$i++) {
|
||||
$totaldead_def += $dead[''.$i.''];
|
||||
}
|
||||
$totaldead_def += $dead['hero'];
|
||||
if ($Attacker['uhero'] != 0){
|
||||
$heroxp = $totaldead_def;
|
||||
$database->modifyHeroXp("experience",$heroxp,$from['owner']);
|
||||
@@ -1763,10 +1775,45 @@ class Automation {
|
||||
//chiefing village
|
||||
//there are senators
|
||||
if(($data['t9']-$dead9)>0){
|
||||
|
||||
$palacelevel = $database->getResourceLevel($from['wref']);
|
||||
if($palacelevel < 10){
|
||||
$canconquer = 0;
|
||||
}
|
||||
elseif($palacelevel < 15){
|
||||
$canconquer = 1;
|
||||
}
|
||||
elseif($palacelevel < 20){
|
||||
$canconquer = 2;
|
||||
}
|
||||
else{
|
||||
$canconquer = 3;
|
||||
}
|
||||
|
||||
$exp1 = $database->getVillageField($from['wref'],'exp1');
|
||||
$exp2 = $database->getVillageField($from['wref'],'exp2');
|
||||
$exp3 = $database->getVillageField($from['wref'],'exp3');
|
||||
if($exp1 == 0){
|
||||
$villexp = 0;
|
||||
}
|
||||
elseif($exp2 == 0){
|
||||
$villexp = 1;
|
||||
}
|
||||
elseif($exp2 == 0){
|
||||
$villexp = 2;
|
||||
}
|
||||
else{
|
||||
$villexp = 3;
|
||||
}
|
||||
$varray = $database->getProfileVillages($to['owner']);
|
||||
$varray1 = count($database->getProfileVillages($from['owner']));
|
||||
$mode = CP;
|
||||
$need_cps = ${'cp'.$mode}[$varray1];
|
||||
$user_cps = $database->getUserField($from['owner'],"cp",0);
|
||||
//kijken of laatste dorp is, of hoofddorp
|
||||
if(count($varray)!='1' AND $to['capital']!='1'){
|
||||
if($to['owenr']!=3 AND $to['name']!='WW Buildingplan'){
|
||||
if($user_cps >= $need_cps){
|
||||
if(count($varray)!='1' AND $to['capital']!='1' AND $villexp < $canconquer){
|
||||
if($to['owenr']!=3 OR $to['name']!='WW Buildingplan'){
|
||||
//if there is no Palace/Residence
|
||||
for ($i=18; $i<39; $i++){
|
||||
if ($database->getFieldLevel($data['to'],"".$i."t")==25 or $database->getFieldLevel($data['to'],"".$i."t")==26){
|
||||
@@ -1854,6 +1901,9 @@ class Automation {
|
||||
} else {
|
||||
$info_chief = "".$chief_pic.",You cant take over this village.";
|
||||
}
|
||||
} else {
|
||||
$info_chief = "".$chief_pic.",Not enough culture points.";
|
||||
}
|
||||
}
|
||||
|
||||
if($data['t11'] > 0){
|
||||
@@ -2006,23 +2056,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
if($chiefing_village != 1){
|
||||
$database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],time(),$endtime);
|
||||
}else{
|
||||
$villreinf = $database->addEnforce($data);
|
||||
$villtribe = $database->getUserField($from['owner'],"tribe",0);
|
||||
$unittribe = $villtribe-1;
|
||||
if($unittribe == 0){
|
||||
$unittribe = "";
|
||||
}
|
||||
$database->modifyEnforce($villreinf,$unittribe.'1',$data['t1']-$dead1,1);
|
||||
$database->modifyEnforce($villreinf,$unittribe.'2',$data['t2']-$dead2,1);
|
||||
$database->modifyEnforce($villreinf,$unittribe.'3',$data['t3']-$dead3,1);
|
||||
$database->modifyEnforce($villreinf,$unittribe.'4',$data['t4']-$dead4,1);
|
||||
$database->modifyEnforce($villreinf,$unittribe.'5',$data['t5']-$dead5,1);
|
||||
$database->modifyEnforce($villreinf,$unittribe.'6',$data['t6']-$dead6,1);
|
||||
$database->modifyEnforce($villreinf,$unittribe.'7',$data['t7']-$dead7,1);
|
||||
$database->modifyEnforce($villreinf,$unittribe.'8',$data['t8']-$dead8,1);
|
||||
$database->modifyEnforce($villreinf,$unittribe.'9',$data['t9']-$dead9-1,1);
|
||||
$database->modifyEnforce($villreinf,$unittribe.'10',$data['t10']-$dead10,1);
|
||||
$database->modifyEnforce($villreinf,$unittribe.'11',$data['t11']-$dead11,1);
|
||||
$database->addEnforce2($data,$owntribe,$troopsdead1,$troopsdead2,$troopsdead3,$troopsdead4,$troopsdead5,$troopsdead6,$troopsdead7,$troopsdead8,$troopsdead9,$troopsdead10,$troopsdead11);
|
||||
}
|
||||
// send the bounty on type 6.
|
||||
if($type !== 1)
|
||||
@@ -2093,6 +2127,17 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
unset($defheroxp);
|
||||
unset($reinfheroxp);
|
||||
unset($AttackerWref);
|
||||
unset($troopsdead1);
|
||||
unset($troopsdead2);
|
||||
unset($troopsdead3);
|
||||
unset($troopsdead4);
|
||||
unset($troopsdead5);
|
||||
unset($troopsdead6);
|
||||
unset($troopsdead7);
|
||||
unset($troopsdead8);
|
||||
unset($troopsdead9);
|
||||
unset($troopsdead10);
|
||||
unset($troopsdead11);
|
||||
}
|
||||
if(file_exists("GameEngine/Prevention/sendunits.txt")) {
|
||||
@unlink("GameEngine/Prevention/sendunits.txt");
|
||||
|
||||
Reference in New Issue
Block a user