diff --git a/Admin/Templates/msg.tpl b/Admin/Templates/msg.tpl index 6224e15b..7361c2b2 100644 --- a/Admin/Templates/msg.tpl +++ b/Admin/Templates/msg.tpl @@ -38,7 +38,15 @@ if($msg)
- +
diff --git a/Admin/function.php b/Admin/function.php index 3d551176..3ea01c4c 100644 --- a/Admin/function.php +++ b/Admin/function.php @@ -42,8 +42,7 @@ class funct { case addBan: if($get['time']){$end = time()+$get['time']; }else{$end = '';} - if(preg_match("/^[0-9]+$/",$get['uid'])){ - //if(eregi("^[0-9]*+$",$get['uid'])){ + if(is_numeric($get['uid'])){ $get['uid'] = $get['uid']; }else{ $get['uid'] = $database->getUserField($get['uid'],'id',1); diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index bb030c1c..6661454e 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -628,9 +628,18 @@ class Automation { if($indi['type'] == 40 and ($indi['level'] % 5 == 0 or $indi['level'] > 95) and $indi['level'] != 100){ $this->startNatarAttack($indi['level'], $indi['wid']); } - - $q4 = "UPDATE ".TB_PREFIX."bdata set loopcon = 0 where loopcon = 1 and wid = ".$indi['wid']; + if($database->getUserField($database->getVillageField($indi['wid'],"owner"),"tribe",0) != 1){ + $q4 = "UPDATE ".TB_PREFIX."bdata set loopcon = 0 where loopcon = 1 and master = 0 and wid = ".$indi['wid']; $database->query($q4); + }else{ + if($indi['field'] > 18){ + $q4 = "UPDATE ".TB_PREFIX."bdata set loopcon = 0 where loopcon = 1 and master = 0 and wid = ".$indi['wid']." and field > 18"; + $database->query($q4); + }else{ + $q4 = "UPDATE ".TB_PREFIX."bdata set loopcon = 0 where loopcon = 1 and master = 0 and wid = ".$indi['wid']." and field < 19"; + $database->query($q4); + } + } $q = "DELETE FROM ".TB_PREFIX."bdata where id = ".$indi['id']; $database->query($q); } @@ -780,7 +789,7 @@ class Automation { $row = mysql_fetch_assoc($query); // start the attacks - $endtime = time() + round((60 * 60 * 24) / SPEED); + $endtime = time() + round((60 * 60 * 24) / INCREASE_SPEED); // -.- mysql_query('INSERT INTO `' . TB_PREFIX . 'ww_attacks` (`vid`, `attack_time`) VALUES (' . $vid . ', ' . $endtime . ')'); @@ -800,7 +809,7 @@ class Automation { while ($row = mysql_fetch_assoc($query)) { // fix for destroyed wws - $query2 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f90t` = 40 WHERE `vref` = ' . $row['vid']); + $query2 = mysql_query('UPDATE `' . TB_PREFIX . 'fdata` SET `f99t` = 40 WHERE `vref` = ' . $row['vid']); // delete the attack $query3 = mysql_query('DELETE FROM `' . TB_PREFIX . 'ww_attacks` WHERE `vid` = ' . $row['vid'] . ' AND `attack_time` = ' . $row['attack_time']); @@ -919,7 +928,7 @@ class Automation { if(file_exists("GameEngine/Prevention/sendunits.txt")) { unlink("GameEngine/Prevention/sendunits.txt"); } - global $bid23,$bid34,$database,$battle,$village,$technology,$logging; + global $bid23,$bid34,$database,$battle,$village,$technology,$logging,$generator; $ourFileHandle = fopen("GameEngine/Prevention/sendunits.txt", 'w'); fclose($ourFileHandle); $time = time(); @@ -1079,25 +1088,24 @@ class Automation { $type = 4; } - $def_ab = Array ( - "b1" => 0, // Blacksmith level - "b2" => 0, // Blacksmith level - "b3" => 0, // Blacksmith level - "b4" => 0, // Blacksmith level - "b5" => 0, // Blacksmith level - "b6" => 0, // Blacksmith level - "b7" => 0, // Blacksmith level - "b8" => 0); // Blacksmith level - - $att_ab = Array ( - "a1" => 0, // armoury level - "a2" => 0, // armoury level - "a3" => 0, // armoury level - "a4" => 0, // armoury level - "a5" => 0, // armoury level - "a6" => 0, // armoury level - "a7" => 0, // armoury level - "a8" => 0); // armoury level + $att_ab = $database->getABTech($data['from']); // Blacksmith level + $att_ab1 = $att_ab['b1']; + $att_ab2 = $att_ab['b2']; + $att_ab3 = $att_ab['b3']; + $att_ab4 = $att_ab['b4']; + $att_ab5 = $att_ab['b5']; + $att_ab6 = $att_ab['b6']; + $att_ab7 = $att_ab['b7']; + $att_ab8 = $att_ab['b8']; + $def_ab = $database->getABTech($data['to']); // Armory level + $att_ab1 = $att_ab['a1']; + $att_ab2 = $att_ab['a2']; + $att_ab3 = $att_ab['a3']; + $att_ab4 = $att_ab['a4']; + $att_ab5 = $att_ab['a5']; + $att_ab6 = $att_ab['a6']; + $att_ab7 = $att_ab['a7']; + $att_ab8 = $att_ab['a8']; //rams attack if($rams > 0 and $type=='3'){ @@ -1256,8 +1264,33 @@ class Automation { $stonemason = "1"; } + if(PEACE == 0 || $targettribe == 4 || $targettribe == 5){ - $battlepart = $battle->calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab,$att_ab,$tblevel,$stonemason,$walllevel,$AttackerID,$DefenderID,$AttackerWref,$DefenderWref); + $traps = $Defender['u99']-$Defender['u99o']; + for($i=1;$i<=11;$i++){ + $traps1 = $traps; + if($data['t'.$i] < $traps1){ + $traps1 = $data['t'.$i]; + } + ${traped.$i}=$traps1; + $traps -= $traps1; + $database->modifyUnit($data['to'],array("99o"),array($traps1),array(1)); + } + for($i=$start;$i<=$end;$i++) { + $j = $i-$start+1; + $Attacker['u'.$i] -= ${traped.$j}; + } + $Attacker['uhero'] -= $traped11; + $totaltraped_att = $traped1+$traped2+$traped3+$traped4+$traped5+$traped6+$traped7+$traped8+$traped9+$traped10+$traped11; + if($totaltraped_att > 0){ + $prisoners2 = $database->getPrisoners2($data['to'],$data['from']); + if(empty($prisoners2)){ + $database->addPrisoners($data['to'],$data['from'],$traped1,$traped2,$traped3,$traped4,$traped5,$traped6,$traped7,$traped8,$traped9,$traped10,$traped11); + }else{ + $database->updatePrisoners($data['to'],$data['from'],$traped1,$traped2,$traped3,$traped4,$traped5,$traped6,$traped7,$traped8,$traped9,$traped10,$traped11); + } + } + $battlepart = $battle->calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab1,$def_ab2,$def_ab3,$def_ab4,$def_ab5,$def_ab6,$def_ab7,$def_ab8,$att_ab1,$att_ab2,$att_ab3,$att_ab4,$att_ab5,$att_ab6,$att_ab7,$att_ab8,$tblevel,$stonemason,$walllevel,$AttackerID,$DefenderID,$AttackerWref,$DefenderWref); //units attack string for battleraport $unitssend_att = ''.$data['t1'].','.$data['t2'].','.$data['t3'].','.$data['t4'].','.$data['t5'].','.$data['t6'].','.$data['t7'].','.$data['t8'].','.$data['t9'].','.$data['t10'].''; @@ -1395,6 +1428,8 @@ class Automation { } } } + $totalsend_att = $data['t1']+$data['t2']+$data['t3']+$data['t4']+$data['t5']+$data['t6']+$data['t7']+$data['t8']+$data['t9']+$data['t10']+$data['t11']; + $unitsdead_def[1] = ''.$dead['1'].','.$dead['2'].','.$dead['3'].','.$dead['4'].','.$dead['5'].','.$dead['6'].','.$dead['7'].','.$dead['8'].','.$dead['9'].','.$dead['10'].''; $unitsdead_def[2] = ''.$dead['11'].','.$dead['12'].','.$dead['13'].','.$dead['14'].','.$dead['15'].','.$dead['16'].','.$dead['17'].','.$dead['18'].','.$dead['19'].','.$dead['20'].''; $unitsdead_def[3] = ''.$dead['21'].','.$dead['22'].','.$dead['23'].','.$dead['24'].','.$dead['25'].','.$dead['26'].','.$dead['27'].','.$dead['28'].','.$dead['29'].','.$dead['30'].''; @@ -1429,8 +1464,20 @@ class Automation { $database->modifyAttack($data['ref'],9,$dead9); $database->modifyAttack($data['ref'],10,$dead10); $database->modifyAttack($data['ref'],11,$dead11); - $unitsdead_att = ''.$dead1.','.$dead2.','.$dead3.','.$dead4.','.$dead5.','.$dead6.','.$dead7.','.$dead8.','.$dead9.','.$dead10.''; + + $database->modifyAttack($data['ref'],1,$traped1); + $database->modifyAttack($data['ref'],2,$traped2); + $database->modifyAttack($data['ref'],3,$traped3); + $database->modifyAttack($data['ref'],4,$traped4); + $database->modifyAttack($data['ref'],5,$traped5); + $database->modifyAttack($data['ref'],6,$traped6); + $database->modifyAttack($data['ref'],7,$traped7); + $database->modifyAttack($data['ref'],8,$traped8); + $database->modifyAttack($data['ref'],9,$traped9); + $database->modifyAttack($data['ref'],10,$traped10); + $database->modifyAttack($data['ref'],11,$traped11); + $unitstraped_att = ''.$traped1.','.$traped2.','.$traped3.','.$traped4.','.$traped5.','.$traped6.','.$traped7.','.$traped8.','.$traped9.','.$traped10.','.$traped11.''; if ($herosend_att>0){ $unitsdead_att_check = $unitsdead_att.','.$dead11; }else{ @@ -1670,8 +1717,12 @@ class Automation { $demolish=$battlepart[8]/$battlepart[7]; $totallvl = round(sqrt(pow(($walllevel+0.5),2)-($battlepart[8]*8))); + if($walllevel == $totallvl){ + $info_ram = "".$ram_pic.",Wall was not damaged."; + }else{ $info_ram = "".$ram_pic.",Wall damaged from level ".$walllevel." to level ".$totallvl."."; $database->setVillageLevel($data['to'],"f".$wallid."",$totallvl); + } } } @@ -2139,7 +2190,7 @@ class Automation { else{ $canconquer = 3; } - }else if($palacelevel['f'.$i.'t'] == 25){ + }else if($palacelevel['f'.$plevel.'t'] == 25){ if($palacelevel['f'.$plevel] < 10){ $canconquer = 0; } @@ -2309,7 +2360,7 @@ if($data['t11'] > 0){ } else { $artifact = $database->getOwnArtefactInfo($data['to']); if ($artifact['vref'] == $data['to']) { - if ($database->canClaimArtifact($data['from'],$artifact['vref'],$artifact['size'])) { + if ($database->canClaimArtifact($data['from'],$artifact['vref'],$artifact['size'],$artifact['type'])) { $database->claimArtefact($data['from'],$data['to'],$database->getVillageField($data['from'],"owner")); $info_chief = $hero_pic.",Your hero is carrying home a artefact and gained ".$heroxp." XP from the battle"; } else { @@ -2370,10 +2421,10 @@ $crannyimg = " 0){ + $prisoners = $database->getPrisoners($to['wref']); + if(count($prisoners) > 0){ + $anothertroops = 0; + foreach($prisoners as $prisoner){ + $p_owner = $database->getVillageField($prisoner['from'],"owner"); + if($p_owner == $from['owner']){ + $database->modifyAttack2($data['ref'],1,$prisoner['t1']); + $database->modifyAttack2($data['ref'],2,$prisoner['t2']); + $database->modifyAttack2($data['ref'],3,$prisoner['t3']); + $database->modifyAttack2($data['ref'],4,$prisoner['t4']); + $database->modifyAttack2($data['ref'],5,$prisoner['t5']); + $database->modifyAttack2($data['ref'],6,$prisoner['t6']); + $database->modifyAttack2($data['ref'],7,$prisoner['t7']); + $database->modifyAttack2($data['ref'],8,$prisoner['t8']); + $database->modifyAttack2($data['ref'],9,$prisoner['t9']); + $database->modifyAttack2($data['ref'],10,$prisoner['t10']); + $database->modifyAttack2($data['ref'],11,$prisoner['t11']); + $mytroops = $prisoner['t1']+$prisoner['t2']+$prisoner['t3']+$prisoner['t4']+$prisoner['t5']+$prisoner['t6']+$prisoner['t7']+$prisoner['t8']+$prisoner['t9']+$prisoner['t10']+$prisoner['t11']; + $newtraps = (round($mytroops/3))*2; + $database->modifyUnit($data['to'],array("99"),array($newtraps),array(0)); + $database->modifyUnit($data['to'],array("99o"),array($mytroops),array(0)); + }else{ + $p_alliance = $database->getUserField($p_owner,"alliance",0); + $friendarray = $database->getAllianceAlly($p_alliance,1); + $neutralarray = $database->getAllianceAlly($p_alliance,2); + $friend = (($friendarray[0]['alli1']>0 and $friendarray[0]['alli2']>0 and $p_alliance>0) and ($friendarray[0]['alli1']==$ownally or $friendarray[0]['alli2']==$ownally) and ($ownally != $p_alliance and $ownally and $p_alliance)) ? '1':'0'; + $neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $p_alliance>0) and ($neutralarray[0]['alli1']==$ownally or $neutralarray[0]['alli2']==$ownally) and ($ownally != $p_alliance and $ownally and $p_alliance)) ? '1':'0'; + if($p_alliance == $ownally or $friend == 1 or $neutral == 1){ + $p_tribe = $database->getUserField($p_owner,"tribe",0); + + $p_eigen = $database->getCoor($prisoner['wref']); + $p_from = array('x'=>$p_eigen['x'], 'y'=>$p_eigen['y']); + $p_ander = $database->getCoor($prisoner['from']); + $p_to = array('x'=>$p_ander['x'], 'y'=>$p_ander['y']); + $p_tribe = $database->getUserField($p_owner,"tribe",0); + + $p_speeds = array(); + + //find slowest unit. + for($i=1;$i<=10;$i++){ + if ($prisoner['t'.$i]){ + if($prisoner['t'.$i] != '' && $prisoner['t'.$i] > 0){ + if($p_unitarray) { reset($p_unitarray); } + $p_unitarray = $GLOBALS["u".(($p_tribe-1)*10+$i)]; + $p_speeds[] = $p_unitarray['speed']; + } + } + } + + if ($prisoner['t11']>0){ + $p_qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$p_owner.""; + $p_resulth = mysql_query($p_qh); + $p_hero_f=mysql_fetch_array($p_resulth); + $p_hero_unit=$p_hero_f['unit']; + $p_speeds[] = $GLOBALS['u'.$p_hero_unit]['speed']; + } + + $p_artefact = count($database->getOwnUniqueArtefactInfo2($p_owner,2,3,0)); + $p_artefact1 = count($database->getOwnUniqueArtefactInfo2($prisoner['from'],2,1,1)); + $p_artefact2 = count($database->getOwnUniqueArtefactInfo2($p_owner,2,2,0)); + if($p_artefact > 0){ + $p_fastertroops = 3; + }else if($p_artefact1 > 0){ + $p_fastertroops = 2; + }else if($p_artefact2 > 0){ + $p_fastertroops = 1.5; + }else{ + $p_fastertroops = 1; + } + $p_time = round($this->procDistanceTime($p_to,$p_from,min($p_speeds),1)/$p_fastertroops); + $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']; + $newtraps = (round($anothertroops/3))*2; + $database->modifyUnit($data['to'],array("99"),array($newtraps),array(0)); + $database->modifyUnit($data['to'],array("99o"),array($anothertroops),array(0)); + } + } + $database->deletePrisoners($prisoner['id']); + } + $trapper_pic = "\"Trap\""; + $p_username = $database->getUserField($from['owner'],"username",0); + if($mytroops > 0 && $anothertroops > 0){ + $info_trap = "".$trapper_pic." ".$p_username." released ".$mytroops." from his troops and ".$anothertroops." friendly troops."; + }elseif($mytroops > 0){ + $info_trap = "".$trapper_pic." ".$p_username." released ".$mytroops." from his troops."; + }elseif($anothertroops > 0){ + $info_trap = "".$trapper_pic." ".$p_username." released ".$anothertroops." friendly troops."; + } + } + } + $data2 = $data2.','.$info_trap.',,'; if($totalsend_alldef == 0){ $database->addNotice($to['owner'],$to['wref'],$targetally,7,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime); }else if($totaldead_alldef == 0){ @@ -2413,12 +2557,11 @@ $crannyimg = " 0) { $artefact = count($database->getOwnUniqueArtefactInfo2($from['owner'],2,3,0)); - $artefact1 = count($database->getOwnUniqueArtefactInfo2($from['vref'],2,1,1)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($from['wref'],2,1,1)); $artefact2 = count($database->getOwnUniqueArtefactInfo2($from['owner'],2,2,0)); if($artefact > 0){ $fastertroops = 3; @@ -2434,7 +2577,7 @@ $crannyimg = "addNotice($from['owner'],$to['wref'],$ownally,18,''.addslashes($from['name']).' scouts '.addslashes($to['name']).'',$data2,$AttackArrivalTime); }else { - if ($totaldead_att == 0){ + if ($totaldead_att == 0 && $totaltraped_att == 0){ $database->addNotice($from['owner'],$to['wref'],$ownally,1,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime); }else{ $database->addNotice($from['owner'],$to['wref'],$ownally,2,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime); @@ -2593,6 +2736,7 @@ $crannyimg = "getPrisoners($base); + if(!empty($prisoners)) { + foreach($prisoners as $prisoner){ + $owner = $database->getVillageField($base,"owner"); + $ownertribe = $database->getUserField($owner,"tribe",0); + $start = ($ownertribe-1)*10+1; + $end = ($ownertribe*10); + for($i=$start;$i<=$end;$i++) { + $j = $i-$start+1; + $ownunit['u'.$i] += $prisoner['t'.$j]; + } + $ownunit['hero'] += $prisoner['t11']; + } + } return $ownunit; } @@ -3293,7 +3451,7 @@ $crannyimg = "getResourceLevel($generator->getBaseID($coor['x'],$coor['y'])); $xdistance = ABS($thiscoor['x'] - $coor['x']); @@ -3846,7 +4004,7 @@ $crannyimg = "query_return($users); $ranking->procRankArray(); - if(count($ranking->getRank()) > 0){ + if(mysql_num_rows(mysql_query($users)) > 0){ $q = "SELECT * FROM ".TB_PREFIX."medal order by week DESC LIMIT 0, 1"; $result = mysql_query($q); if(mysql_num_rows($result)) { @@ -3856,7 +4014,7 @@ $crannyimg = "searchRank($session['username'], "username"); + $oldrank = $ranking->getUserRank($session['id']); if($week > 1){ if($session['oldrank'] > $oldrank) { $totalpoints = $session['oldrank'] - $oldrank; @@ -3869,8 +4027,8 @@ $crannyimg = "updateoldrank($session['id'], $oldrank); } }else{ - $totalpoints = count($ranking->getRank()) - $oldrank; - $database->setclimberrankpop($session['id'], $totalpoints); + $totalpoints = mysql_num_rows(mysql_query($users)) - $oldrank; + $database->setclimberrankpop($session['id'], $totalpoints+1); $database->updateoldrank($session['id'], $oldrank); } $database->updateoldrank($session['id'], $oldrank); @@ -3913,17 +4071,7 @@ $crannyimg = " $max2"; + $q = "SELECT * FROM " . TB_PREFIX . "odata where conqured = 0 and $time - lastupdated > 3600"; $array = $database->query_return($q); foreach($array as $oasis) { $database->populateOasisUnits($oasis['wref'],$oasis['high']); diff --git a/GameEngine/Battle.php b/GameEngine/Battle.php index 673fa615..82cb134c 100644 --- a/GameEngine/Battle.php +++ b/GameEngine/Battle.php @@ -82,13 +82,11 @@ class Battle { // Establecemos los arrays con las unidades del atacante y defensor $attacker = array('u1'=>0,'u2'=>0,'u3'=>0,'u4'=>0,'u5'=>0,'u6'=>0,'u7'=>0,'u8'=>0,'u9'=>0,'u10'=>0,'u11'=>0,'u12'=>0,'u13'=>0,'u14'=>0,'u15'=>0,'u16'=>0,'u17'=>0,'u18'=>0,'u19'=>0,'u20'=>0,'u21'=>0,'u22'=>0,'u23'=>0,'u24'=>0,'u25'=>0,'u26'=>0,'u27'=>0,'u28'=>0,'u29'=>0,'u30'=>0,'u31'=>0,'u32'=>0,'u33'=>0,'u34'=>0,'u35'=>0,'u36'=>0,'u37'=>0,'u38'=>0,'u39'=>0,'u40'=>0,'u41'=>0,'u42'=>0,'u43'=>0,'u44'=>0,'u45'=>0,'u46'=>0,'u47'=>0,'u48'=>0,'u49'=>0,'u50'=>0); $start = ($post['a1_v']-1)*10+1; - $att_ab = array('a1'=>0,'a2'=>0,'a3'=>0,'a4'=>0,'a5'=>0,'a6'=>0,'a7'=>0,'a8'=>0); - $def_ab = array('b1'=>0,'b2'=>0,'b3'=>0,'b4'=>0,'b5'=>0,'b6'=>0,'b7'=>0,'b8'=>0); $index = 1; for($i=$start;$i<=($start+9);$i++) { $attacker['u'.$i] = $post['a1_'.$index]; if($index <=8) { - $att_ab['a'.$index] = $post['f1_'.$index]; + ${att_ab.$index} = $post['f1_'.$index]; } $index += 1; } @@ -106,33 +104,28 @@ class Battle { switch($deftribe) { case 1: for($i=1;$i<=8;$i++) { - $def_ab['b'.$i] = $post['f2_'.$i]; + ${def_ab.$i} = $post['f2_'.$i]; } - $wall = $post['wall1']; break; case 2: for($i=11;$i<=18;$i++) { - $def_ab['b'.$i] = $post['f2_'.$i]; + ${def_ab.$i-10} = $post['f2_'.$i]; } - $wall = $post['wall2']; break; case 3: for($i=21;$i<=28;$i++) { - $def_ab['b'.$i] = $post['f2_'.$i]; + ${def_ab.$i-20} = $post['f2_'.$i]; } - $wall = $post['wall3']; break; case 4: for($i=31;$i<=38;$i++) { - $def_ab['b'.$i] = $post['f2_'.$i]; + ${def_ab.$i-30} = $post['f2_'.$i]; } - $wall = $post['wall4']; break; case 5: for($i=41;$i<=48;$i++) { - $def_ab['b'.$i] = $post['f2_'.$i]; + ${def_ab.$i-40} = $post['f2_'.$i]; } - $wall = $post['wall5']; break; } if($post['kata'] == "") { @@ -152,11 +145,27 @@ class Battle { } } } - + if($post['wall1'] != 0){ + $walllevel = $post['wall1']; + }elseif($post['wall2'] != 0){ + $walllevel = $post['wall2']; + }elseif($post['wall3'] != 0){ + $walllevel = $post['wall3']; + }elseif($post['wall4'] != 0){ + $walllevel = $post['wall4']; + }elseif($post['wall5'] != 0){ + $walllevel = $post['wall5']; + }else{ + $walllevel = 0; + } + if($walllevel > 20){ + $walllevel = 0; + } + $wall = $walllevel; if(!$scout) - return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],$post['ktyp']+3,$def_ab,$att_ab,$post['kata'],1,0,0,0,0); + return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],$post['ktyp']+3,$def_ab1,$def_ab2,$def_ab3,$def_ab4,$def_ab5,$def_ab6,$def_ab7,$def_ab8,$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); else - return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],1,$def_ab,$att_ab,$post['kata'],1,0,0,0,0); + return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],1,$def_ab1,$def_ab2,$def_ab3,$def_ab4,$def_ab5,$def_ab6,$def_ab7,$def_ab8,$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); } public function getTypeLevel($tid,$vid) { @@ -207,7 +216,7 @@ class Battle { } //1 raid 0 normal - function calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab,$att_ab,$tblevel,$stonemason,$walllevel,$AttackerID,$DefenderID,$AttackerWref,$DefenderWref) { + function calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab1,$def_ab2,$def_ab3,$def_ab4,$def_ab5,$def_ab6,$def_ab7,$def_ab8,$att_ab1,$att_ab2,$att_ab3,$att_ab4,$att_ab5,$att_ab6,$att_ab7,$att_ab8,$tblevel,$stonemason,$walllevel,$AttackerID,$DefenderID,$AttackerWref,$DefenderWref) { global $bid34,$bid35,$database; // Definieer de array met de eenheden $calvary = array(4,5,6,15,16,23,24,25,26,35,36,45,46); @@ -222,7 +231,30 @@ class Battle { $cap = $ap = $dp = $cdp = $rap = $rdp = 0; //exit($type); - + $att_artefact = count($database->getOwnUniqueArtefactInfo2($AttackerID,3,3,0)); + $att_artefact1 = count($database->getOwnUniqueArtefactInfo2($AttackerWref,3,1,1)); + $att_artefact2 = count($database->getOwnUniqueArtefactInfo2($AttackerID,3,2,0)); + if($att_artefact > 0){ + $attacker_artefact = 10; + }else if($att_artefact1 > 0){ + $attacker_artefact = 5; + }else if($att_artefact2 > 0){ + $attacker_artefact = 3; + }else{ + $attacker_artefact = 1; + } + $def_artefact = count($database->getOwnUniqueArtefactInfo2($DefenderID,3,3,0)); + $def_artefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,3,1,1)); + $def_artefact2 = count($database->getOwnUniqueArtefactInfo2($DefenderID,3,2,0)); + if($def_artefact > 0){ + $defender_artefact = 10; + }else if($att_artefact1 > 0){ + $defender_artefact = 5; + }else if($def_artefact2 > 0){ + $defender_artefact = 3; + }else{ + $defender_artefact = 1; + } if($Attacker['uhero'] != 0) { //exit($AttackerID); @@ -246,24 +278,26 @@ class Battle { // Berekenen het totaal aantal punten van Aanvaller $start = ($att_tribe-1)*10+1; $end = ($att_tribe*10); - - $abcount = 1; - + if($att_tribe == 3){ + $abcount = 3; + }else{ + $abcount = 4; + } + if($type == 1) { for($i=$start;$i<=$end;$i++) { global ${'u'.$i}; + $j = $i-$start+1; + if($abcount <= 8 && ${att_ab.$abcount} > 0) { - if($abcount <= 8 && $att_ab['a'.$abcount] > 0) { - - $ap += (35 + ( 35 + 300 * ${'u'.$i}['pop'] / 7) * (pow(1.007, $att_ab['a'.$abcount]) - 1)) * $Attacker['u'.$i]; + $ap += (35 + ( 35 + 300 * ${'u'.$i}['pop'] / 7) * (pow(1.007, ${att_ab.$abcount}) - 1)) * $Attacker['u'.$i] * $attacker_artefact; } else { - $ap += $Attacker['u'.$i] * 35; + $ap += ($Attacker['u'.$i] * $Attacker['u'.$i] * $Attacker['u'.$i])/3; } - $abcount +=1; $units['Att_unit'][$i] = $Attacker['u'.$i]; } @@ -274,15 +308,16 @@ class Battle { } else { + $abcount = 1; for($i=$start;$i<=$end;$i++) { global ${'u'.$i}; - - if($abcount <= 8 && $att_ab['a'.$abcount] > 0) { + $j = $i-$start+1; + if($abcount <= 8 && ${att_ab.$abcount} > 0) { if(in_array($i,$calvary)) { - $cap += (${'u'.$i}['atk'] + (${'u'.$i}['atk'] + 300 * ${'u'.$i}['pop'] / 7) * (pow(1.007, $att_ab['a'.$abcount]) - 1)) * $Attacker['u'.$i]; + $cap += (${'u'.$i}['atk'] + (${'u'.$i}['atk'] + 300 * ${'u'.$i}['pop'] / 7) * (pow(1.007, ${att_ab.$abcount}) - 1)) * $Attacker['u'.$i]; } else { - $ap += (${'u'.$i}['atk'] + (${'u'.$i}['atk'] + 300 * ${'u'.$i}['pop'] / 7) * (pow(1.007, $att_ab['a'.$abcount]) - 1)) * $Attacker['u'.$i]; + $ap += (${'u'.$i}['atk'] + (${'u'.$i}['atk'] + 300 * ${'u'.$i}['pop'] / 7) * (pow(1.007, ${att_ab.$abcount}) - 1)) * $Attacker['u'.$i]; } } else { @@ -334,15 +369,16 @@ class Battle { if($y == 4 || $y == 14 || $y == 23 || $y == 44) { global ${'u'.$y}; - if($y >= $start && $y <= ($end-2) && $def_ab['b'.$abcount] > 0) { - $dp += (20 + (20 + 300 * ${'u'.$y}['pop'] / 7) * (pow(1.007, $def_ab['b'.$y]) - 1)) * $Defender['u'.$y]; + 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; } else { - $dp += $Defender['u'.$y]*20; + $dp += ($Defender['u'.$y]*$Defender['u'.$y]*$Defender['u'.$y])/4; } $units['Def_unit'][$y] = $Defender['u'.$y]; } + } if ($Defender['hero'] != 0){ $dp += $defenderhero['di'] * 35; $dp = $dp * $defenderhero['db']; @@ -355,17 +391,15 @@ class Battle { $dp = $dp * $defhero[$fromvillage]['db']; } } - } } else { for($y=1;$y<=50;$y++) { global ${'u'.$y}; - if($y >= $start && $y <= ($end-2) && $def_ab['b'.$abcount] > 0) { - $dp += (${'u'.$y}['di'] + (${'u'.$y}['di'] + 300 * ${'u'.$y}['pop'] / 7) * (pow(1.007, $def_ab['b'.$y]) - 1)) * $Defender['u'.$y]; - $cdp += (${'u'.$y}['dc'] + (${'u'.$y}['dc'] + 300 * ${'u'.$y}['pop'] / 7) * (pow(1.007, $def_ab['b'.$y]) - 1)) * $Defender['u'.$y]; - $abcount +=1; + if($y >= $start && $y <= ($end-2) && ${def_ab.$abcount} > 0) { + $dp += (${'u'.$y}['di'] + (${'u'.$y}['di'] + 300 * ${'u'.$y}['pop'] / 7) * (pow(1.007, ${def_ab.$abcount}) - 1)) * $Defender['u'.$y]; + $cdp += (${'u'.$y}['dc'] + (${'u'.$y}['dc'] + 300 * ${'u'.$y}['pop'] / 7) * (pow(1.007, ${def_ab.$abcount}) - 1)) * $Defender['u'.$y]; } else { $dp += $Defender['u'.$y]*${'u'.$y}['di']; @@ -373,6 +407,7 @@ class Battle { } $involve += $Defender['u'.$y]; $units['Def_unit'][$y] = $Defender['u'.$y]; + $abcount +=1; } if($Defender['hero'] != 0) { @@ -404,13 +439,13 @@ class Battle { // Factor = 1025 Wall Galliers $factor = ($def_tribe == 1)? 1.030 : (($def_tribe == 2)? 1.020 : 1.025); // Defense Infanterie = infanterie * Muur (%) - $dp *= pow($factor,$def_wall); + $dp *= pow($factor,$def_wall)*2; // Defensa Cavelerie = Cavelerie * Muur (%) - $cdp *= pow($factor,$def_wall); + $cdp *= pow($factor,$def_wall)*2; // Berekening van de Basic defence bonus "Residence" - $dp += ((2*(pow($residence,2)))*(pow($factor,$def_wall))); - $cdp += ((2*(pow($residence,2)))*(pow($factor,$def_wall))); + $dp += ((2*(pow($residence,2)))*(pow($factor,$def_wall)))*0.5; + $cdp += ((2*(pow($residence,2)))*(pow($factor,$def_wall)))*0.5; } else { @@ -422,7 +457,11 @@ class Battle { // // Formule voor het berekenen van punten aanvallers (Infanterie & Cavalry) // + if($AttackerWref != 0){ $rap = ($ap+$cap)+(($ap+$cap)/100*$bid35[$this->getTypeLevel(35,$AttackerWref)]['attri']); + }else{ + $rap = $ap+$cap; + } // // Formule voor de berekening van Defensive Punten // @@ -561,7 +600,7 @@ class Battle { if($ram > 0 && $walllevel != 0) { $wctp = pow(($rap/$rdp),1.5); $wctp = ($wctp >= 1)? 1-0.5/$wctp : 0.5*$wctp; - $wctp *= $ram; + $wctp *= $ram/2; $artowner = $database->getVillageField($DefenderWref,"owner"); $bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0)); $bartefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,1,1,1)); @@ -684,6 +723,7 @@ class Battle { $max_bounty = 0; for($i=$start;$i<=$end;$i++) { + $j = $i-$start+1; $y = $i-(($att_tribe-1)*10); $max_bounty += ($Attacker['u'.$i]-$result['casualties_attacker'][$y])*${'u'.$i}['cap']; diff --git a/GameEngine/Building.php b/GameEngine/Building.php index faba2c6d..f13e6c50 100644 --- a/GameEngine/Building.php +++ b/GameEngine/Building.php @@ -29,7 +29,11 @@ class Building { $this->maxConcurrent += PLUS_MAX; } $this->LoadBuilding(); - + foreach($this->buildArray as $build) { + if($build['master']==1){ + $this->maxConcurrent += 1; + } + } } public function procBuild($get) { diff --git a/GameEngine/Database/db_MYSQL.php b/GameEngine/Database/db_MYSQL.php index df1d8fd5..b3ef59ed 100644 --- a/GameEngine/Database/db_MYSQL.php +++ b/GameEngine/Database/db_MYSQL.php @@ -1761,18 +1761,6 @@ class MYSQL_DB { if(count($jobs) > 2 && ($jobs[1]['field'] == $jobs[2]['field'])) { $SameBuildCount = 3; } - if(count($jobs) > 2 && ($jobs[0]['field'] == ($jobs[1]['field'] == $jobs[2]['field']))) { - $SameBuildCount = 4; - } - if(count($jobs) > 3 && ($jobs[0]['field'] == ($jobs[1]['field'] == $jobs[3]['field']))) { - $SameBuildCount = 5; - } - if(count($jobs) > 3 && ($jobs[0]['field'] == ($jobs[2]['field'] == $jobs[3]['field']))) { - $SameBuildCount = 6; - } - if(count($jobs) > 3 && ($jobs[1]['field'] == ($jobs[2]['field'] == $jobs[3]['field']))) { - $SameBuildCount = 7; - } if(count($jobs) > 3 && ($jobs[0]['field'] == $jobs[3]['field'])) { $SameBuildCount = 8; } @@ -1782,6 +1770,18 @@ class MYSQL_DB { if(count($jobs) > 3 && ($jobs[2]['field'] == $jobs[3]['field'])) { $SameBuildCount = 10; } + if(count($jobs) > 2 && ($jobs[0]['field'] == $jobs[1]['field'] && $jobs[1]['field'] == $jobs[2]['field'])) { + $SameBuildCount = 4; + } + if(count($jobs) > 3 && ($jobs[0]['field'] == $jobs[1]['field'] && $jobs[1]['field'] == $jobs[3]['field'])) { + $SameBuildCount = 5; + } + if(count($jobs) > 3 && ($jobs[0]['field'] == $jobs[2]['field'] && $jobs[2]['field'] == $jobs[3]['field'])) { + $SameBuildCount = 6; + } + if(count($jobs) > 3 && ($jobs[1]['field'] == $jobs[2]['field'] && $jobs[2]['field'] == $jobs[3]['field'])) { + $SameBuildCount = 7; + } if($SameBuildCount > 0) { if($SameBuildCount > 3){ if($SameBuildCount == 4 or $SameBuildCount == 5){ @@ -2157,6 +2157,12 @@ class MYSQL_DB { $q = "UPDATE " . TB_PREFIX . "attacks set $unit = $unit - $amt where id = $aid"; return mysql_query($q, $this->connection); } + + function modifyAttack2($aid, $unit, $amt) { + $unit = 't' . $unit; + $q = "UPDATE " . TB_PREFIX . "attacks set $unit = $unit + $amt where id = $aid"; + return mysql_query($q, $this->connection); + } function getRanking() { $q = "SELECT id,username,alliance,ap,apall,dp,dpall,access FROM " . TB_PREFIX . "users WHERE tribe<=3 AND access<" . (INCLUDE_ADMIN ? "10" : "8"); @@ -2877,7 +2883,7 @@ class MYSQL_DB { } function addArtefact($vref, $owner, $type, $size, $name, $desc, $effect, $img) { - $q = "INSERT INTO `" . TB_PREFIX . "artefacts` (`vref`, `owner`, `type`, `size`, `conquered`, `name`, `desc`, `effect`, `img`) VALUES ('$vref', '$owner', '$type', '$size', '" . time() . "', '$name', '$desc', '$effect', '$img')"; + $q = "INSERT INTO `" . TB_PREFIX . "artefacts` (`vref`, `owner`, `type`, `size`, `conquered`, `name`, `desc`, `effect`, `img`, `active`) VALUES ('$vref', '$owner', '$type', '$size', '" . time() . "', '$name', '$desc', '$effect', '$img', '0')"; return mysql_query($q, $this->connection); } @@ -2886,6 +2892,18 @@ class MYSQL_DB { $result = mysql_query($q, $this->connection); return mysql_fetch_array($result); } + + function getOwnArtefactInfo2($vref) { + $q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $vref"; + $result = mysql_query($q, $this->connection); + return $this->mysql_fetch_all($result); + } + + function getOwnArtefactInfo3($uid) { + $q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE owner = $uid"; + $result = mysql_query($q, $this->connection); + return $this->mysql_fetch_all($result); + } function getOwnArtefactInfoByType($vref, $type) { $q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $vref AND type = $type order by size"; @@ -2907,9 +2925,9 @@ class MYSQL_DB { function getOwnUniqueArtefactInfo2($id, $type, $size, $mode) { if(!$mode){ - $q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE owner = $id AND owner != 3 AND type = $type AND size=$size"; + $q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE owner = $id AND active = 1 AND type = $type AND size=$size"; }else{ - $q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $id AND owner != 3 AND type = $type AND size=$size"; + $q = "SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = $id AND active = 1 AND type = $type AND size=$size"; } $result = mysql_query($q, $this->connection); return $this->mysql_fetch_all($result); @@ -2923,11 +2941,19 @@ class MYSQL_DB { function claimArtefact($vref, $ovref, $id) { $time = time(); - $q = "UPDATE " . TB_PREFIX . "artefacts SET vref = $vref, owner = $id, conquered = $time WHERE vref = $ovref"; + $q = "UPDATE " . TB_PREFIX . "artefacts SET vref = $vref, owner = $id, conquered = $time, active = 1 WHERE vref = $ovref"; return mysql_query($q, $this->connection); } - public function canClaimArtifact($from,$vref,$type) { + public function canClaimArtifact($from,$vref,$type,$kind) { + $type2 = $type3 = 0; + if(count($this->getOwnUniqueArtefactInfo2($this->getVillagefield($from,"owner"),2,2,0)) > 0 && $type == 2){ + $type2 = 1; + } + if(count($this->getOwnUniqueArtefactInfo2($this->getVillagefield($from,"owner"),2,3,0)) > 0 && $type == 3){ + $type3 = 1; + } + if((count($this->getOwnArtefactInfo2($from)) < 3 && $type2 == 0 && $type3 == 0) or $kind == 11){ $DefenderFields = $this->getResourceLevel($vref); $defcanclaim = TRUE; for($i=19;$i<=38;$i++) { @@ -2977,6 +3003,9 @@ class MYSQL_DB { } else { return FALSE; } + }else{ + return FALSE; + } } function getArtefactDetails($id) { @@ -3217,6 +3246,46 @@ class MYSQL_DB { } return mysql_query($q, $this->connection); } + + function addPrisoners($wid,$from,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10,$t11) { + $q = "INSERT INTO " . TB_PREFIX . "prisoners values (0,$wid,$from,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10,$t11)"; + mysql_query($q, $this->connection); + return mysql_insert_id($this->connection); + } + + function updatePrisoners($wid,$from,$t1,$t2,$t3,$t4,$t5,$t6,$t7,$t8,$t9,$t10,$t11) { + $q = "UPDATE " . TB_PREFIX . "prisoners set t1 = t1 + $t1, t2 = t2 + $t2, t3 = t3 + $t3, t4 = t4 + $t4, t5 = t5 + $t5, t6 = t6 + $t6, t7 = t7 + $t7, t8 = t8 + $t8, t9 = t9 + $t9, t10 = t10 + $t10, t11 = t11 + $t11 where wid = $wid and from = $from"; + return mysql_query($q, $this->connection) or die(mysql_error()); + } + + function getPrisoners($wid) { + $q = "SELECT * FROM " . TB_PREFIX . "prisoners where wref = $wid"; + $result = mysql_query($q, $this->connection); + return $this->mysql_fetch_all($result); + } + + function getPrisoners2($wid,$from) { + $q = "SELECT * FROM " . TB_PREFIX . "prisoners where wref = $wid and " . TB_PREFIX . "prisoners.from = $from"; + $result = mysql_query($q, $this->connection); + return $this->mysql_fetch_all($result); + } + + function getPrisonersByID($id) { + $q = "SELECT * FROM " . TB_PREFIX . "prisoners where id = $id"; + $result = mysql_query($q, $this->connection); + return mysql_fetch_array($result); + } + + function getPrisoners3($from) { + $q = "SELECT * FROM " . TB_PREFIX . "prisoners where " . TB_PREFIX . "prisoners.from = $from"; + $result = mysql_query($q, $this->connection); + return $this->mysql_fetch_all($result); + } + + function deletePrisoners($id) { + $q = "DELETE from " . TB_PREFIX . "prisoners where id = '$id'"; + mysql_query($q, $this->connection); + } }; $database = new MYSQL_DB; diff --git a/GameEngine/Ranking.php b/GameEngine/Ranking.php index 0df7c2fd..27415eb2 100644 --- a/GameEngine/Ranking.php +++ b/GameEngine/Ranking.php @@ -18,12 +18,12 @@ return $this->rankarray; } - public function getUserRank($username) { + public function getUserRank($id) { $ranking = $this->getRank(); $start = $_SESSION['start']+1; if(count($ranking) > 0) { for($i=$start;$i<($start+20);$i++) { - if($ranking[$i]['username'] == $username && $ranking[$i] != "pad") { + if($ranking[$i]['userid'] == $id && $ranking[$i] != "pad") { $myrank = $i; } } @@ -87,7 +87,7 @@ } } else { $this->procRankArray(); - $this->getStart($this->searchRank($session->username, "username")); + $this->getStart($this->searchRank($session->uid, "userid")); } } @@ -194,7 +194,7 @@ )allitag FROM " . TB_PREFIX . "users WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " - ORDER BY totalpop DESC, totalvillages DESC"; + ORDER BY totalpop DESC, totalvillages DESC, userid DESC"; $result = (mysql_query($q)); @@ -247,7 +247,7 @@ )allitag FROM " . TB_PREFIX . "users WHERE " . TB_PREFIX . "users.tribe = $race AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " - ORDER BY totalpop DESC, totalvillages DESC"; + ORDER BY totalpop DESC, totalvillages DESC, userid DESC"; $result = (mysql_query($q)); @@ -306,7 +306,7 @@ )pop FROM " . TB_PREFIX . "users WHERE " . TB_PREFIX . "users.apall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3 - ORDER BY " . TB_PREFIX . "users.apall DESC, pop DESC"; + ORDER BY " . TB_PREFIX . "users.apall DESC, pop DESC, userid DESC"; $result = mysql_query($q) or die(mysql_error()); while($row = mysql_Fetch_assoc($result)) { $datas[] = $row; @@ -349,7 +349,7 @@ )pop FROM " . TB_PREFIX . "users WHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " - ORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC"; + ORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC, userid DESC"; $result = mysql_query($q) or die(mysql_error()); while($row = mysql_Fetch_assoc($result)) { $datas[] = $row; diff --git a/GameEngine/Technology.php b/GameEngine/Technology.php index eb5dac93..991423de 100644 --- a/GameEngine/Technology.php +++ b/GameEngine/Technology.php @@ -226,6 +226,20 @@ class Technology { $ownunit['hero'] += $enforce['hero']; } } + $prisoners = $database->getPrisoners($base); + if(!empty($prisoners)) { + foreach($prisoners as $prisoner){ + $owner = $database->getVillageField($base,"owner"); + $ownertribe = $database->getUserField($owner,"tribe",0); + $start = ($ownertribe-1)*10+1; + $end = ($ownertribe*10); + for($i=$start;$i<=$end;$i++) { + $j = $i-$start+1; + $ownunit['u'.$i] += $prisoner['t'.$j]; + } + $ownunit['hero'] += $prisoner['t11']; + } + } if(!$InVillageOnly) { $movement = $database->getVillageMovement($base); if(!empty($movement)) { @@ -351,7 +365,7 @@ class Technology { } } - public function getUpkeep($array,$type,$vid=0) { + public function getUpkeep($array,$type,$vid=0,$prisoners=0) { global $database,$session,$village; if($vid==0) { $vid=$village->wid; } $buildarray = array(); @@ -384,7 +398,9 @@ class Technology { 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++) { @@ -392,6 +408,7 @@ class Technology { $horsedrinking = $j; } } + if($prisoners == 0){ if(isset($horsedrinking)){ if(($i==4 && $buildarray['f'.$horsedrinking] >= 10) || ($i==5 && $buildarray['f'.$horsedrinking] >= 15) @@ -402,11 +419,27 @@ class Technology { }}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)); diff --git a/Templates/Alliance/overview.tpl b/Templates/Alliance/overview.tpl index e1a09c50..275220b3 100644 --- a/Templates/Alliance/overview.tpl +++ b/Templates/Alliance/overview.tpl @@ -83,7 +83,7 @@ include("alli_menu.tpl"); //if there is user rank defined, user will be printed else if($rank != ''){ echo ""; - echo "".$rank.""; + echo "".stripslashes($rank).""; echo "".$name.""; echo ""; } diff --git a/Templates/Build/16.tpl b/Templates/Build/16.tpl index 8c36bcde..fed0716d 100644 --- a/Templates/Build/16.tpl +++ b/Templates/Build/16.tpl @@ -150,6 +150,83 @@ if($units_incoming > 0 or $settlers_incoming > 0){ echo ""; } } + if(count($database->getPrisoners3($village->wid)) > 0) { + echo "

Prisoners

"; + foreach($database->getPrisoners3($village->wid) as $prisoners) { + $colspan = 10+$prisoners['t11']; + echo " + "; + $tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0); + $start = ($tribe-1)*10+1; + $end = ($tribe*10); + echo ""; + for($i=$start;$i<=($end);$i++) { + echo ""; + } + if($prisoners['t11']!=0){ + echo ""; + } + echo ""; + for($i=1;$i<=10;$i++) { + if($prisoners['t'.$i] == 0) { + echo ""; + } + if($prisoners['t11']!=0){ + echo ""; + } + echo " + "; + + echo "
+ getMapCheck($prisoners['wref'])."\">".$database->getVillageField($prisoners['wref'],"name").""; + echo "getMapCheck($prisoners['wref'])."\">prisoners in ".$database->getVillageField($prisoners['wref'],"name").""; + echo "
 getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" />\"Hero\"
Troops"; + } + else { + echo ""; + } + echo $prisoners['t'.$i]."".$prisoners['t11']."
Upkeep
".$technology->getUpkeep($prisoners,$tribe,0,1)."\"Crop\"per hour
"; + } + } + if(count($database->getPrisoners($village->wid)) > 0) { + echo "

Prisoners

"; + foreach($database->getPrisoners($village->wid) as $prisoners) { + $colspan = 10+$prisoners['t11']; + $colspan2 = 11+$prisoners['t11']; + echo " + "; + $tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0); + $start = ($tribe-1)*10+1; + $end = ($tribe*10); + echo ""; + for($i=$start;$i<=($end);$i++) { + echo ""; + } + if($prisoners['t11']!=0){ + echo ""; + } + echo ""; + for($i=1;$i<=10;$i++) { + if($prisoners['t'.$i] == 0) { + echo ""; + } + if($prisoners['t11']!=0){ + echo ""; + } + echo " + "; + + echo "
+ getMapCheck($prisoners['from'])."\">".$database->getVillageField($prisoners['from'],"name").""; + echo "getMapCheck($prisoners['from'])."\">prisoners from ".$database->getVillageField($prisoners['from'],"name").""; + echo "
 getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" />\"Hero\"
Troops"; + } + else { + echo ""; + } + echo $prisoners['t'.$i]."".$prisoners['t11']."
\"Crop\"
"; + } + } ?> "; } }}else{ - if($totalunits > $building->getTypeLevel(16)){ + $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,3,3,0)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,3,1,1)); + $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,3,2,0)); + $total_artefact = $artefact + $artefact1 + $artefact2; + if($totalunits > $building->getTypeLevel(16) && $total_artefact == 0){ echo "?"; }else{ if($units[$y]['t'.$i] == 0) { diff --git a/Templates/Build/27_1.tpl b/Templates/Build/27_1.tpl index d25e4dd2..9f69ecd7 100644 --- a/Templates/Build/27_1.tpl +++ b/Templates/Build/27_1.tpl @@ -1,10 +1,9 @@ getOwnArtefactInfo($village->wid); + $artefact1 = $database->getOwnArtefactInfo2($village->wid); $result = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "artefacts WHERE vref = " . $village->wid . "")); $wref = $village->wid; $coor = $database->getCoor($wref); - $coor2= $database->getCoor($artefact['vref']); function getDistance($coorx1, $coory1, $coorx2, $coory2) { $max = 2 * WORLD_MAX + 1; $x1 = intval($coorx1); @@ -33,12 +32,13 @@ - You do not own any artefacts.'; + echo 'You do not own any artefacts.'; } else { + foreach($artefact1 as $artefact){ + $coor2 = $database->getCoor($artefact['vref']); if($artefact['size'] == 1) { $reqlvl = 10; $effect = "village"; @@ -46,7 +46,7 @@ $reqlvl = 20; $effect = "account"; } - echo ''; + echo ''; echo '
' . $artefact['name'] . ' ' . $artefact['effect'] . '
@@ -54,11 +54,11 @@
'; echo '' . $database->getVillageField($artefact['vref'], "name") . ''; - echo '' . date("d/m/Y H:i", $artefact['conquered']) . ''; + echo '' . date("d/m/Y H:i", $artefact['conquered']) . ''; } + } ?> - diff --git a/Templates/Build/37_hero.tpl b/Templates/Build/37_hero.tpl index a6115973..efa5499c 100644 --- a/Templates/Build/37_hero.tpl +++ b/Templates/Build/37_hero.tpl @@ -135,10 +135,19 @@ if (isset($_POST['name'])) { + Experience: % - <?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>% + <?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>% + + + Experience: + 100% + 100% + + + diff --git a/Templates/Build/avaliable.tpl b/Templates/Build/avaliable.tpl index 876a79cd..796da1f7 100644 --- a/Templates/Build/avaliable.tpl +++ b/Templates/Build/avaliable.tpl @@ -42,15 +42,6 @@ $herosmansion = $building->getTypeLevel(37); $greatwarehouse = $building->getTypeLevel(38); $greatgranary = $building->getTypeLevel(39); $greatworkshop = $building->getTypeLevel(42); -$ww = $building->getTypeLevel(40); -$wwinbuild = count($database->getBuildingByType($village->wid,40)); -$wwvillages = $database->getVillagesID($session->uid); -foreach($wwvillages as $wwvillage){ -$plan = count($database->getOwnArtefactInfoByType2($wwvillage,11)); -if($plan > 0){ -$wwbuildingplan += 1; -} -} foreach ($database->getJobs($_SESSION['wid']) as $bdata) { $UnderConstruction = strtolower(str_replace(array(" ","'"),"",$building->procResType($bdata['type']))); @@ -61,9 +52,6 @@ foreach ($database->getJobs($_SESSION['wid']) as $bdata) { ?>

Construct new building

natar == 1 && $wwbuildingplan > 0){ - include("avaliable/ww.tpl"); -} if($mainbuilding == 0 && $id != 39 && $id != 40) { include("avaliable/mainbuilding.tpl"); } diff --git a/Templates/Notice/1.tpl b/Templates/Notice/1.tpl index a09aad47..a3ad9c66 100644 --- a/Templates/Notice/1.tpl +++ b/Templates/Notice/1.tpl @@ -1,6 +1,5 @@ readingNotice['data']); -//var_dump($dataarray); if(isset($dataarray[147]) and $dataarray[147]!=0){$colspan="11";}else{$colspan="10";} if(isset($dataarray[149]) and $dataarray[149]!=0){$colspan2="11";}else{$colspan2="10";} ?> @@ -66,6 +65,21 @@ if(isset($dataarray[147]) and $dataarray[147]!=0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -94,6 +108,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief + + Information + + + Bounty
Lumber | Clay | Iron | Crop
carry
diff --git a/Templates/Notice/1x.tpl b/Templates/Notice/1x.tpl index c80ac752..7d4eb444 100644 --- a/Templates/Notice/1x.tpl +++ b/Templates/Notice/1x.tpl @@ -68,6 +68,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -89,8 +104,15 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief Chief - - + Information + + + + Information diff --git a/Templates/Notice/2.tpl b/Templates/Notice/2.tpl index a09aad47..a3ad9c66 100644 --- a/Templates/Notice/2.tpl +++ b/Templates/Notice/2.tpl @@ -1,6 +1,5 @@ readingNotice['data']); -//var_dump($dataarray); if(isset($dataarray[147]) and $dataarray[147]!=0){$colspan="11";}else{$colspan="10";} if(isset($dataarray[149]) and $dataarray[149]!=0){$colspan2="11";}else{$colspan2="10";} ?> @@ -66,6 +65,21 @@ if(isset($dataarray[147]) and $dataarray[147]!=0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -94,6 +108,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief + + Information + + + Bounty
Lumber | Clay | Iron | Crop
carry
diff --git a/Templates/Notice/2x.tpl b/Templates/Notice/2x.tpl index c80ac752..7d4eb444 100644 --- a/Templates/Notice/2x.tpl +++ b/Templates/Notice/2x.tpl @@ -68,6 +68,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -89,8 +104,15 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief Chief - - + Information + + + + Information diff --git a/Templates/Notice/3.tpl b/Templates/Notice/3.tpl index f03a4637..9d8c1b92 100644 --- a/Templates/Notice/3.tpl +++ b/Templates/Notice/3.tpl @@ -67,8 +67,25 @@ if(isset($dataarray[151]) and $dataarray[151]!=0){ if ($dataarray[152]==0){$tdclass='class="none"';} echo "$dataarray[152]"; } +if($dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0 or $dataarray[161] != 0 or $dataarray[162] != 0){ +echo "Prisoners"; +for($i=153;$i<=162;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[163]) and $dataarray[163]!=0){ + if ($dataarray[163]==0){$tdclass='class="none"';} + echo "$dataarray[163]"; +} +} echo ""; ?> - + + + $dataarray[152]"; } +if($dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0 or $dataarray[161] != 0 or $dataarray[162] != 0){ +echo "Prisoners"; +for($i=153;$i<=162;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[163]) and $dataarray[163]!=0){ + if ($dataarray[163]==0){$tdclass='class="none"';} + echo "$dataarray[163]"; +} +} echo ""; ?> diff --git a/Templates/Notice/4.tpl b/Templates/Notice/4.tpl index a09aad47..a3ad9c66 100644 --- a/Templates/Notice/4.tpl +++ b/Templates/Notice/4.tpl @@ -1,6 +1,5 @@ readingNotice['data']); -//var_dump($dataarray); if(isset($dataarray[147]) and $dataarray[147]!=0){$colspan="11";}else{$colspan="10";} if(isset($dataarray[149]) and $dataarray[149]!=0){$colspan2="11";}else{$colspan2="10";} ?> @@ -66,6 +65,21 @@ if(isset($dataarray[147]) and $dataarray[147]!=0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -94,6 +108,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief + + Information + + + Bounty
Lumber | Clay | Iron | Crop
carry
diff --git a/Templates/Notice/4x.tpl b/Templates/Notice/4x.tpl index c80ac752..7d4eb444 100644 --- a/Templates/Notice/4x.tpl +++ b/Templates/Notice/4x.tpl @@ -68,6 +68,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -89,8 +104,15 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief Chief - - + Information + + + + Information diff --git a/Templates/Notice/5.tpl b/Templates/Notice/5.tpl index a09aad47..a3ad9c66 100644 --- a/Templates/Notice/5.tpl +++ b/Templates/Notice/5.tpl @@ -1,6 +1,5 @@ readingNotice['data']); -//var_dump($dataarray); if(isset($dataarray[147]) and $dataarray[147]!=0){$colspan="11";}else{$colspan="10";} if(isset($dataarray[149]) and $dataarray[149]!=0){$colspan2="11";}else{$colspan2="10";} ?> @@ -66,6 +65,21 @@ if(isset($dataarray[147]) and $dataarray[147]!=0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -94,6 +108,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief + + Information + + + Bounty
Lumber | Clay | Iron | Crop
carry
diff --git a/Templates/Notice/5x.tpl b/Templates/Notice/5x.tpl index c80ac752..7d4eb444 100644 --- a/Templates/Notice/5x.tpl +++ b/Templates/Notice/5x.tpl @@ -68,6 +68,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -89,8 +104,15 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief Chief - - + Information + + + + Information diff --git a/Templates/Notice/6.tpl b/Templates/Notice/6.tpl index a09aad47..a3ad9c66 100644 --- a/Templates/Notice/6.tpl +++ b/Templates/Notice/6.tpl @@ -1,6 +1,5 @@ readingNotice['data']); -//var_dump($dataarray); if(isset($dataarray[147]) and $dataarray[147]!=0){$colspan="11";}else{$colspan="10";} if(isset($dataarray[149]) and $dataarray[149]!=0){$colspan2="11";}else{$colspan2="10";} ?> @@ -66,6 +65,21 @@ if(isset($dataarray[147]) and $dataarray[147]!=0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -94,6 +108,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief + + Information + + + Bounty
Lumber | Clay | Iron | Crop
carry
diff --git a/Templates/Notice/6x.tpl b/Templates/Notice/6x.tpl index c80ac752..7d4eb444 100644 --- a/Templates/Notice/6x.tpl +++ b/Templates/Notice/6x.tpl @@ -68,6 +68,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -89,8 +104,15 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief Chief - - + Information + + + + Information diff --git a/Templates/Notice/7.tpl b/Templates/Notice/7.tpl index 61dd5d40..593b0815 100644 --- a/Templates/Notice/7.tpl +++ b/Templates/Notice/7.tpl @@ -62,6 +62,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -90,6 +105,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief + + Information + + + Bounty
Lumber | Clay | Iron | Crop
carry
diff --git a/Templates/Notice/7x.tpl b/Templates/Notice/7x.tpl index 937b671b..42f8b0dd 100644 --- a/Templates/Notice/7x.tpl +++ b/Templates/Notice/7x.tpl @@ -67,6 +67,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){ if ($dataarray[148]==0){$tdclass='class="none"';} echo "$dataarray[148]"; } +if($dataarray[151] != 0 or $dataarray[152] != 0 or $dataarray[153] != 0 or $dataarray[154] != 0 or $dataarray[155] != 0 or $dataarray[156] != 0 or $dataarray[157] != 0 or $dataarray[158] != 0 or $dataarray[159] != 0 or $dataarray[160] != 0){ +echo "Prisoners"; +for($i=151;$i<=160;$i++) { + if($dataarray[$i] == 0) { + echo "0"; + } + else { + echo "".$dataarray[$i].""; + } +} +if(isset($dataarray[161]) and $dataarray[161]!=0){ + if ($dataarray[161]==0){$tdclass='class="none"';} + echo "$dataarray[161]"; +} +} echo ""; if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram ?> @@ -88,13 +103,20 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief Chief - - Information + + Information + + + Bounty
Lumber | Clay | Iron | Crop
carry
diff --git a/Templates/Profile/overview.tpl b/Templates/Profile/overview.tpl index 49bcda6b..af4a872c 100644 --- a/Templates/Profile/overview.tpl +++ b/Templates/Profile/overview.tpl @@ -60,7 +60,7 @@ include("menu2.tpl"); Rank - getUserRank($displayarray['username']); ?> + getUserRank($displayarray['id']); ?> Tribe diff --git a/Templates/Simulator/att_1.tpl b/Templates/Simulator/att_1.tpl index 6e3c0380..04b3fb04 100644 --- a/Templates/Simulator/att_1.tpl +++ b/Templates/Simulator/att_1.tpl @@ -19,7 +19,7 @@ Legionnaire - + @@ -31,7 +31,7 @@ Praetorian - + @@ -43,7 +43,7 @@ Imperian - + @@ -56,7 +56,7 @@ Equites Legati - + @@ -68,7 +68,7 @@ Equites Imperatoris - + @@ -80,7 +80,7 @@ Equites Caesaris - + @@ -92,7 +92,7 @@ Battering Ram - + @@ -104,7 +104,7 @@ Fire Catapult - + diff --git a/Templates/Simulator/att_2.tpl b/Templates/Simulator/att_2.tpl index 28423d0d..c15bd3b2 100644 --- a/Templates/Simulator/att_2.tpl +++ b/Templates/Simulator/att_2.tpl @@ -19,7 +19,7 @@ Clubswinger - + @@ -31,7 +31,7 @@ Spearman - + @@ -43,7 +43,7 @@ Axeman - + @@ -56,7 +56,7 @@ Scout - + @@ -68,7 +68,7 @@ Paladin - + @@ -80,7 +80,7 @@ Teutonic Knight - + @@ -92,7 +92,7 @@ Ram - + @@ -104,7 +104,7 @@ Catapult - + diff --git a/Templates/Simulator/def_1.tpl b/Templates/Simulator/def_1.tpl index 6a7bdb07..3ff63087 100644 --- a/Templates/Simulator/def_1.tpl +++ b/Templates/Simulator/def_1.tpl @@ -13,7 +13,7 @@ Legionnaire - + @@ -25,7 +25,7 @@ Praetorian - + @@ -37,7 +37,7 @@ Imperian - + @@ -50,7 +50,7 @@ Equites Legati - + @@ -62,7 +62,7 @@ Equites Imperatoris - + @@ -74,7 +74,7 @@ Equites Caesaris - + @@ -86,7 +86,7 @@ Battering Ram - + @@ -98,7 +98,7 @@ Fire Catapult - + diff --git a/Templates/Simulator/def_2.tpl b/Templates/Simulator/def_2.tpl index c6eddddb..a6ed8d42 100644 --- a/Templates/Simulator/def_2.tpl +++ b/Templates/Simulator/def_2.tpl @@ -13,7 +13,7 @@ Clubswinger - + @@ -25,7 +25,7 @@ Spearman - + @@ -37,7 +37,7 @@ Axeman - + @@ -50,7 +50,7 @@ Scout - + @@ -62,7 +62,7 @@ Paladin - + @@ -74,7 +74,7 @@ Teutonic Knight - + @@ -86,7 +86,7 @@ Ram - + @@ -98,7 +98,7 @@ Catapult - + diff --git a/Templates/Simulator/def_3.tpl b/Templates/Simulator/def_3.tpl index 775c8409..4d1c526f 100644 --- a/Templates/Simulator/def_3.tpl +++ b/Templates/Simulator/def_3.tpl @@ -13,7 +13,7 @@ Phalanx - + @@ -25,7 +25,7 @@ Swordsman - + @@ -37,7 +37,7 @@ Pathfinder - + @@ -50,7 +50,7 @@ Theutates Thunder - + @@ -62,7 +62,7 @@ Druidrider - + @@ -74,7 +74,7 @@ Haeduan - + @@ -86,7 +86,7 @@ Ram - + @@ -98,7 +98,7 @@ Trebuchet - + diff --git a/Templates/Simulator/def_end.tpl b/Templates/Simulator/def_end.tpl index 4877a55f..7e7aa6ca 100644 --- a/Templates/Simulator/def_end.tpl +++ b/Templates/Simulator/def_end.tpl @@ -15,27 +15,42 @@ \"City City Wall - + "; } if(in_array(2,$target)) { + if($_POST['wall2'] != 0){ + $wall2 = $_POST['wall2']; + }else{ + $wall2 = 0; + } echo " \"Earth Earth Wall - + "; } if(in_array(3,$target)) { + if($_POST['wall3'] != 0){ + $wall3 = $_POST['wall3']; + }else{ + $wall3 = 0; + } echo " \"Palisade\" Palisade - + "; diff --git a/Templates/a2b/attack.tpl b/Templates/a2b/attack.tpl index efeefcad..971eaf22 100644 --- a/Templates/a2b/attack.tpl +++ b/Templates/a2b/attack.tpl @@ -170,7 +170,7 @@ $end = ($tribe*10); Options - Scout resources and troops
+ ">Scout resources and troops
Scout defences and troops @@ -182,7 +182,7 @@ $end = ($tribe*10); Destination: - + "> Scout resources and troops
+ ">Scout resources and troops
Scout defences and troops @@ -186,7 +186,7 @@ $actionType = "Raid"; Destination: - + "> getTypeLevel(16) == 20) { ?>