pull request by Shadowss

This commit is contained in:
yi12345
2013-09-27 14:03:30 +03:00
parent 619cb827a7
commit a844afb9d3
+40 -37
View File
@@ -1,9 +1,16 @@
<?php <?php
# Developed By : Mr.php
# you have no rights to change this !! #################################################################################
# Fixed : Doubling Troops , Hero not dieing etc .. ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
# Email : mr.php-majed@hotmail.com ## --------------------------------------------------------------------------- ##
# Skype : mr.majed1005 ## Project: TravianZ ##
## Version: 01.09.2013 ##
## Filename Automation.php ##
## Developed by: Mr.php , Advocaite , brainiacX , yi12345 , Shadow ##
## License: TravianZ Project ##
## Copyright: TravianZ (c) 2010-2013. All rights reserved. ##
## Source code: https://github.com/yi12345/TravianZ/ ##
#################################################################################
class Automation { class Automation {
@@ -3616,44 +3623,40 @@ $wallimg = "<img src=\"".GP_LOCATE."img/g/g3".$targettribe."Icon.gif\" height=\"
} }
private function bountyGetCropProd() { private function bountyGetCropProd() {
global $bid4,$bid8,$bid9,$session; global $bid4,$bid8,$bid9,$session;
$crop = $grainmill = $bakery = 0; $crop = $grainmill = $bakery = 0;
$cropholder = array(); $cropholder = array();
for($i=1;$i<=38;$i++) { for($i=1;$i<=38;$i++) {
if($this->bountyresarray['f'.$i.'t'] == 4) { if($this->bountyresarray['f'.$i.'t'] == 4) {
array_push($cropholder,'f'.$i); array_push($cropholder,'f'.$i);
} }
if($this->bountyresarray['f'.$i.'t'] == 8) { if($this->bountyresarray['f'.$i.'t'] == 8) {
$grainmill = $this->bountyresarray['f'.$i]; $grainmill = $this->bountyresarray['f'.$i];
} }
if($this->bountyresarray['f'.$i.'t'] == 9) { if($this->bountyresarray['f'.$i.'t'] == 9) {
$bakery = $this->bountyresarray['f'.$i]; $bakery = $this->bountyresarray['f'.$i];
} }
} }
for($i=0;$i<=count($cropholder)-1;$i++) { $crop+= $bid4[$this->bountyresarray[$cropholder[$i]]]['prod']; } for($i=0;$i<=count($cropholder)-1;$i++) { $crop+= $bid4[$this->bountyresarray[$cropholder[$i]]]['prod']; }
if($grainmill >= 1) { if($grainmill >= 1) {
$crop += $crop /100 * $bid8[$grainmill]['attri']; $crop += $crop /100 * $bid8[$grainmill]['attri'];
} }
if($bakery >= 1) { if($bakery >= 1) {
$crop += $crop /100 * $bid9[$bakery]['attri']; $crop += $crop /100 * $bid9[$bakery]['attri'];
} }
if($this->bountyocounter[3] != 0) { if($this->bountyocounter[3] != 0) {
$crop += $crop*0.25*$this->bountyocounter[3]; $crop += $crop*0.25*$this->bountyocounter[3];
} }
$who=$database->getVillageField($bountyresarray['vref'],"owner"); if(!empty($bountyresarray['vref']) && is_numeric($bountyresarray['vref'])){
$croptrue=$database->getUserField($who,"b4",0);
if($croptrue > time()) {
$crop*=1.25;
if(!empty($bountyresarray['vref']) && is_numeric($bountyresarray['vref'])){
$who=$database->getVillageField($bountyresarray['vref'],"owner"); $who=$database->getVillageField($bountyresarray['vref'],"owner");
$croptrue=$database->getUserField($who,"b4",0); $croptrue=$database->getUserField($who,"b4",0);
if($croptrue > time()) { if($croptrue > time()) {
$crop*=1.25; $crop*=1.25;
} }
} }
$crop *= SPEED; $crop *= SPEED;
return round($crop); return round($crop);
} }
private function trainingComplete() { private function trainingComplete() {
if(file_exists("GameEngine/Prevention/training.txt")) { if(file_exists("GameEngine/Prevention/training.txt")) {