mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-09-03 08:57:17 +00:00
Update Battle.php
This commit is contained in:
+11
-5
@@ -155,9 +155,10 @@ class Battle {
|
|||||||
|
|
||||||
if(!$scout)
|
if(!$scout)
|
||||||
|
|
||||||
return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],$post['ktyp']+3,$def_ab,$att_ab1,$att_ab2,$att_ab3,$att_ab4,$att_ab5,$att_ab6,$att_ab7,$att_ab8,$post['kata'],$post['stonemason'],$walllevel,$offhero,0,0,0,0);
|
return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],$post['ktyp']+3,$def_ab,$att_ab1,$att_ab2,$att_ab3,$att_ab4,$att_ab5,$att_ab6,$att_ab7,$att_ab8,$post['kata'],$post['stonemason'],$walllevel,$offhero,0,0,0,0,0);
|
||||||
else
|
|
||||||
return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],1,$def_ab,$att_ab1,$att_ab2,$att_ab3,$att_ab4,$att_ab5,$att_ab6,$att_ab7,$att_ab8,$post['kata'],$post['stonemason'],$walllevel,0,0,0,0,0);
|
else
|
||||||
|
return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],1,$def_ab,$att_ab1,$att_ab2,$att_ab3,$att_ab4,$att_ab5,$att_ab6,$att_ab7,$att_ab8,$post['kata'],$post['stonemason'],$walllevel,0,0,0,0,0,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getTypeLevel($tid,$vid) {
|
public function getTypeLevel($tid,$vid) {
|
||||||
@@ -208,7 +209,7 @@ class Battle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//1 raid 0 normal
|
//1 raid 0 normal
|
||||||
function calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab,$att_ab1,$att_ab2,$att_ab3,$att_ab4,$att_ab5,$att_ab6,$att_ab7,$att_ab8,$tblevel,$stonemason,$walllevel,$offhero,$AttackerID,$DefenderID,$AttackerWref,$DefenderWref) {
|
function calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab,$att_ab1,$att_ab2,$att_ab3,$att_ab4,$att_ab5,$att_ab6,$att_ab7,$att_ab8,$tblevel,$stonemason,$walllevel,$offhero,$AttackerID,$DefenderID,$AttackerWref,$DefenderWref,$conqureby) {
|
||||||
global $bid34,$bid35,$database;
|
global $bid34,$bid35,$database;
|
||||||
//fix by ronix
|
//fix by ronix
|
||||||
|
|
||||||
@@ -283,7 +284,12 @@ class Battle {
|
|||||||
|
|
||||||
//get every enforcement in defender village
|
//get every enforcement in defender village
|
||||||
|
|
||||||
$DefendersAll = $database->getEnforceVillage($DefenderWref,0);
|
if ($conqureby>0) { //def from oasis
|
||||||
|
$DefendersAll = $database->getOasisEnforce($data['to'],1);
|
||||||
|
} else {
|
||||||
|
$DefendersAll = $database->getEnforceVillage($DefenderWref,0);
|
||||||
|
}
|
||||||
|
if(!empty($DefendersAll)){
|
||||||
|
|
||||||
// Calculates the total points of the Defender
|
// Calculates the total points of the Defender
|
||||||
if(!empty($DefendersAll)){
|
if(!empty($DefendersAll)){
|
||||||
|
|||||||
Reference in New Issue
Block a user