mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-21 20:16:11 +00:00
update
This commit is contained in:
@@ -1087,7 +1087,6 @@ class Automation {
|
|||||||
$start = ($owntribe-1)*10+1;
|
$start = ($owntribe-1)*10+1;
|
||||||
$end = ($owntribe*10);
|
$end = ($owntribe*10);
|
||||||
$u = (($owntribe-1)*10);
|
$u = (($owntribe-1)*10);
|
||||||
$catp = 0;
|
|
||||||
$catapult = array(8,18,28,48);
|
$catapult = array(8,18,28,48);
|
||||||
$ram = array(7,17,27,47);
|
$ram = array(7,17,27,47);
|
||||||
$chief = array(9,19,29,49);
|
$chief = array(9,19,29,49);
|
||||||
@@ -1097,19 +1096,15 @@ class Automation {
|
|||||||
$Attacker['u'.$i] = $dataarray[$data_num]['t'.$y];
|
$Attacker['u'.$i] = $dataarray[$data_num]['t'.$y];
|
||||||
//there are catas
|
//there are catas
|
||||||
if(in_array($i,$catapult)) {
|
if(in_array($i,$catapult)) {
|
||||||
$catp += $Attacker['u'.$i];
|
|
||||||
$catp_pic = $i;
|
$catp_pic = $i;
|
||||||
}
|
}
|
||||||
if(in_array($i,$ram)) {
|
if(in_array($i,$ram)) {
|
||||||
$rams += $Attacker['u'.$i];
|
|
||||||
$ram_pic = $i;
|
$ram_pic = $i;
|
||||||
}
|
}
|
||||||
if(in_array($i,$chief)) {
|
if(in_array($i,$chief)) {
|
||||||
$chiefs += $Attacker['u'.$i];
|
|
||||||
$chief_pic = $i;
|
$chief_pic = $i;
|
||||||
}
|
}
|
||||||
if(in_array($i,$spys)) {
|
if(in_array($i,$spys)) {
|
||||||
$chiefs += $Attacker['u'.$i];
|
|
||||||
$spy_pic = $i;
|
$spy_pic = $i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1164,7 +1159,7 @@ class Automation {
|
|||||||
$att_ab8 = $att_ab['a8'];
|
$att_ab8 = $att_ab['a8'];
|
||||||
|
|
||||||
//rams attack
|
//rams attack
|
||||||
if($rams > 0 and $type=='3'){
|
if(($data['t7']-$dead7-$traped7)>0 and $type=='3'){
|
||||||
$basearraywall = $database->getMInfo($data['to']);
|
$basearraywall = $database->getMInfo($data['to']);
|
||||||
if($database->getFieldLevel($basearraywall['wref'],40)>'0'){
|
if($database->getFieldLevel($basearraywall['wref'],40)>'0'){
|
||||||
for ($w=1; $w<2; $w++){
|
for ($w=1; $w<2; $w++){
|
||||||
@@ -1243,7 +1238,6 @@ class Automation {
|
|||||||
$start = ($owntribe-1)*10+1;
|
$start = ($owntribe-1)*10+1;
|
||||||
$end = ($owntribe*10);
|
$end = ($owntribe*10);
|
||||||
$u = (($owntribe-1)*10);
|
$u = (($owntribe-1)*10);
|
||||||
$catp = 0;
|
|
||||||
$catapult = array(8,18,28,38,48);
|
$catapult = array(8,18,28,38,48);
|
||||||
$ram = array(7,17,27,37,47);
|
$ram = array(7,17,27,37,47);
|
||||||
$chief = array(9,19,29,39,49);
|
$chief = array(9,19,29,39,49);
|
||||||
@@ -1253,19 +1247,15 @@ class Automation {
|
|||||||
$Attacker['u'.$i] = $dataarray[$data_num]['t'.$y];
|
$Attacker['u'.$i] = $dataarray[$data_num]['t'.$y];
|
||||||
//there are catas
|
//there are catas
|
||||||
if(in_array($i,$catapult)) {
|
if(in_array($i,$catapult)) {
|
||||||
$catp += $Attacker['u'.$i];
|
|
||||||
$catp_pic = $i;
|
$catp_pic = $i;
|
||||||
}
|
}
|
||||||
if(in_array($i,$ram)) {
|
if(in_array($i,$ram)) {
|
||||||
$rams += $Attacker['u'.$i];
|
|
||||||
$ram_pic = $i;
|
$ram_pic = $i;
|
||||||
}
|
}
|
||||||
if(in_array($i,$chief)) {
|
if(in_array($i,$chief)) {
|
||||||
$chiefs += $Attacker['u'.$i];
|
|
||||||
$chief_pic = $i;
|
$chief_pic = $i;
|
||||||
}
|
}
|
||||||
if(in_array($i,$spys)) {
|
if(in_array($i,$spys)) {
|
||||||
$chiefs += $Attacker['u'.$i];
|
|
||||||
$spy_pic = $i;
|
$spy_pic = $i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1776,7 +1766,7 @@ class Automation {
|
|||||||
$info_cat = $info_chief = $info_ram = ",";
|
$info_cat = $info_chief = $info_ram = ",";
|
||||||
|
|
||||||
if ($type=='3'){
|
if ($type=='3'){
|
||||||
if ($rams!='0'){
|
if (($data['t7']-$dead7-$traped7)>0){
|
||||||
if (isset($empty)){
|
if (isset($empty)){
|
||||||
$info_ram = "".$ram_pic.",There is no wall to destroy.";
|
$info_ram = "".$ram_pic.",There is no wall to destroy.";
|
||||||
} else
|
} else
|
||||||
@@ -1806,7 +1796,7 @@ class Automation {
|
|||||||
}
|
}
|
||||||
if ($type=='3')
|
if ($type=='3')
|
||||||
{
|
{
|
||||||
if ($catp!='0')
|
if (($data['t8']-$dead8-$traped8)>0)
|
||||||
{
|
{
|
||||||
$pop=$this->recountPop($data['to']);
|
$pop=$this->recountPop($data['to']);
|
||||||
if($pop<=0)
|
if($pop<=0)
|
||||||
@@ -2209,7 +2199,7 @@ class Automation {
|
|||||||
|
|
||||||
//chiefing village
|
//chiefing village
|
||||||
//there are senators
|
//there are senators
|
||||||
if(($data['t9']-$dead9)>0){
|
if(($data['t9']-$dead9-$traped9)>0){
|
||||||
|
|
||||||
$palacelevel = $database->getResourceLevel($from['wref']);
|
$palacelevel = $database->getResourceLevel($from['wref']);
|
||||||
for($i=1;$i<=40;$i++) {
|
for($i=1;$i<=40;$i++) {
|
||||||
@@ -2279,7 +2269,7 @@ class Automation {
|
|||||||
if(!isset($nochiefing)){
|
if(!isset($nochiefing)){
|
||||||
//$info_chief = "".$chief_pic.",You don't have enought CP to chief a village.";
|
//$info_chief = "".$chief_pic.",You don't have enought CP to chief a village.";
|
||||||
if($this->getTypeLevel(35,$data['from']) == 0){
|
if($this->getTypeLevel(35,$data['from']) == 0){
|
||||||
for ($i=0; $i<($data['t9']-$dead9); $i++){
|
for ($i=0; $i<($data['t9']-$dead9-$traped9); $i++){
|
||||||
if($owntribe == 1){
|
if($owntribe == 1){
|
||||||
$rand+=rand(20,30);
|
$rand+=rand(20,30);
|
||||||
}else{
|
}else{
|
||||||
@@ -2287,7 +2277,7 @@ class Automation {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
for ($i=0; $i<($data['t9']-$dead9); $i++){
|
for ($i=0; $i<($data['t9']-$dead9-$traped9); $i++){
|
||||||
$rand+=rand(5,15);
|
$rand+=rand(5,15);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -483,7 +483,14 @@ class MYSQLi_DB {
|
|||||||
if($OasisInfo['conqured'] == 0 || $OasisInfo['conqured'] != 0 && $OasisInfo['loyalty'] < 99 / min(3,(4-$this->VillageOasisCount($OasisInfo['conqured']))) && $troopcount == 0) {
|
if($OasisInfo['conqured'] == 0 || $OasisInfo['conqured'] != 0 && $OasisInfo['loyalty'] < 99 / min(3,(4-$this->VillageOasisCount($OasisInfo['conqured']))) && $troopcount == 0) {
|
||||||
$CoordsVillage = $this->getCoor($vref);
|
$CoordsVillage = $this->getCoor($vref);
|
||||||
$CoordsOasis = $this->getCoor($wref);
|
$CoordsOasis = $this->getCoor($wref);
|
||||||
if(abs($CoordsOasis['x']-$CoordsVillage['x'])<=3 && abs($CoordsOasis['y']-$CoordsVillage['y'])<=3) {
|
$max = 2 * WORLD_MAX + 1;
|
||||||
|
$x1 = intval($CoordsOasis['x']);
|
||||||
|
$y1 = intval($CoordsOasis['y']);
|
||||||
|
$x2 = intval($CoordsVillage['x']);
|
||||||
|
$y2 = intval($CoordsVillage['y']);
|
||||||
|
$distanceX = min(abs($x2 - $x1), abs($max - abs($x2 - $x1)));
|
||||||
|
$distanceY = min(abs($y2 - $y1), abs($max - abs($y2 - $y1)));
|
||||||
|
if ($distanceX<=3 && $distanceY<=3) {
|
||||||
return True;
|
return True;
|
||||||
} else {
|
} else {
|
||||||
return False;
|
return False;
|
||||||
|
|||||||
Reference in New Issue
Block a user