mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-08-20 10:11:00 +00:00
Update Automation.php
This commit is contained in:
+31
-18
@@ -1691,10 +1691,17 @@ class Automation {
|
|||||||
$this->updateORes($data['to']);
|
$this->updateORes($data['to']);
|
||||||
$this->pruneOResource();
|
$this->pruneOResource();
|
||||||
|
|
||||||
$totclay = $database->getOasisField($data['to'],'clay');
|
if ($conqureby >0) { //10% from owner proc village owner - fix by ronix
|
||||||
$totiron = $database->getOasisField($data['to'],'iron');
|
$totclay = intval($database->getVillageField($conqureby,'clay')/10);
|
||||||
$totwood = $database->getOasisField($data['to'],'wood');
|
$totiron = intval($database->getVillageField($conqureby,'iron')/10);
|
||||||
$totcrop = $database->getOasisField($data['to'],'crop');
|
$totwood = intval($database->getVillageField($conqureby,'wood')/10);
|
||||||
|
$totcrop = intval($database->getVillageField($conqureby,'crop')/10);
|
||||||
|
}else{
|
||||||
|
$totclay = $database->getOasisField($data['to'],'clay');
|
||||||
|
$totiron = $database->getOasisField($data['to'],'iron');
|
||||||
|
$totwood = $database->getOasisField($data['to'],'wood');
|
||||||
|
$totcrop = $database->getOasisField($data['to'],'crop');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$avclay = floor($totclay - $cranny_eff);
|
$avclay = floor($totclay - $cranny_eff);
|
||||||
$aviron = floor($totiron - $cranny_eff);
|
$aviron = floor($totiron - $cranny_eff);
|
||||||
@@ -2442,22 +2449,28 @@ class Automation {
|
|||||||
$info_hero = $hero_pic.",Your hero gained ".$heroxp." XP";
|
$info_hero = $hero_pic.",Your hero gained ".$heroxp." XP";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($isoasis != 0) { //oasis
|
if ($isoasis != 0) { //oasis fix by ronix
|
||||||
$OasisInfo = $database->getOasisInfo($data['to']);
|
if ($to['owner']!=$from['owner']) {
|
||||||
$troopcount = $database->countOasisTroops($data['to']);
|
$troopcount = $database->countOasisTroops($data['to']);
|
||||||
if ($database->canConquerOasis($data['from'],$data['to']) && $troopcount==0) {
|
$canqured=$database->canConquerOasis($data['from'],$data['to']);
|
||||||
$database->conquerOasis($data['from'],$data['to']);
|
if ($canqured==1 && $troopcount==0) {
|
||||||
$info_hero = $hero_pic.",Your hero has conquered this oasis".$xp;
|
$database->conquerOasis($data['from'],$data['to']);
|
||||||
|
$info_hero = $hero_pic.",Your hero has conquered this oasis".$xp;
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
if ($OasisInfo['conqured'] != 0 && $troopcount==0) {
|
if ($canqured==3 && $troopcount==0) {
|
||||||
$Oloyaltybefore = intval($OasisInfo['loyalty']);
|
if ($type=='3') {
|
||||||
$database->modifyOasisLoyalty($data['to']);
|
$Oloyaltybefore = intval($to['loyalty']);
|
||||||
$OasisInfo = $database->getOasisInfo($data['to']);
|
//$database->modifyOasisLoyalty($data['to']);
|
||||||
$Oloyaltynow = intval($OasisInfo['loyalty']);
|
//$OasisInfo = $database->getOasisInfo($data['to']);
|
||||||
$info_hero = $hero_pic.",Your hero has reduced oasis loyalty to ".$Oloyaltynow." from ".$Oloyaltybefore." and gained ".$heroxp." XP";
|
$Oloyaltynow = intval($database->modifyOasisLoyalty($data['to']));//intval($OasisInfo['loyalty']);
|
||||||
|
$info_hero = $hero_pic.",Your hero has reduced oasis loyalty to ".$Oloyaltynow." from ".$Oloyaltybefore.$xp;
|
||||||
|
}else{
|
||||||
|
$info_hero = $hero_pic.",Could not reduce loyalty during raid".$xp;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
global $form;
|
global $form;
|
||||||
if ($heroxp == 0) {
|
if ($heroxp == 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user