mirror of
https://github.com/Shadowss/TravianZ.git
synced 2026-07-06 04:44:21 +00:00
fix artefact of the fool
This commit is contained in:
+173
-49
@@ -208,6 +208,7 @@ class Automation {
|
||||
$this->procClimbers();
|
||||
$this->CheckBan();
|
||||
$this->regenerateOasisTroops();
|
||||
$this->artefactOfTheFool();
|
||||
}
|
||||
|
||||
private function loyaltyRegeneration() {
|
||||
@@ -1580,6 +1581,17 @@ class Automation {
|
||||
}else{
|
||||
$artefact_bouns = 1;
|
||||
}
|
||||
$foolartefact = $database->getFoolArtefactInfo(7,$vid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$cranny_eff *= $arte['effect2'];
|
||||
}else{
|
||||
$cranny_eff /= $arte['effect2'];
|
||||
$cranny_eff = round($cranny_eff);
|
||||
}
|
||||
}
|
||||
}
|
||||
$cranny_eff = ($cranny * $atk_bonus)*$def_bonus*$artefact_bouns;
|
||||
|
||||
// work out available resources.
|
||||
@@ -1817,23 +1829,10 @@ class Automation {
|
||||
$tblevel = $bdo['f'.$rand];
|
||||
$tbgid = $bdo['f'.$rand.'t'];
|
||||
$tbid = $rand;
|
||||
$artowner = $database->getVillageField($data['to'],"owner");
|
||||
$bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0));
|
||||
$bartefact1 = count($database->getOwnUniqueArtefactInfo2($data['to'],1,1,1));
|
||||
$bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0));
|
||||
if($bartefact > 0){
|
||||
$strongerbuildings = 5;
|
||||
}else if($bartefact1 > 0){
|
||||
$strongerbuildings = 4;
|
||||
}else if($bartefact2 > 0){
|
||||
$strongerbuildings = 3;
|
||||
}else{
|
||||
$strongerbuildings = 1;
|
||||
}
|
||||
if($stonemason==0){
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings)) + 0.5);
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5);
|
||||
}else{
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100) / $strongerbuildings)) + 0.5);
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
|
||||
}
|
||||
if ($battlepart[4]>$needed_cata)
|
||||
{
|
||||
@@ -1954,23 +1953,10 @@ class Automation {
|
||||
$tblevel = $bdo['f'.$rand];
|
||||
$tbgid = $bdo['f'.$rand.'t'];
|
||||
$tbid = $rand;
|
||||
$artowner = $database->getVillageField($data['to'],"owner");
|
||||
$bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0));
|
||||
$bartefact1 = count($database->getOwnUniqueArtefactInfo2($data['to'],1,1,1));
|
||||
$bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0));
|
||||
if($bartefact > 0){
|
||||
$strongerbuildings = 5;
|
||||
}else if($bartefact1 > 0){
|
||||
$strongerbuildings = 4;
|
||||
}else if($bartefact2 > 0){
|
||||
$strongerbuildings = 3;
|
||||
}else{
|
||||
$strongerbuildings = 1;
|
||||
}
|
||||
if($stonemason==0){
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings)) + 0.5);
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5);
|
||||
}else{
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100) / $strongerbuildings)) + 0.5);
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
|
||||
}
|
||||
if (($battlepart[4]/2)>$needed_cata)
|
||||
{
|
||||
@@ -2091,23 +2077,10 @@ class Automation {
|
||||
$tblevel = $bdo['f'.$rand];
|
||||
$tbgid = $bdo['f'.$rand.'t'];
|
||||
$tbid = $rand;
|
||||
$artowner = $database->getVillageField($data['to'],"owner");
|
||||
$bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0));
|
||||
$bartefact1 = count($database->getOwnUniqueArtefactInfo2($data['to'],1,1,1));
|
||||
$bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0));
|
||||
if($bartefact > 0){
|
||||
$strongerbuildings = 5;
|
||||
}else if($bartefact1 > 0){
|
||||
$strongerbuildings = 4;
|
||||
}else if($bartefact2 > 0){
|
||||
$strongerbuildings = 3;
|
||||
}else{
|
||||
$strongerbuildings = 1;
|
||||
}
|
||||
if($stonemason==0){
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings)) + 0.5);
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5);
|
||||
}else{
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100) / $strongerbuildings)) + 0.5);
|
||||
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
|
||||
}
|
||||
if (($battlepart[4]/2)>$needed_cata)
|
||||
{
|
||||
@@ -2544,6 +2517,17 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
$p_fastertroops = 1;
|
||||
}
|
||||
$p_time = round($this->procDistanceTime($p_to,$p_from,min($p_speeds),1)/$p_fastertroops);
|
||||
$foolartefact1 = $database->getFoolArtefactInfo(2,$prisoner['from'],$p_owner);
|
||||
if(count($foolartefact1) > 0){
|
||||
foreach($foolartefact1 as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$p_time *= $arte['effect2'];
|
||||
}else{
|
||||
$p_time /= $arte['effect2'];
|
||||
$p_time = round($p_time);
|
||||
}
|
||||
}
|
||||
}
|
||||
$p_reference = $database->addAttack($prisoner['from'],$prisoner['t1'],$prisoner['t2'],$prisoner['t3'],$prisoner['t4'],$prisoner['t5'],$prisoner['t6'],$prisoner['t7'],$prisoner['t8'],$prisoner['t9'],$prisoner['t10'],$prisoner['t11'],3,0,0,0,0,0,0,0,0,0,0,0);
|
||||
$database->addMovement(4,$prisoner['wref'],$prisoner['from'],$p_reference,time(),($p_time+time()));
|
||||
$anothertroops += $prisoner['t1']+$prisoner['t2']+$prisoner['t3']+$prisoner['t4']+$prisoner['t5']+$prisoner['t6']+$prisoner['t7']+$prisoner['t8']+$prisoner['t9']+$prisoner['t10']+$prisoner['t11'];
|
||||
@@ -2592,8 +2576,19 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
}else{
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$endtime = round($this->procDistanceTime($from,$to,min($speeds),1)/$fastertroops) + time();
|
||||
//$endtime = $this->procDistanceTime($from,$to,min($speeds),1) + time();
|
||||
$endtime = round($this->procDistanceTime($from,$to,min($speeds),1)/$fastertroops);
|
||||
$foolartefact2 = $database->getFoolArtefactInfo(2,$from['wref'],$from['owner']);
|
||||
if(count($foolartefact2) > 0){
|
||||
foreach($foolartefact2 as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$endtime *= $arte['effect2'];
|
||||
}else{
|
||||
$endtime /= $arte['effect2'];
|
||||
$endtime = round($endtime);
|
||||
}
|
||||
}
|
||||
}
|
||||
$endtime += time();
|
||||
if($type == 1) {
|
||||
$database->addNotice($from['owner'],$to['wref'],$ownally,18,''.addslashes($from['name']).' scouts '.addslashes($to['name']).'',$data2,$AttackArrivalTime);
|
||||
}else {
|
||||
@@ -2710,7 +2705,19 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
}else{
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$endtime = round($this->procDistanceTime($from,$to,min($speeds),1)/$fastertroops) + time();
|
||||
$endtime = round($this->procDistanceTime($from,$to,min($speeds),1)/$fastertroops);
|
||||
$foolartefact3 = $database->getFoolArtefactInfo(2,$from['wref'],$from['owner']);
|
||||
if(count($foolartefact3) > 0){
|
||||
foreach($foolartefact3 as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$endtime *= $arte['effect2'];
|
||||
}else{
|
||||
$endtime /= $arte['effect2'];
|
||||
$endtime = round($endtime);
|
||||
}
|
||||
}
|
||||
}
|
||||
$endtime += time();
|
||||
$database->setMovementProc($data['moveid']);
|
||||
$database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],time(),$endtime);
|
||||
$peace = PEACE;
|
||||
@@ -2906,6 +2913,17 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops);
|
||||
$foolartefact4 = $database->getFoolArtefactInfo(2,$from['wref'],$from['owner']);
|
||||
if(count($foolartefact4) > 0){
|
||||
foreach($foolartefact4 as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($endtime);
|
||||
}
|
||||
}
|
||||
}
|
||||
$reference = $database->addAttack($enforce['from'],$post['t1'],$post['t2'],$post['t3'],$post['t4'],$post['t5'],$post['t6'],$post['t7'],$post['t8'],$post['t9'],$post['t10'],$post['t11'],2,0,0,0,0);
|
||||
$database->addMovement(4,$village->wid,$enforce['from'],$reference,time(),($time+time()));
|
||||
$technology->checkReinf($post['ckey']);
|
||||
@@ -3238,7 +3256,11 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
return $ownunit;
|
||||
}
|
||||
|
||||
public function getUpkeep($array,$type) {
|
||||
public function getUpkeep($array,$type,$vid=0,$prisoners=0) {
|
||||
global $database,$session,$village;
|
||||
if($vid==0) { $vid=$village->wid; }
|
||||
$buildarray = array();
|
||||
$buildarray = $database->getResourceLevel($vid);
|
||||
$upkeep = 0;
|
||||
switch($type) {
|
||||
case 0:
|
||||
@@ -3267,13 +3289,76 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
break;
|
||||
}
|
||||
for($i=$start;$i<=$end;$i++) {
|
||||
$k = $i-$start+1;
|
||||
$unit = "u".$i;
|
||||
$unit2 = "t".$k;
|
||||
global $$unit;
|
||||
$dataarray = $$unit;
|
||||
for($j=19;$j<=38;$j++) {
|
||||
if($buildarray['f'.$j.'t'] == 41) {
|
||||
$horsedrinking = $j;
|
||||
}
|
||||
}
|
||||
if($prisoners == 0){
|
||||
if(isset($horsedrinking)){
|
||||
if(($i==4 && $buildarray['f'.$horsedrinking] >= 10)
|
||||
|| ($i==5 && $buildarray['f'.$horsedrinking] >= 15)
|
||||
|| ($i==6 && $buildarray['f'.$horsedrinking] == 20)) {
|
||||
$upkeep += ($dataarray['pop']-1) * $array[$unit];
|
||||
} else {
|
||||
$upkeep += $dataarray['pop'] * $array[$unit];
|
||||
}}else{
|
||||
$upkeep += $dataarray['pop'] * $array[$unit];
|
||||
}
|
||||
}else{
|
||||
if(isset($horsedrinking)){
|
||||
if(($i==4 && $buildarray['f'.$horsedrinking] >= 10)
|
||||
|| ($i==5 && $buildarray['f'.$horsedrinking] >= 15)
|
||||
|| ($i==6 && $buildarray['f'.$horsedrinking] == 20)) {
|
||||
$upkeep += ($dataarray['pop']-1) * $array[$unit2];
|
||||
} else {
|
||||
$upkeep += $dataarray['pop'] * $array[$unit2];
|
||||
}}else{
|
||||
$upkeep += $dataarray['pop'] * $array[$unit2];
|
||||
}
|
||||
}
|
||||
}
|
||||
// $unit = "hero";
|
||||
// global $$unit;
|
||||
// $dataarray = $$unit;
|
||||
if($prisoners == 0){
|
||||
$upkeep += $array['hero'] * 6;
|
||||
}else{
|
||||
$upkeep += $array['t11'] * 6;
|
||||
}
|
||||
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,4,3,0));
|
||||
$artefact1 = count($database->getOwnUniqueArtefactInfo2($vid,4,1,1));
|
||||
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,4,2,0));
|
||||
if($artefact > 0){
|
||||
$upkeep /= 2;
|
||||
$upkeep = round($upkeep);
|
||||
}else if($artefact1 > 0){
|
||||
$upkeep /= 2;
|
||||
$upkeep = round($upkeep);
|
||||
}else if($artefact2 > 0){
|
||||
$upkeep /= 4;
|
||||
$upkeep = round($upkeep);
|
||||
$upkeep *= 3;
|
||||
}
|
||||
$foolartefact = $database->getFoolArtefactInfo(4,$vid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$upkeep *= $arte['effect2'];
|
||||
}else{
|
||||
$upkeep /= $arte['effect2'];
|
||||
$upkeep = round($upkeep);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $upkeep;
|
||||
}
|
||||
|
||||
private function bountycalculateOProduction($bountywid) {
|
||||
global $technology,$database;
|
||||
$this->bountyOproduction['wood'] = $this->bountyGetOWoodProd();
|
||||
@@ -4085,6 +4170,45 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
|
||||
$database->updateOasis($oasis['wref']);
|
||||
}
|
||||
}
|
||||
|
||||
private function artefactOfTheFool() {
|
||||
global $database;
|
||||
$time = time();
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "artefacts where type = 8 and active = 1 and $time - lastupdate >= 86400";
|
||||
$array = $database->query_return($q);
|
||||
foreach($array as $artefact) {
|
||||
$kind = rand(1,7);
|
||||
while($kind == 6){
|
||||
$kind = rand(1,7);
|
||||
}
|
||||
if($artefact['size'] != 3){
|
||||
$bad_effect = rand(0,1);
|
||||
}else{
|
||||
$bad_effect = 0;
|
||||
}
|
||||
switch($kind) {
|
||||
case 1:
|
||||
$effect = rand(1,5);
|
||||
break;
|
||||
case 2:
|
||||
$effect = rand(1,3);
|
||||
break;
|
||||
case 3:
|
||||
$effect = rand(3,10);
|
||||
break;
|
||||
case 4:
|
||||
$effect = rand(2,4);
|
||||
break;
|
||||
case 5:
|
||||
$effect = rand(2,4);
|
||||
break;
|
||||
case 7:
|
||||
$effect = rand(1,6);
|
||||
break;
|
||||
}
|
||||
mysql_query("UPDATE ".TB_PREFIX."artefacts SET kind = $kind, bad_effect = $bad_effect, effect2 = $effect, lastupdate = $time WHERE id = ".$artefact['id']."");
|
||||
}
|
||||
}
|
||||
}
|
||||
$automation = new Automation;
|
||||
?>
|
||||
+50
-7
@@ -292,7 +292,17 @@ class Battle {
|
||||
if($abcount <= 8 && ${att_ab.$abcount} > 0) {
|
||||
|
||||
$ap += (35 + ( 35 + 300 * ${'u'.$i}['pop'] / 7) * (pow(1.007, ${att_ab.$abcount}) - 1)) * $Attacker['u'.$i] * $attacker_artefact;
|
||||
|
||||
$att_foolartefact = $database->getFoolArtefactInfo(3,$AttackerWref,$AttackerID);
|
||||
if(count($att_foolartefact) > 0){
|
||||
foreach($att_foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$ap *= $arte['effect2'];
|
||||
}else{
|
||||
$ap /= $arte['effect2'];
|
||||
$ap = round($ap);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$ap += ($Attacker['u'.$i] * $Attacker['u'.$i] * $Attacker['u'.$i])/3;
|
||||
@@ -372,6 +382,17 @@ class Battle {
|
||||
if($y >= $start && $y <= ($end-2) && ${def_ab.$abcount} > 0) {
|
||||
$dp += (20 + (20 + 300 * ${'u'.$y}['pop'] / 7) * (pow(1.007, ${def_ab.$abcount}) - 1)) * (($Defender['u'.$y]*$Defender['u'.$y]*$Defender['u'.$y])/4) * $defender_artefact;
|
||||
$abcount +=1;
|
||||
$def_foolartefact = $database->getFoolArtefactInfo(3,$AttackerWref,$AttackerID);
|
||||
if(count($def_foolartefact) > 0){
|
||||
foreach($def_foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dp *= $arte['effect2'];
|
||||
}else{
|
||||
$dp /= $arte['effect2'];
|
||||
$dp = round($dp);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$dp += ($Defender['u'.$y]*$Defender['u'.$y]*$Defender['u'.$y])/4;
|
||||
@@ -585,10 +606,21 @@ class Battle {
|
||||
}else{
|
||||
$strongerbuildings = 1;
|
||||
}
|
||||
if($stonemason==0){
|
||||
$need = round((($moralbonus * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a8']))/200) / $strongerbuildings)) + 0.5);
|
||||
$good_effect = $bad_effect = 1;
|
||||
$foolartefact = $database->getFoolArtefactInfo(3,$DefenderWref,$artowner);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$bad_effect = $arte['effect2'];
|
||||
}else{
|
||||
$need = round((($moralbonus * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a8']))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings)) + 0.5);
|
||||
$good_effect = $arte['effect2'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if($stonemason==0){
|
||||
$need = round((($moralbonus * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a8']))/200) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5);
|
||||
}else{
|
||||
$need = round((($moralbonus * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a8']))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5);
|
||||
}
|
||||
// Aantal katapulten om het gebouw neer te halen
|
||||
$result[3] = $need;
|
||||
@@ -614,10 +646,21 @@ class Battle {
|
||||
}else{
|
||||
$strongerbuildings = 1;
|
||||
}
|
||||
if($stonemason==0){
|
||||
$need = round((($moralbonus * (pow($walllevel,2) + $walllevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a7']))/200) / $strongerbuildings)) + 0.5);
|
||||
$good_effect = $bad_effect = 1;
|
||||
$foolartefact = $database->getFoolArtefactInfo(3,$DefenderWref,$artowner);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$bad_effect = $arte['effect2'];
|
||||
}else{
|
||||
$need = round((($moralbonus * (pow($walllevel,2) + $walllevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a7']))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings)) + 0.5);
|
||||
$good_effect = $arte['effect2'];
|
||||
}
|
||||
}
|
||||
}
|
||||
if($stonemason==0){
|
||||
$need = round((($moralbonus * (pow($walllevel,2) + $walllevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a7']))/200) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5);
|
||||
}else{
|
||||
$need = round((($moralbonus * (pow($walllevel,2) + $walllevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a7']))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings / $good_effect * $bad_effect)) + 0.5);
|
||||
}
|
||||
// Aantal katapulten om het gebouw neer te halen
|
||||
$result[7] = $need;
|
||||
|
||||
@@ -2408,6 +2408,17 @@ class MYSQL_DB {
|
||||
$each *= 3;
|
||||
$each = round($each);
|
||||
}
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$vid,$uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$each *= $arte['effect2'];
|
||||
}else{
|
||||
$each /= $arte['effect2'];
|
||||
$each = round($each);
|
||||
}
|
||||
}
|
||||
}
|
||||
if($each == 0){ $each = 1; }
|
||||
$time2 = $now+$each;
|
||||
if(count($queued) > 0) {
|
||||
@@ -2942,10 +2953,10 @@ class MYSQL_DB {
|
||||
return $this->mysql_fetch_all($result);
|
||||
}
|
||||
|
||||
function getArtefactInfo() {
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE id > 0";
|
||||
function getFoolArtefactInfo($type,$vid,$uid) {
|
||||
$q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $vid AND type = $type OR owner = $uid AND size > 1 AND active = 1 AND type = $type";
|
||||
$result = mysql_query($q, $this->connection);
|
||||
return mysql_fetch_array($result);
|
||||
return $this->mysql_fetch_all($result);
|
||||
}
|
||||
|
||||
function claimArtefact($vref, $ovref, $id) {
|
||||
|
||||
@@ -454,6 +454,17 @@ class Technology {
|
||||
$upkeep = round($upkeep);
|
||||
$upkeep *= 3;
|
||||
}
|
||||
$foolartefact = $database->getFoolArtefactInfo(4,$vid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$upkeep *= $arte['effect2'];
|
||||
}else{
|
||||
$upkeep /= $arte['effect2'];
|
||||
$upkeep = round($upkeep);
|
||||
}
|
||||
}
|
||||
}
|
||||
return $upkeep;
|
||||
}
|
||||
|
||||
|
||||
+33
-2
@@ -313,12 +313,32 @@ if($session->access != BANNED){
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($from,$to,min($speeds),1)/$fastertroops);
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
$to_owner = $database->getVillageField($data['to_vid'],"owner");
|
||||
$artefact_2 = count($database->getOwnUniqueArtefactInfo2($to_owner,7,3,0));
|
||||
$artefact1_2 = count($database->getOwnUniqueArtefactInfo2($data['to_vid'],7,1,1));
|
||||
$artefact2_2 = count($database->getOwnUniqueArtefactInfo2($to_owner,7,2,0));
|
||||
if (isset($post['ctar1'])){if($artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0){$post['ctar1'] = 99;}else{$post['ctar1'] = $post['ctar1'];}}else{ $post['ctar1'] = 0;}
|
||||
if (isset($post['ctar2'])){if($artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0){$post['ctar2'] = 99;}else{$post['ctar2'] = $post['ctar2'];}}else{ $post['ctar2'] = 0;}
|
||||
$foolartefact2 = $database->getFoolArtefactInfo(7,$data['to_vid'],$to_owner);
|
||||
$good_artefact = 0;
|
||||
if(count($foolartefact2) > 0){
|
||||
foreach($foolartefact2 as $arte){
|
||||
if($arte['bad_effect'] == 0){
|
||||
$good_artefact = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (isset($post['ctar1'])){if($artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0 or $good_artefact == 1){$post['ctar1'] = 99;}else{$post['ctar1'] = $post['ctar1'];}}else{ $post['ctar1'] = 0;}
|
||||
if (isset($post['ctar2'])){if($artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0 or $good_artefact == 1){$post['ctar2'] = 99;}else{$post['ctar2'] = $post['ctar2'];}}else{ $post['ctar2'] = 0;}
|
||||
if (isset($post['spy'])){$post['spy'] = $post['spy'];}else{ $post['spy'] = 0;}
|
||||
$abdata = $database->getABTech($village->wid);
|
||||
$reference = $database->addAttack(($village->wid),$data['u1'],$data['u2'],$data['u3'],$data['u4'],$data['u5'],$data['u6'],$data['u7'],$data['u8'],$data['u9'],$data['u10'],$data['u11'],$data['type'],$post['ctar1'],$post['ctar2'],$post['spy'],$abdata['b1'],$abdata['b2'],$abdata['b3'],$abdata['b4'],$abdata['b5'],$abdata['b6'],$abdata['b7'],$abdata['b8']);
|
||||
@@ -448,6 +468,17 @@ if($session->access != BANNED){
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops);
|
||||
$foolartefact2 = $database->getFoolArtefactInfo(2,$village->wid,$session->uid);
|
||||
if(count($foolartefact2) > 0){
|
||||
foreach($foolartefact2 as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
$reference = $database->addAttack($enforce['from'],$post['t1'],$post['t2'],$post['t3'],$post['t4'],$post['t5'],$post['t6'],$post['t7'],$post['t8'],$post['t9'],$post['t10'],$post['t11'],2,0,0,0,0);
|
||||
$database->addMovement(4,$village->wid,$enforce['from'],$reference,time(),($time+time()));
|
||||
$technology->checkReinf($post['ckey']);
|
||||
|
||||
@@ -25,7 +25,19 @@ echo "<tr><td class=\"desc\">
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".(${'u'.$i}['wood'])."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".(${'u'.$i}['clay'])."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".(${'u'.$i}['iron'])."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".(${'u'.$i}['crop'])."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
$dur=$generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid19[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
|
||||
@@ -27,7 +27,19 @@ for($i=4;$i<=6;$i++) {
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".(${'u'.$i}['pop'])."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
}
|
||||
$dur=$generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
|
||||
@@ -22,7 +22,19 @@ for($i=15;$i<=16;$i++) {
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
$dur=$generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
|
||||
@@ -22,7 +22,19 @@ for($i=23;$i<=26;$i++) {
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
$dur=$generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
|
||||
@@ -22,7 +22,19 @@ for($i=35;$i<=36;$i++) {
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
$dur=$generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
|
||||
@@ -22,7 +22,20 @@ for($i=45;$i<=46;$i++) {
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid20[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
echo "</div></td>
|
||||
<td class=\"val\">
|
||||
<input type=\"text\" class=\"text\" name=\"t$i\" value=\"0\" maxlength=\"$i\">
|
||||
|
||||
+13
-1
@@ -53,7 +53,19 @@
|
||||
<a href=\"#\" onClick=\"return Popup($i,1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Avaliable: ".$village->unitarray['u'.$i].")</span></div>";
|
||||
echo "<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
$dur=$generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid21[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid21[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
|
||||
+15
-4
@@ -12,6 +12,17 @@ include("next.tpl");
|
||||
}else{
|
||||
$artefact_bouns = 1;
|
||||
}
|
||||
$good_effect = $bad_effect = 1;
|
||||
$foolartefact = $database->getFoolArtefactInfo(7,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$bad_effect = $arte['effect2'];
|
||||
}else{
|
||||
$good_effect = $arte['effect2'];
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<div id="build" class="gid23"><a href="#" onClick="return Popup(23,4);" class="build_logo">
|
||||
<img class="building g23" src="img/x.gif" alt="Cranny" title="Cranny" />
|
||||
@@ -44,11 +55,11 @@ include("next.tpl");
|
||||
<?php
|
||||
if($session->tribe == 3) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*2*$artefact_bouns; ?></b> units</td>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*2*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*$artefact_bouns; ?></b> units</td>
|
||||
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
|
||||
<?php
|
||||
}}else{
|
||||
?>
|
||||
@@ -56,11 +67,11 @@ include("next.tpl");
|
||||
<?php
|
||||
if($session->tribe == 3) {
|
||||
?>
|
||||
<td><b><?php echo $bid23[10]['attri']*2*$artefact_bouns; ?></b> units</td>
|
||||
<td><b><?php echo $bid23[10]['attri']*2*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
|
||||
<?php
|
||||
}else{
|
||||
?>
|
||||
<td><b><?php echo $bid23[10]['attri']*$artefact_bouns; ?></b> units</td>
|
||||
<td><b><?php echo $bid23[10]['attri']*$artefact_bouns*$good_effect/$bad_effect; ?></b> units</td>
|
||||
<?php
|
||||
}}}
|
||||
?>
|
||||
|
||||
@@ -52,7 +52,19 @@ echo "<tr><td class=\"desc\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span></div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
$dur=$generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid25[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid25[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
|
||||
@@ -52,7 +52,19 @@ echo "<tr><td class=\"desc\">
|
||||
<img class=\"unit u".$i."\" src=\"img/x.gif\" alt=\"".$technology->getUnitName($i)."\" title=\"".$technology->getUnitName($i)."\" />
|
||||
<a href=\"#\" onClick=\"return Popup(".$i.",1);\">".$technology->getUnitName($i)."</a> <span class=\"info\">(Available: ".$village->unitarray['u'.$i].")</span></div>
|
||||
<div class=\"details\"><img class=\"r1\" src=\"img/x.gif\" alt=\"Lumber\" title=\"Lumber\" />".${'u'.$i}['wood']."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".${'u'.$i}['clay']."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".${'u'.$i}['iron']."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".${'u'.$i}['crop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"duration\" title=\"duration\" />";
|
||||
$dur=$generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid26[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid26[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) > 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".${'r'.$i}['wood']."&r2=".${'r'.$i}['clay']."&r3=".${'r'.$i}['iron']."&r4=".${'r'.$i}['crop']."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
|
||||
@@ -25,7 +25,20 @@ echo "<tr><td class=\"desc\">
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".(${'u'.$i}['wood']*3)."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".(${'u'.$i}['clay']*3)."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".(${'u'.$i}['iron']*3)."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".(${'u'.$i}['crop']*3)."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid29[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid29[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
@@ -25,7 +25,20 @@ echo "<tr><td class=\"desc\">
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".(${'u'.$i}['wood']*3)."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".(${'u'.$i}['clay']*3)."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".(${'u'.$i}['iron']*3)."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".(${'u'.$i}['crop']*3)."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".(${'u'.$i}['pop']-($building->getTypeLevel(41)>=1?1:0))."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid30[$village->resarray['f'.$id]]['attri'] * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / 100) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid30[$village->resarray['f'.$id]]['attri'] * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
@@ -24,7 +24,20 @@ echo "<tr><td class=\"desc\">
|
||||
</div>
|
||||
<div class=\"details\">
|
||||
<img class=\"r1\" src=\"img/x.gif\" alt=\"Wood\" title=\"Wood\" />".(${'u'.$i}['wood']*3)."|<img class=\"r2\" src=\"img/x.gif\" alt=\"Clay\" title=\"Clay\" />".(${'u'.$i}['clay']*3)."|<img class=\"r3\" src=\"img/x.gif\" alt=\"Iron\" title=\"Iron\" />".(${'u'.$i}['iron']*3)."|<img class=\"r4\" src=\"img/x.gif\" alt=\"Crop\" title=\"Crop\" />".(${'u'.$i}['crop']*3)."|<img class=\"r5\" src=\"img/x.gif\" alt=\"Crop consumption\" title=\"Crop consumption\" />".${'u'.$i}['pop']."|<img class=\"clock\" src=\"img/x.gif\" alt=\"Duration\" title=\"Duration\" />";
|
||||
echo $generator->getTimeFormat(round(${'u'.$i}['time'] * ($bid42[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus));
|
||||
$dur=round(${'u'.$i}['time'] * ($bid42[$village->resarray['f'.$id]]['attri'] / 100) / SPEED * $artefact_bonus2 / $artefact_bonus);
|
||||
$foolartefact = $database->getFoolArtefactInfo(5,$village->wid,$session->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$dur *= $arte['effect2'];
|
||||
}else{
|
||||
$dur /= $arte['effect2'];
|
||||
$dur = round($dur);
|
||||
}
|
||||
}
|
||||
}
|
||||
$dur=$generator->getTimeFormat($dur);
|
||||
echo ($dur=="0:00:00")? "0:00:01":$dur;
|
||||
if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
|
||||
echo "|<a href=\"build.php?gid=17&t=3&r1=".((${'u'.$i}['wood'])*$technology->maxUnitPlus($i))."&r2=".((${'u'.$i}['clay'])*$technology->maxUnitPlus($i))."&r3=".((${'u'.$i}['iron'])*$technology->maxUnitPlus($i))."&r4=".((${'u'.$i}['crop'])*$technology->maxUnitPlus($i))."\" title=\"NPC trade\"><img class=\"npc\" src=\"img/x.gif\" alt=\"NPC trade\" title=\"NPC trade\" /></a>";
|
||||
}
|
||||
|
||||
@@ -20,6 +20,17 @@ $to = array('x'=>$coor['x'], 'y'=>$coor['y']);
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($from,$to,300,0)/$fastertroops);
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Temp
|
||||
|
||||
@@ -392,6 +403,17 @@ $end = ($tribe*10);
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($from,$to,min($speeds),1)/$fastertroops);
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -23,7 +23,17 @@ $to = array('x'=>$coor['x'], 'y'=>$coor['y']);
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($from,$to,300,0)/$fastertroops);
|
||||
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Temp
|
||||
|
||||
$ckey= $generator->generateRandStr(6);
|
||||
@@ -388,7 +398,17 @@ $actionType = "Raid";
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($from,$to,min($speeds),1)/$fastertroops);
|
||||
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,17 @@ $to = array('x'=>$newvillage['x'], 'y'=>$newvillage['y']);
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($from,$to,300,0)/$fastertroops);
|
||||
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
echo '<pre>';
|
||||
echo '</pre>';
|
||||
?>
|
||||
|
||||
@@ -156,7 +156,17 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops);
|
||||
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<td colspan="10">
|
||||
|
||||
@@ -157,7 +157,17 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops);
|
||||
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<td colspan="10">
|
||||
|
||||
@@ -156,7 +156,17 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops);
|
||||
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<td colspan="10">
|
||||
|
||||
@@ -157,7 +157,17 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops);
|
||||
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<td colspan="10">
|
||||
|
||||
@@ -156,7 +156,17 @@ $tocoor = $database->getCoor($enforce['vref']);
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops);
|
||||
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
<td colspan="10">
|
||||
|
||||
@@ -60,8 +60,22 @@
|
||||
$fastertroops = 1;
|
||||
}
|
||||
$time = round($generator->procDistanceTime($from,$to,min($speeds),1)/$fastertroops);
|
||||
|
||||
$ctar1 = 0;
|
||||
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$seesion->uid);
|
||||
if(count($foolartefact) > 0){
|
||||
foreach($foolartefact as $arte){
|
||||
if($arte['bad_effect'] == 1){
|
||||
$time *= $arte['effect2'];
|
||||
}else{
|
||||
$time /= $arte['effect2'];
|
||||
$time = round($time);
|
||||
}
|
||||
}
|
||||
}
|
||||
if($data['u7'] > 0){
|
||||
$ctar1 = 99;
|
||||
}else{
|
||||
$ctar1 = 0;
|
||||
}
|
||||
$ctar2 = 0;
|
||||
$abdata = $database->getABTech($getFLData['wref']);
|
||||
$reference = $database->addAttack(($getFLData['wref']),$data['u1'],$data['u2'],$data['u3'],$data['u4'],$data['u5'],$data['u6'],$data['u7'],$data['u8'],$data['u9'],$data['u10'],$data['u11'],$data['type'],$ctar1,$ctar2,0,$abdata['b1'],$abdata['b2'],$abdata['b3'],$abdata['b4'],$abdata['b5'],$abdata['b6'],$abdata['b7'],$abdata['b8']);
|
||||
|
||||
@@ -188,7 +188,10 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%artefacts` (
|
||||
`desc` text NOT NULL,
|
||||
`effect` varchar(100) NOT NULL,
|
||||
`img` varchar(20) NOT NULL,
|
||||
`active` tinyint(1) unsigned NOT NULL,
|
||||
`kind` tinyint(1) unsigned NOT NULL,
|
||||
`bad_effect` tinyint(1) unsigned NOT NULL,
|
||||
`effect2` tinyint(2) unsigned NOT NULL,
|
||||
`lastupdate` int(11) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MYISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user