big update

This commit is contained in:
unknown
2012-07-03 05:27:14 +03:00
parent 8de9d72021
commit b578e44608
49 changed files with 1001 additions and 228 deletions
+9 -1
View File
@@ -38,7 +38,15 @@ if($msg)
<div class="clear"></div>
<div class="line"></div>
<div class="message" style="min-height: 10px;">
<?php echo $msg[0]['message'];?>
<?php
$input = $msg[0]['message'];
$alliance = $msg[0]['alliance'];
$player = $msg[0]['player'];
$coor = $msg[0]['coor'];
$report = $msg[0]['report'];
include("../GameEngine/BBCode.php");
echo stripslashes(nl2br($bbcoded));
?>
</div>
</div>
<div id="read_foot" class="msg_foot"></div>
+1 -2
View File
@@ -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);
+199 -51
View File
@@ -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 <b>".$walllevel."</b> to level <b>".$totallvl."</b>.";
$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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
}
$data2 = ''.$from['owner'].','.$from['wref'].','.$owntribe.','.$unitssend_att.','.$unitsdead_att.',0,0,0,0,0,'.$to['owner'].','.$to['wref'].','.addslashes($to['name']).','.$targettribe.',,,'.$rom.','.$unitssend_def[1].','.$unitsdead_def[1].','.$ger.','.$unitssend_def[2].','.$unitsdead_def[2].','.$gal.','.$unitssend_def[3].','.$unitsdead_def[3].','.$nat.','.$unitssend_def[4].','.$unitsdead_def[4].','.$natar.','.$unitssend_def[5].','.$unitsdead_def[5].','.$info_ram.','.$info_cat.','.$info_chief.','.$info_spy.',,'.$data['t11'].','.$dead11.','.$herosend_def.','.$deadhero.',,';
$data2 = ''.$from['owner'].','.$from['wref'].','.$owntribe.','.$unitssend_att.','.$unitsdead_att.',0,0,0,0,0,'.$to['owner'].','.$to['wref'].','.addslashes($to['name']).','.$targettribe.',,,'.$rom.','.$unitssend_def[1].','.$unitsdead_def[1].','.$ger.','.$unitssend_def[2].','.$unitsdead_def[2].','.$gal.','.$unitssend_def[3].','.$unitsdead_def[3].','.$nat.','.$unitssend_def[4].','.$unitsdead_def[4].','.$natar.','.$unitssend_def[5].','.$unitsdead_def[5].','.$info_ram.','.$info_cat.','.$info_chief.','.$info_spy.',,'.$data['t11'].','.$dead11.','.$herosend_def.','.$deadhero.','.$unitstraped_att;
}
else{
$data2 = ''.$from['owner'].','.$from['wref'].','.$owntribe.','.$unitssend_att.','.$unitsdead_att.','.$steal[0].','.$steal[1].','.$steal[2].','.$steal[3].','.$battlepart['bounty'].','.$to['owner'].','.$to['wref'].','.addslashes($to['name']).','.$targettribe.',,,'.$rom.','.$unitssend_def[1].','.$unitsdead_def[1].','.$ger.','.$unitssend_def[2].','.$unitsdead_def[2].','.$gal.','.$unitssend_def[3].','.$unitsdead_def[3].','.$nat.','.$unitssend_def[4].','.$unitsdead_def[4].','.$natar.','.$unitssend_def[5].','.$unitsdead_def[5].','.$info_ram.','.$info_cat.','.$info_chief.','.$info_spy.',,'.$data['t11'].','.$dead11.','.$herosend_def.','.$deadhero.',,';
$data2 = ''.$from['owner'].','.$from['wref'].','.$owntribe.','.$unitssend_att.','.$unitsdead_att.','.$steal[0].','.$steal[1].','.$steal[2].','.$steal[3].','.$battlepart['bounty'].','.$to['owner'].','.$to['wref'].','.addslashes($to['name']).','.$targettribe.',,,'.$rom.','.$unitssend_def[1].','.$unitsdead_def[1].','.$ger.','.$unitssend_def[2].','.$unitsdead_def[2].','.$gal.','.$unitssend_def[3].','.$unitsdead_def[3].','.$nat.','.$unitssend_def[4].','.$unitsdead_def[4].','.$natar.','.$unitssend_def[5].','.$unitsdead_def[5].','.$info_ram.','.$info_cat.','.$info_chief.','.$info_spy.',,'.$data['t11'].','.$dead11.','.$herosend_def.','.$deadhero.','.$unitstraped_att;
}
@@ -2381,7 +2432,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
// When all troops die, sends no info.
$data_fail = ''.$from['owner'].','.$from['wref'].','.$owntribe.','.$unitssend_att.','.$unitsdead_att.','.$steal[0].','.$steal[1].','.$steal[2].','.$steal[3].','.$battlepart['bounty'].','.$to['owner'].','.$to['wref'].','.addslashes($to['name']).','.$targettribe.',,,'.$rom.','.$unitssend_deff[1].','.$unitsdead_deff[1].','.$ger.','.$unitssend_deff[2].','.$unitsdead_deff[2].','.$gal.','.$unitssend_deff[3].','.$unitsdead_deff[3].','.$nat.','.$unitssend_deff[4].','.$unitsdead_deff[4].','.$natar.','.$unitssend_deff[5].','.$unitsdead_deff[5].',,,'.$data['t11'].','.$dead11.',,';
$data_fail = ''.$from['owner'].','.$from['wref'].','.$owntribe.','.$unitssend_att.','.$unitsdead_att.','.$steal[0].','.$steal[1].','.$steal[2].','.$steal[3].','.$battlepart['bounty'].','.$to['owner'].','.$to['wref'].','.addslashes($to['name']).','.$targettribe.',,,'.$rom.','.$unitssend_deff[1].','.$unitsdead_deff[1].','.$ger.','.$unitssend_deff[2].','.$unitsdead_deff[2].','.$gal.','.$unitssend_deff[3].','.$unitsdead_deff[3].','.$nat.','.$unitssend_deff[4].','.$unitsdead_deff[4].','.$natar.','.$unitssend_deff[5].','.$unitsdead_deff[5].',,,'.$data['t11'].','.$dead11.','.$unitstraped_att.',,';
//Undetected and detected in here.
if($scout){
@@ -2402,6 +2453,99 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
}
}
else {
if($type == 3 && $totalsend_att - ($totaldead_att+$totaltraped_att) > 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 = "<img src=\"".GP_LOCATE."img/u/98.gif\" alt=\"Trap\" title=\"Trap\" />";
$p_username = $database->getUserField($from['owner'],"username",0);
if($mytroops > 0 && $anothertroops > 0){
$info_trap = "".$trapper_pic." ".$p_username." released <b>".$mytroops."</b> from his troops and <b>".$anothertroops."</b> friendly troops.";
}elseif($mytroops > 0){
$info_trap = "".$trapper_pic." ".$p_username." released <b>".$mytroops."</b> from his troops.";
}elseif($anothertroops > 0){
$info_trap = "".$trapper_pic." ".$p_username." released <b>".$anothertroops."</b> 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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
}
}
//to here
// If the dead units not equal the ammount sent they will return and report
if($unitsdead_att != $unitssend_att or $dead11 != $herosend_att)
if($totalsend_att - ($totaldead_att+$totaltraped_att) > 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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
if($type == 1) {
$database->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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
,$totalsend_att
,$totalsend_alldef
,$totaldead_att
,$totaltraped_att
,$totaldead_def
,$unitsdead_att_check
,$totalattackdead
@@ -3047,6 +3191,20 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$ownunit['u'.$i] += $movement['u'.$i];
}
}
$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'];
}
}
return $ownunit;
}
@@ -3293,7 +3451,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
}
}
private function procDistanceTime($coor,$thiscoor,$ref,$mode) {
public function procDistanceTime($coor,$thiscoor,$ref,$mode) {
global $bid14,$database,$generator;
$resarray = $database->getResourceLevel($generator->getBaseID($coor['x'],$coor['y']));
$xdistance = ABS($thiscoor['x'] - $coor['x']);
@@ -3846,7 +4004,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$users = "SELECT * FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8") . "";
$array = $database->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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$week='1';
}
foreach($array as $session){
$oldrank = $ranking->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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$database->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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
private function regenerateOasisTroops() {
global $database;
$time = time();
$max = rand(1,4);
if($max == 1){
$max2 = 3600;
}elseif($max == 2){
$max2 = 21600;
}elseif($max == 3){
$max2 = 43200;
}elseif($max == 4){
$max2 = 86400;
}
$q = "SELECT * FROM " . TB_PREFIX . "odata where conqured = 0 and $time - lastupdated > $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']);
+83 -43
View File
@@ -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'];
+5 -1
View File
@@ -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) {
+86 -17
View File
@@ -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;
+7 -7
View File
@@ -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;
+34 -1
View File
@@ -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));
+1 -1
View File
@@ -83,7 +83,7 @@ include("alli_menu.tpl");
//if there is user rank defined, user will be printed
else if($rank != ''){
echo "<tr>";
echo "<th>".$rank."</th>";
echo "<th>".stripslashes($rank)."</th>";
echo "<td><a href='spieler.php?uid=".$member['id']."'>".$name."</td>";
echo "</tr>";
}
+77
View File
@@ -150,6 +150,83 @@ if($units_incoming > 0 or $settlers_incoming > 0){
echo "</tbody></table>";
}
}
if(count($database->getPrisoners3($village->wid)) > 0) {
echo "<h4>Prisoners</h4>";
foreach($database->getPrisoners3($village->wid) as $prisoners) {
$colspan = 10+$prisoners['t11'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">".$database->getVillageField($prisoners['wref'],"name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"karte.php?d=".$prisoners['wref']."&c=".$generator->getMapCheck($prisoners['wref'])."\">prisoners in ".$database->getVillageField($prisoners['wref'],"name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($prisoners['t11']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=1;$i<=10;$i++) {
if($prisoners['t'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $prisoners['t'.$i]."</td>";
}
if($prisoners['t11']!=0){
echo "<td>".$prisoners['t11']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><th>Upkeep</th><td colspan=\"$colspan\"><div class='sup'>".$technology->getUpkeep($prisoners,$tribe,0,1)."<img class=\"r4\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" />per hour</div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>Kill</a></div></td></tr>";
echo "</tbody></table>";
}
}
if(count($database->getPrisoners($village->wid)) > 0) {
echo "<h4>Prisoners</h4>";
foreach($database->getPrisoners($village->wid) as $prisoners) {
$colspan = 10+$prisoners['t11'];
$colspan2 = 11+$prisoners['t11'];
echo "<table class=\"troop_details\" cellpadding=\"1\" cellspacing=\"1\"><thead><tr><td class=\"role\">
<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">".$database->getVillageField($prisoners['from'],"name")."</a></td>
<td colspan=\"$colspan\">";
echo "<a href=\"karte.php?d=".$prisoners['from']."&c=".$generator->getMapCheck($prisoners['from'])."\">prisoners from ".$database->getVillageField($prisoners['from'],"name")."</a>";
echo "</td></tr></thead><tbody class=\"units\">";
$tribe = $database->getUserField($database->getVillageField($prisoners['from'],"owner"),"tribe",0);
$start = ($tribe-1)*10+1;
$end = ($tribe*10);
echo "<tr><th>&nbsp;</th>";
for($i=$start;$i<=($end);$i++) {
echo "<td><img src=\"img/x.gif\" class=\"unit u$i\" title=\"".$technology->getUnitName($i)."\" alt=\"".$technology->getUnitName($i)."\" /></td>";
}
if($prisoners['t11']!=0){
echo "<td><img src=\"img/x.gif\" class=\"unit uhero\" title=\"Hero\" alt=\"Hero\" /></td>";
}
echo "</tr><tr><th>Troops</th>";
for($i=1;$i<=10;$i++) {
if($prisoners['t'.$i] == 0) {
echo "<td class=\"none\">";
}
else {
echo "<td>";
}
echo $prisoners['t'.$i]."</td>";
}
if($prisoners['t11']!=0){
echo "<td>".$prisoners['t11']."</td>";
}
echo "</tr></tbody>
<tbody class=\"infos\"><tr><td colspan=\"11\"><div class='sup'><img class=\"r6\" src=\"img/x.gif\" title=\"Crop\" alt=\"Crop\" /></div><div class='sback'><a href='a2b.php?delprisoners=".$prisoners['id']."'>Send Back</a></div></td></tr>";
echo "</tbody></table>";
}
}
?>
<?php
+5 -1
View File
@@ -59,7 +59,11 @@ if ($units[$y]['sort_type']==3){
echo $units[$y]['t'.$i]."</td>";
}
}}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 "<td class=\"none\">?</td>";
}else{
if($units[$y]['t'.$i] == 0) {
+7 -7
View File
@@ -1,10 +1,9 @@
<?php
$artefact = $database->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 @@
</thead>
<tbody>
<tr>
<?php
if($result == 0) {
echo '<td colspan="4" class="none">You do not own any artefacts.</td>';
echo '<tr><td colspan="4" class="none">You do not own any artefacts.</td></tr>';
} 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 '<td class="icon"><img class="artefact_icon_' . $artefact['type'] . '" src="img/x.gif"></td>';
echo '<tr><td class="icon"><img class="artefact_icon_' . $artefact['type'] . '" src="img/x.gif"></td>';
echo '<td class="nam">
<a href="build.php?id=' . $id . '&show='.$artefact['id'].'">' . $artefact['name'] . '</a> <span class="bon">' . $artefact['effect'] . '</span>
<div class="info">
@@ -54,11 +54,11 @@
</div>
</td>';
echo '<td class="pla"><a href="karte.php?d=' . $artefact['vref'] . '&c=' . $generator->getMapCheck($artefact['vref']) . '">' . $database->getVillageField($artefact['vref'], "name") . '</a></td>';
echo '<td class="dist">' . date("d/m/Y H:i", $artefact['conquered']) . '</td>';
echo '<td class="dist">' . date("d/m/Y H:i", $artefact['conquered']) . '</td></tr>';
}
}
?>
</tr>
</tbody>
</table>
+10 -1
View File
@@ -135,10 +135,19 @@ if (isset($_POST['name'])) {
<td colspan="5" class="empty"></td>
</tr>
<tr>
<?php if($hero_info['experience'] < 495000){ ?>
<th title="until the next level">Experience:</th>
<td class="val"><?php echo (int) (($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100) ?>%</td>
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100*2 ?>px;" alt="<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>%" title="<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>%" /></td> <td class="up"></td>
<td class="xp"><img class="bar" src="img/x.gif" style="width:<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100*2 ?>px;" alt="<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>%" title="<?php echo ($hero_info['experience'] - $hero_levels[$hero_info['level']]) / ($hero_levels[$hero_info['level']+1] - $hero_levels[$hero_info['level']])*100 ?>%" /></td>
<td class="up"></td>
<td class="rem"><?php echo $hero_info['points']; ?></td>
<?php }else{ ?>
<th title="until the next level">Experience:</th>
<td class="val">100%</td>
<td class="xp"><img class="bar" src="img/x.gif" style="width:200px;" alt="100%" title="100%" /></td>
<td class="up"></td>
<td class="rem"><?php echo $hero_info['points']; ?></td>
<?php } ?>
</tr>
</tbody>
</table>
-12
View File
@@ -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) {
?>
<div id="build" class="gid0"><h1>Construct new building</h1>
<?php
if($ww == 0 && $wwinbuild == 0 && $village->natar == 1 && $wwbuildingplan > 0){
include("avaliable/ww.tpl");
}
if($mainbuilding == 0 && $id != 39 && $id != 40) {
include("avaliable/mainbuilding.tpl");
}
+22 -1
View File
@@ -1,6 +1,5 @@
<?php
$dataarray = explode(",",$message->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 "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -94,6 +108,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[162]; ?>
</td></tr></tbody>
<?php } ?>
<tbody class="goods"><tr><th>Bounty</th><td colspan="<?php echo $colspan; ?>">
<div class="res"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $dataarray[23]; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $dataarray[24]; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $dataarray[25]; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $dataarray[26]; ?></div><div class="carry"><img class="car" src="img/x.gif" alt="carry" title="carry" /><?php echo ($dataarray[23]+$dataarray[24]+$dataarray[25]+$dataarray[26])."/".$dataarray[27]; ?></div>
+24 -2
View File
@@ -68,6 +68,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){
if ($dataarray[148]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -89,8 +104,15 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<img class="unit u<?php echo $dataarray[143]; ?>" src="img/x.gif" alt="Chief" title="Chief" />
<?php echo $dataarray[144]; ?>
</td></tr></tbody>
<?php } ?>
<?php if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
<?php }
if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
+22 -1
View File
@@ -1,6 +1,5 @@
<?php
$dataarray = explode(",",$message->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 "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -94,6 +108,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[162]; ?>
</td></tr></tbody>
<?php } ?>
<tbody class="goods"><tr><th>Bounty</th><td colspan="<?php echo $colspan; ?>">
<div class="res"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $dataarray[23]; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $dataarray[24]; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $dataarray[25]; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $dataarray[26]; ?></div><div class="carry"><img class="car" src="img/x.gif" alt="carry" title="carry" /><?php echo ($dataarray[23]+$dataarray[24]+$dataarray[25]+$dataarray[26])."/".$dataarray[27]; ?></div>
+24 -2
View File
@@ -68,6 +68,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){
if ($dataarray[148]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -89,8 +104,15 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<img class="unit u<?php echo $dataarray[143]; ?>" src="img/x.gif" alt="Chief" title="Chief" />
<?php echo $dataarray[144]; ?>
</td></tr></tbody>
<?php } ?>
<?php if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
<?php }
if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
+18 -1
View File
@@ -67,8 +67,25 @@ if(isset($dataarray[151]) and $dataarray[151]!=0){
if ($dataarray[152]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[152]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=153;$i<=162;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[163]) and $dataarray[163]!=0){
if ($dataarray[163]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[163]</td>";
}
}
echo "</tr></tbody>"; ?>
</td></tr></tbody></table>
</td></tr></tbody>
</table>
<?php
$targettribe=$dataarray['31'];
+15
View File
@@ -70,6 +70,21 @@ if ($dataarray[151]!="" or $dataarray[151]!=0){
if ($dataarray[152]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[152]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=153;$i<=162;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[163]) and $dataarray[163]!=0){
if ($dataarray[163]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[163]</td>";
}
}
echo "</tr></tbody>"; ?>
</td></tr></tbody></table>
+22 -1
View File
@@ -1,6 +1,5 @@
<?php
$dataarray = explode(",",$message->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 "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -94,6 +108,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[162]; ?>
</td></tr></tbody>
<?php } ?>
<tbody class="goods"><tr><th>Bounty</th><td colspan="<?php echo $colspan; ?>">
<div class="res"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $dataarray[23]; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $dataarray[24]; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $dataarray[25]; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $dataarray[26]; ?></div><div class="carry"><img class="car" src="img/x.gif" alt="carry" title="carry" /><?php echo ($dataarray[23]+$dataarray[24]+$dataarray[25]+$dataarray[26])."/".$dataarray[27]; ?></div>
+24 -2
View File
@@ -68,6 +68,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){
if ($dataarray[148]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -89,8 +104,15 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<img class="unit u<?php echo $dataarray[143]; ?>" src="img/x.gif" alt="Chief" title="Chief" />
<?php echo $dataarray[144]; ?>
</td></tr></tbody>
<?php } ?>
<?php if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
<?php }
if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
+22 -1
View File
@@ -1,6 +1,5 @@
<?php
$dataarray = explode(",",$message->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 "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -94,6 +108,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[162]; ?>
</td></tr></tbody>
<?php } ?>
<tbody class="goods"><tr><th>Bounty</th><td colspan="<?php echo $colspan; ?>">
<div class="res"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $dataarray[23]; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $dataarray[24]; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $dataarray[25]; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $dataarray[26]; ?></div><div class="carry"><img class="car" src="img/x.gif" alt="carry" title="carry" /><?php echo ($dataarray[23]+$dataarray[24]+$dataarray[25]+$dataarray[26])."/".$dataarray[27]; ?></div>
+24 -2
View File
@@ -68,6 +68,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){
if ($dataarray[148]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -89,8 +104,15 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<img class="unit u<?php echo $dataarray[143]; ?>" src="img/x.gif" alt="Chief" title="Chief" />
<?php echo $dataarray[144]; ?>
</td></tr></tbody>
<?php } ?>
<?php if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
<?php }
if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
+22 -1
View File
@@ -1,6 +1,5 @@
<?php
$dataarray = explode(",",$message->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 "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -94,6 +108,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[162]; ?>
</td></tr></tbody>
<?php } ?>
<tbody class="goods"><tr><th>Bounty</th><td colspan="<?php echo $colspan; ?>">
<div class="res"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $dataarray[23]; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $dataarray[24]; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $dataarray[25]; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $dataarray[26]; ?></div><div class="carry"><img class="car" src="img/x.gif" alt="carry" title="carry" /><?php echo ($dataarray[23]+$dataarray[24]+$dataarray[25]+$dataarray[26])."/".$dataarray[27]; ?></div>
+24 -2
View File
@@ -68,6 +68,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){
if ($dataarray[148]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -89,8 +104,15 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<img class="unit u<?php echo $dataarray[143]; ?>" src="img/x.gif" alt="Chief" title="Chief" />
<?php echo $dataarray[144]; ?>
</td></tr></tbody>
<?php } ?>
<?php if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
<?php }
if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
+22
View File
@@ -62,6 +62,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){
if ($dataarray[148]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -90,6 +105,13 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[162]; ?>
</td></tr></tbody>
<?php } ?>
<tbody class="goods"><tr><th>Bounty</th><td colspan="<?php echo $colspan; ?>">
<div class="res"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $dataarray[23]; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $dataarray[24]; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $dataarray[25]; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $dataarray[26]; ?></div><div class="carry"><img class="car" src="img/x.gif" alt="carry" title="carry" /><?php echo ($dataarray[23]+$dataarray[24]+$dataarray[25]+$dataarray[26])."/".$dataarray[27]; ?></div>
+24 -2
View File
@@ -67,6 +67,21 @@ if (isset($dataarray[147]) and $dataarray[147] != 0){
if ($dataarray[148]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[148]</td>";
}
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 "</tr><tr><th>Prisoners</th>";
for($i=151;$i<=160;$i++) {
if($dataarray[$i] == 0) {
echo "<td class=\"none\">0</td>";
}
else {
echo "<td>".$dataarray[$i]."</td>";
}
}
if(isset($dataarray[161]) and $dataarray[161]!=0){
if ($dataarray[161]==0){$tdclass='class="none"';}
echo "<td $tdclass>$dataarray[161]</td>";
}
}
echo "</tr></tbody>";
if ($dataarray[139]!='' and $dataarray[140]!=''){ //ram
?>
@@ -88,13 +103,20 @@ if ($dataarray[143]!='' and $dataarray[144]!=''){ //chief
<img class="unit u<?php echo $dataarray[143]; ?>" src="img/x.gif" alt="Chief" title="Chief" />
<?php echo $dataarray[144]; ?>
</td></tr></tbody>
<?php } ?>
<?php if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
<?php }
if ($dataarray[145]!='' and $dataarray[146]!=''){ //spy
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[146]; ?>
</td></tr></tbody>
<?php }
if ($dataarray[162]!='' and $dataarray[162]!=''){ //release prisoners
?>
<tbody class="goods"><tr><th>Information</th><td colspan="<?php echo $colspan; ?>">
<?php echo $dataarray[162]; ?>
</td></tr></tbody>
<?php } ?>
<tbody class="goods"><tr><th>Bounty</th><td colspan="<?php echo $colspan; ?>">
<div class="res"><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" /><?php echo $dataarray[23]; ?> | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" /><?php echo $dataarray[24]; ?> | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" /><?php echo $dataarray[25]; ?> | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" /><?php echo $dataarray[26]; ?></div><div class="carry"><img class="car" src="img/x.gif" alt="carry" title="carry" /><?php echo ($dataarray[23]+$dataarray[24]+$dataarray[25]+$dataarray[26])."/".$dataarray[27]; ?></div>
+1 -1
View File
@@ -60,7 +60,7 @@ include("menu2.tpl");
<tr>
<th>Rank</th>
<td><?php echo $ranking->getUserRank($displayarray['username']); ?></td>
<td><?php echo $ranking->getUserRank($displayarray['id']); ?></td>
</tr>
<tr>
<th>Tribe</th>
+8 -8
View File
@@ -19,7 +19,7 @@
<td class="desc">
Legionnaire
</td><td class="value">
<input class="text" type="text" name="a1_1" value="<?php echo $form->getValue('a1_1'); ?>" maxlength="7" title="Number Legionnaire" />
<input class="text" type="text" name="a1_1" value="<?php echo $form->getValue('a1_1'); ?>" maxlength="10" title="Number Legionnaire" />
</td>
<td class="research">
<input class="text" type="text" name="f1_1" value="<?php echo $form->getValue('f1_1'); ?>" maxlength="2" title="Level Blacksmith Legionnaire" />
@@ -31,7 +31,7 @@
<td class="desc">
Praetorian
</td><td class="value">
<input class="text" type="text" name="a1_2" value="<?php echo $form->getValue('a1_2'); ?>" maxlength="7" title="Number Praetorian" />
<input class="text" type="text" name="a1_2" value="<?php echo $form->getValue('a1_2'); ?>" maxlength="10" title="Number Praetorian" />
</td>
<td class="research">
<input class="text" type="text" name="f1_2" value="<?php echo $form->getValue('f1_2'); ?>" maxlength="2" title="Level Blacksmith Praetorian" />
@@ -43,7 +43,7 @@
<td class="desc">
Imperian
</td><td class="value">
<input class="text" type="text" name="a1_3" value="<?php echo $form->getValue('a1_3'); ?>" maxlength="7" title="Number Imperian" />
<input class="text" type="text" name="a1_3" value="<?php echo $form->getValue('a1_3'); ?>" maxlength="10" title="Number Imperian" />
</td>
<td class="research">
@@ -56,7 +56,7 @@
Equites Legati
</td><td class="value">
<input class="text" type="text" name="a1_4" value="<?php echo $form->getValue('a1_4'); ?>" maxlength="7" title="Number Equites Legati" />
<input class="text" type="text" name="a1_4" value="<?php echo $form->getValue('a1_4'); ?>" maxlength="10" title="Number Equites Legati" />
</td>
<td class="research">
<input class="text" type="text" name="f1_4" value="<?php echo $form->getValue('f1_4'); ?>" maxlength="2" title="Level Blacksmith Equites Legati" />
@@ -68,7 +68,7 @@
Equites Imperatoris
</td><td class="value">
<input class="text" type="text" name="a1_5" value="<?php echo $form->getValue('a1_5'); ?>" maxlength="7" title="Number Equites Imperatoris" />
<input class="text" type="text" name="a1_5" value="<?php echo $form->getValue('a1_5'); ?>" maxlength="10" title="Number Equites Imperatoris" />
</td>
<td class="research">
<input class="text" type="text" name="f1_5" value="<?php echo $form->getValue('f1_5'); ?>" maxlength="2" title="Level Blacksmith Equites Imperatoris" />
@@ -80,7 +80,7 @@
<td class="desc">
Equites Caesaris
</td><td class="value">
<input class="text" type="text" name="a1_6" value="<?php echo $form->getValue('a1_6'); ?>" maxlength="7" title="Number Equites Caesaris" />
<input class="text" type="text" name="a1_6" value="<?php echo $form->getValue('a1_6'); ?>" maxlength="10" title="Number Equites Caesaris" />
</td>
<td class="research">
<input class="text" type="text" name="f1_6" value="<?php echo $form->getValue('f1_6'); ?>" maxlength="2" title="Level Blacksmith Equites Caesaris" />
@@ -92,7 +92,7 @@
<td class="desc">
Battering Ram
</td><td class="value">
<input class="text" type="text" name="a1_7" value="<?php echo $form->getValue('a1_7'); ?>" maxlength="7" title="Number Battering Ram" />
<input class="text" type="text" name="a1_7" value="<?php echo $form->getValue('a1_7'); ?>" maxlength="10" title="Number Battering Ram" />
</td>
<td class="research">
@@ -104,7 +104,7 @@
<td class="desc">
Fire Catapult
</td><td class="value">
<input class="text" type="text" name="a1_8" value="<?php echo $form->getValue('a1_8'); ?>" maxlength="7" title="Number Fire Catapult" />
<input class="text" type="text" name="a1_8" value="<?php echo $form->getValue('a1_8'); ?>" maxlength="10" title="Number Fire Catapult" />
</td>
<td class="research">
+8 -8
View File
@@ -19,7 +19,7 @@
<td class="desc">
Clubswinger
</td><td class="value">
<input class="text" type="text" name="a1_1" value="<?php echo $form->getValue('a1_1'); ?>" maxlength="7" title="Number Clubswinger" />
<input class="text" type="text" name="a1_1" value="<?php echo $form->getValue('a1_1'); ?>" maxlength="10" title="Number Clubswinger" />
</td>
<td class="research">
<input class="text" type="text" name="f1_1" value="<?php echo $form->getValue('f1_1'); ?>" maxlength="2" title="Level Blacksmith Clubswinger" />
@@ -31,7 +31,7 @@
<td class="desc">
Spearman
</td><td class="value">
<input class="text" type="text" name="a1_2" value="<?php echo $form->getValue('a1_2'); ?>" maxlength="7" title="Number Spearman" />
<input class="text" type="text" name="a1_2" value="<?php echo $form->getValue('a1_2'); ?>" maxlength="10" title="Number Spearman" />
</td>
<td class="research">
<input class="text" type="text" name="f1_2" value="<?php echo $form->getValue('f1_2'); ?>" maxlength="2" title="Level Blacksmith Spearman" />
@@ -43,7 +43,7 @@
<td class="desc">
Axeman
</td><td class="value">
<input class="text" type="text" name="a1_3" value="<?php echo $form->getValue('a1_3'); ?>" maxlength="7" title="Number Axeman" />
<input class="text" type="text" name="a1_3" value="<?php echo $form->getValue('a1_3'); ?>" maxlength="10" title="Number Axeman" />
</td>
<td class="research">
@@ -56,7 +56,7 @@
Scout
</td><td class="value">
<input class="text" type="text" name="a1_4" value="<?php echo $form->getValue('a1_4'); ?>" maxlength="7" title="Number Scout" />
<input class="text" type="text" name="a1_4" value="<?php echo $form->getValue('a1_4'); ?>" maxlength="10" title="Number Scout" />
</td>
<td class="research">
<input class="text" type="text" name="f1_4" value="<?php echo $form->getValue('f1_4'); ?>" maxlength="2" title="Level Blacksmith Scout" />
@@ -68,7 +68,7 @@
Paladin
</td><td class="value">
<input class="text" type="text" name="a1_5" value="<?php echo $form->getValue('a1_5'); ?>" maxlength="7" title="Number Paladin" />
<input class="text" type="text" name="a1_5" value="<?php echo $form->getValue('a1_5'); ?>" maxlength="10" title="Number Paladin" />
</td>
<td class="research">
<input class="text" type="text" name="f1_5" value="<?php echo $form->getValue('f1_5'); ?>" maxlength="2" title="Level Blacksmith Paladin" />
@@ -80,7 +80,7 @@
<td class="desc">
Teutonic Knight
</td><td class="value">
<input class="text" type="text" name="a1_6" value="<?php echo $form->getValue('a1_6'); ?>" maxlength="7" title="Number Teutonic Knight" />
<input class="text" type="text" name="a1_6" value="<?php echo $form->getValue('a1_6'); ?>" maxlength="10" title="Number Teutonic Knight" />
</td>
<td class="research">
<input class="text" type="text" name="f1_6" value="<?php echo $form->getValue('f1_6'); ?>" maxlength="2" title="Level Blacksmith Teutonic Knight" />
@@ -92,7 +92,7 @@
<td class="desc">
Ram
</td><td class="value">
<input class="text" type="text" name="a1_7" value="<?php echo $form->getValue('a1_7'); ?>" maxlength="7" title="Number Ram" />
<input class="text" type="text" name="a1_7" value="<?php echo $form->getValue('a1_7'); ?>" maxlength="10" title="Number Ram" />
</td>
<td class="research">
@@ -104,7 +104,7 @@
<td class="desc">
Catapult
</td><td class="value">
<input class="text" type="text" name="a1_8" value="<?php echo $form->getValue('a1_8'); ?>" maxlength="7" title="Number Catapult" />
<input class="text" type="text" name="a1_8" value="<?php echo $form->getValue('a1_8'); ?>" maxlength="10" title="Number Catapult" />
</td>
<td class="research">
+8 -8
View File
@@ -13,7 +13,7 @@
<td class="desc">
Legionnaire
</td><td class="value">
<input class="text" type="text" name="a2_1" value="<?php echo $form->getValue('a2_1'); ?>" maxlength="7" title="Number Legionnaire" />
<input class="text" type="text" name="a2_1" value="<?php echo $form->getValue('a2_1'); ?>" maxlength="10" title="Number Legionnaire" />
</td>
<td class="research">
<input class="text" type="text" name="f2_1" value="<?php echo $form->getValue('f2_1'); ?>" maxlength="2" title="Level Armoury Legionnaire" />
@@ -25,7 +25,7 @@
<td class="desc">
Praetorian
</td><td class="value">
<input class="text" type="text" name="a2_2" value="<?php echo $form->getValue('a2_2'); ?>" maxlength="7" title="Number Praetorian" />
<input class="text" type="text" name="a2_2" value="<?php echo $form->getValue('a2_2'); ?>" maxlength="10" title="Number Praetorian" />
</td>
<td class="research">
<input class="text" type="text" name="f2_2" value="<?php echo $form->getValue('f2_2'); ?>" maxlength="2" title="Level Armoury Praetorian" />
@@ -37,7 +37,7 @@
<td class="desc">
Imperian
</td><td class="value">
<input class="text" type="text" name="a2_3" value="<?php echo $form->getValue('a2_3'); ?>" maxlength="7" title="Number Imperian" />
<input class="text" type="text" name="a2_3" value="<?php echo $form->getValue('a2_3'); ?>" maxlength="10" title="Number Imperian" />
</td>
<td class="research">
@@ -50,7 +50,7 @@
Equites Legati
</td><td class="value">
<input class="text" type="text" name="a2_4" value="<?php echo $form->getValue('a2_4'); ?>" maxlength="7" title="Number Equites Legati" />
<input class="text" type="text" name="a2_4" value="<?php echo $form->getValue('a2_4'); ?>" maxlength="10" title="Number Equites Legati" />
</td>
<td class="research">
<input class="text" type="text" name="f2_4" value="<?php echo $form->getValue('f2_4'); ?>" maxlength="2" title="Level Armoury Equites Legati" />
@@ -62,7 +62,7 @@
Equites Imperatoris
</td><td class="value">
<input class="text" type="text" name="a2_5" value="<?php echo $form->getValue('a2_5'); ?>" maxlength="7" title="Number Equites Imperatoris" />
<input class="text" type="text" name="a2_5" value="<?php echo $form->getValue('a2_5'); ?>" maxlength="10" title="Number Equites Imperatoris" />
</td>
<td class="research">
<input class="text" type="text" name="f2_5" value="<?php echo $form->getValue('f2_5'); ?>" maxlength="2" title="Level Armoury Equites Imperatoris" />
@@ -74,7 +74,7 @@
<td class="desc">
Equites Caesaris
</td><td class="value">
<input class="text" type="text" name="a2_6" value="<?php echo $form->getValue('a2_6'); ?>" maxlength="7" title="Number Equites Caesaris" />
<input class="text" type="text" name="a2_6" value="<?php echo $form->getValue('a2_6'); ?>" maxlength="10" title="Number Equites Caesaris" />
</td>
<td class="research">
<input class="text" type="text" name="f2_6" value="<?php echo $form->getValue('f2_6'); ?>" maxlength="2" title="Level Armoury Equites Caesaris" />
@@ -86,7 +86,7 @@
<td class="desc">
Battering Ram
</td><td class="value">
<input class="text" type="text" name="a2_7" value="<?php echo $form->getValue('a2_7'); ?>" maxlength="7" title="Number Battering Ram" />
<input class="text" type="text" name="a2_7" value="<?php echo $form->getValue('a2_7'); ?>" maxlength="10" title="Number Battering Ram" />
</td>
<td class="research">
@@ -98,7 +98,7 @@
<td class="desc">
Fire Catapult
</td><td class="value">
<input class="text" type="text" name="a2_8" value="<?php echo $form->getValue('a2_8'); ?>" maxlength="7" title="Number Fire Catapult" />
<input class="text" type="text" name="a2_8" value="<?php echo $form->getValue('a2_8'); ?>" maxlength="10" title="Number Fire Catapult" />
</td>
<td class="research">
+8 -8
View File
@@ -13,7 +13,7 @@
<td class="desc">
Clubswinger
</td><td class="value">
<input class="text" type="text" name="a2_11" value="<?php echo $form->getValue('a2_11'); ?>" maxlength="7" title="Number Clubswinger" />
<input class="text" type="text" name="a2_11" value="<?php echo $form->getValue('a2_11'); ?>" maxlength="10" title="Number Clubswinger" />
</td>
<td class="research">
<input class="text" type="text" name="f2_11" value="<?php echo $form->getValue('f2_11'); ?>" maxlength="2" title="Level Armoury Clubswinger" />
@@ -25,7 +25,7 @@
<td class="desc">
Spearman
</td><td class="value">
<input class="text" type="text" name="a2_12" value="<?php echo $form->getValue('a2_12'); ?>" maxlength="7" title="Number Spearman" />
<input class="text" type="text" name="a2_12" value="<?php echo $form->getValue('a2_12'); ?>" maxlength="10" title="Number Spearman" />
</td>
<td class="research">
<input class="text" type="text" name="f2_12" value="<?php echo $form->getValue('f2_12'); ?>" maxlength="2" title="Level Armoury Spearman" />
@@ -37,7 +37,7 @@
<td class="desc">
Axeman
</td><td class="value">
<input class="text" type="text" name="a2_13" value="<?php echo $form->getValue('a2_13'); ?>" maxlength="7" title="Number Axeman" />
<input class="text" type="text" name="a2_13" value="<?php echo $form->getValue('a2_13'); ?>" maxlength="10" title="Number Axeman" />
</td>
<td class="research">
@@ -50,7 +50,7 @@
Scout
</td><td class="value">
<input class="text" type="text" name="a2_14" value="<?php echo $form->getValue('a2_14'); ?>" maxlength="7" title="Number Scout" />
<input class="text" type="text" name="a2_14" value="<?php echo $form->getValue('a2_14'); ?>" maxlength="10" title="Number Scout" />
</td>
<td class="research">
<input class="text" type="text" name="f2_14" value="<?php echo $form->getValue('f2_14'); ?>" maxlength="2" title="Level Armoury Scout" />
@@ -62,7 +62,7 @@
Paladin
</td><td class="value">
<input class="text" type="text" name="a2_15" value="<?php echo $form->getValue('a2_15'); ?>" maxlength="7" title="Number Paladin" />
<input class="text" type="text" name="a2_15" value="<?php echo $form->getValue('a2_15'); ?>" maxlength="10" title="Number Paladin" />
</td>
<td class="research">
<input class="text" type="text" name="f2_15" value="<?php echo $form->getValue('f2_15'); ?>" maxlength="2" title="Level Armoury Paladin" />
@@ -74,7 +74,7 @@
<td class="desc">
Teutonic Knight
</td><td class="value">
<input class="text" type="text" name="a2_16" value="<?php echo $form->getValue('a2_16'); ?>" maxlength="7" title="Number Teutonic Knight" />
<input class="text" type="text" name="a2_16" value="<?php echo $form->getValue('a2_16'); ?>" maxlength="10" title="Number Teutonic Knight" />
</td>
<td class="research">
<input class="text" type="text" name="f2_16" value="<?php echo $form->getValue('f2_16'); ?>" maxlength="2" title="Level Armoury Teutonic Knight" />
@@ -86,7 +86,7 @@
<td class="desc">
Ram
</td><td class="value">
<input class="text" type="text" name="a2_17" value="<?php echo $form->getValue('a2_17'); ?>" maxlength="7" title="Number Ram" />
<input class="text" type="text" name="a2_17" value="<?php echo $form->getValue('a2_17'); ?>" maxlength="10" title="Number Ram" />
</td>
<td class="research">
@@ -98,7 +98,7 @@
<td class="desc">
Catapult
</td><td class="value">
<input class="text" type="text" name="a2_18" value="<?php echo $form->getValue('a2_18'); ?>" maxlength="7" title="Number Catapult" />
<input class="text" type="text" name="a2_18" value="<?php echo $form->getValue('a2_18'); ?>" maxlength="10" title="Number Catapult" />
</td>
<td class="research">
+8 -8
View File
@@ -13,7 +13,7 @@
<td class="desc">
Phalanx
</td><td class="value">
<input class="text" type="text" name="a2_21" value="<?php echo $form->getValue('a2_21'); ?>" maxlength="7" title="Number Phalanx" />
<input class="text" type="text" name="a2_21" value="<?php echo $form->getValue('a2_21'); ?>" maxlength="10" title="Number Phalanx" />
</td>
<td class="research">
<input class="text" type="text" name="f2_21" value="<?php echo $form->getValue('f2_21'); ?>" maxlength="2" title="Level Armoury Phalanx" />
@@ -25,7 +25,7 @@
<td class="desc">
Swordsman
</td><td class="value">
<input class="text" type="text" name="a2_22" value="<?php echo $form->getValue('a2_22'); ?>" maxlength="7" title="Number Swordsman" />
<input class="text" type="text" name="a2_22" value="<?php echo $form->getValue('a2_22'); ?>" maxlength="10" title="Number Swordsman" />
</td>
<td class="research">
<input class="text" type="text" name="f2_22" value="<?php echo $form->getValue('f2_22'); ?>" maxlength="2" title="Level Armoury Swordsman" />
@@ -37,7 +37,7 @@
<td class="desc">
Pathfinder
</td><td class="value">
<input class="text" type="text" name="a2_23" value="<?php echo $form->getValue('a2_23'); ?>" maxlength="7" title="Number Pathfinder" />
<input class="text" type="text" name="a2_23" value="<?php echo $form->getValue('a2_23'); ?>" maxlength="10" title="Number Pathfinder" />
</td>
<td class="research">
@@ -50,7 +50,7 @@
Theutates Thunder
</td><td class="value">
<input class="text" type="text" name="a2_24" value="<?php echo $form->getValue('a2_24'); ?>" maxlength="7" title="Number Theutates Thunder" />
<input class="text" type="text" name="a2_24" value="<?php echo $form->getValue('a2_24'); ?>" maxlength="10" title="Number Theutates Thunder" />
</td>
<td class="research">
<input class="text" type="text" name="f2_24" value="<?php echo $form->getValue('a2_24'); ?>" maxlength="2" title="Level Armoury Theutates Thunder" />
@@ -62,7 +62,7 @@
Druidrider
</td><td class="value">
<input class="text" type="text" name="a2_25" value="<?php echo $form->getValue('a2_25'); ?>" maxlength="7" title="Number Druidrider" />
<input class="text" type="text" name="a2_25" value="<?php echo $form->getValue('a2_25'); ?>" maxlength="10" title="Number Druidrider" />
</td>
<td class="research">
<input class="text" type="text" name="f2_25" value="<?php echo $form->getValue('f2_25'); ?>" maxlength="2" title="Level Armoury Druidrider" />
@@ -74,7 +74,7 @@
<td class="desc">
Haeduan
</td><td class="value">
<input class="text" type="text" name="a2_26" value="<?php echo $form->getValue('a2_26'); ?>" maxlength="7" title="Number Haeduan" />
<input class="text" type="text" name="a2_26" value="<?php echo $form->getValue('a2_26'); ?>" maxlength="10" title="Number Haeduan" />
</td>
<td class="research">
<input class="text" type="text" name="f2_26" value="<?php echo $form->getValue('f2_27'); ?>" maxlength="2" title="Level Armoury Haeduan" />
@@ -86,7 +86,7 @@
<td class="desc">
Ram
</td><td class="value">
<input class="text" type="text" name="a2_27" value="<?php echo $form->getValue('a2_27'); ?>" maxlength="7" title="Number Ram" />
<input class="text" type="text" name="a2_27" value="<?php echo $form->getValue('a2_27'); ?>" maxlength="10" title="Number Ram" />
</td>
<td class="research">
@@ -98,7 +98,7 @@
<td class="desc">
Trebuchet
</td><td class="value">
<input class="text" type="text" name="a2_28" value="<?php echo $form->getValue('a2_28'); ?>" maxlength="7" title="Number Trebuchet" />
<input class="text" type="text" name="a2_28" value="<?php echo $form->getValue('a2_28'); ?>" maxlength="10" title="Number Trebuchet" />
</td>
<td class="research">
+18 -3
View File
@@ -15,27 +15,42 @@
</tr>
<?php
if(in_array(1,$target)) {
if($_POST['wall1'] != 0){
$wall1 = $_POST['wall1'];
}else{
$wall1 = 0;
}
echo "<tr>
<td class=\"ico\"><img src=\"img/x.gif\" class=\"unit uwall\" alt=\"City Wall\" title=\"City Wall\" /></td>
<td class=\"desc\">City Wall</td>
<td class=\"value\"><input class=\"text\" type=\"text\" name=\"wall1\" value=\"0\" maxlength=\"2\" title=\"level City Wall\" /></td>
<td class=\"value\"><input class=\"text\" type=\"text\" name=\"wall1\" value=\"$wall1\" maxlength=\"2\" title=\"level City Wall\" /></td>
<td class=\"research\"></td>
</tr>";
}
if(in_array(2,$target)) {
if($_POST['wall2'] != 0){
$wall2 = $_POST['wall2'];
}else{
$wall2 = 0;
}
echo "<tr>
<td class=\"ico\"><img src=\"img/x.gif\" class=\"unit ubarr\" alt=\"Earth Wall\" title=\"Earth Wall\" /></td>
<td class=\"desc\">Earth Wall</td>
<td class=\"value\"><input class=\"text\" type=\"text\" name=\"wall2\" value=\"0\" maxlength=\"2\" title=\"level Earth Wall\" /></td>
<td class=\"value\"><input class=\"text\" type=\"text\" name=\"wall2\" value=\"$wall2\" maxlength=\"2\" title=\"level Earth Wall\" /></td>
<td class=\"research\"></td>
</tr>";
}
if(in_array(3,$target)) {
if($_POST['wall3'] != 0){
$wall3 = $_POST['wall3'];
}else{
$wall3 = 0;
}
echo "<tr>
<td class=\"ico\"><img src=\"img/x.gif\" class=\"unit ustock\" alt=\"Palisade\" title=\"Palisade\" /></td>
<td class=\"desc\">Palisade</td>
<td class=\"value\"><input class=\"text\" type=\"text\" name=\"wall3\" value=\"0\" maxlength=\"2\" title=\"level Palisade\" /></td>
<td class=\"value\"><input class=\"text\" type=\"text\" name=\"wall3\" value=\"$wall3\" maxlength=\"2\" title=\"level Palisade\" /></td>
<td class=\"research\"></td>
</tr>";
+3 -3
View File
@@ -170,7 +170,7 @@ $end = ($tribe*10);
<tbody class="options">
<tr>
<th>Options</th>
<td colspan="10"><input class="radio" name="spy" value="1" checked="checked" type="radio">Scout resources and troops<br>
<td colspan="<?php if($process['t11'] != ''){ echo"11"; }else{ echo"10"; } ?>"><input class="radio" name="spy" value="1" checked="checked" type="radio">Scout resources and troops<br>
<input class="radio" name="spy" value="2" type="radio">Scout defences and troops </td>
</tr>
</tbody>
@@ -182,7 +182,7 @@ $end = ($tribe*10);
<?php if($process['c']=='3'){ ?><tbody class="cata">
<tr>
<th>Destination:</th>
<td colspan="10">
<td colspan="<?php if($process['t11'] != ''){ echo"11"; }else{ echo"10"; } ?>">
<select name="ctar1" class="dropdown">
<option value="0">Random</option>
@@ -305,7 +305,7 @@ $end = ($tribe*10);
?><tbody class="infos">
<th>Destination:</th>
<td colspan="10">
<td colspan="<?php if($process['t11'] != ''){ echo"11"; }else{ echo"10"; } ?>">
<?PHP
echo"Warning: Catapult will <b>ONLY</b> shoot with a normal attack (they dont shoot with raids!)";
+5 -5
View File
@@ -107,7 +107,7 @@ $actionType = "Raid";
<td><?php echo $process[1]; ?></td>
<td colspan="10"><?php echo $actionType." to ".$process['1']; ?></td>
<td colspan="<?php if($process['t11'] != ''){ echo"11"; }else{ echo"10"; } ?>"><?php echo $actionType." to ".$process['1']; ?></td>
</tr>
@@ -174,7 +174,7 @@ $actionType = "Raid";
<tbody class="options">
<tr>
<th>Options</th>
<td colspan="10"><input class="radio" name="spy" value="1" checked="checked" type="radio">Scout resources and troops<br>
<td colspan="<?php if($process['t11'] != ''){ echo"11"; }else{ echo"10"; } ?>"><input class="radio" name="spy" value="1" checked="checked" type="radio">Scout resources and troops<br>
<input class="radio" name="spy" value="2" type="radio">Scout defences and troops </td>
</tr>
</tbody>
@@ -186,7 +186,7 @@ $actionType = "Raid";
<?php if($process['c']=='3'){ ?><tbody class="cata">
<tr>
<th>Destination:</th>
<td colspan="10">
<td colspan="<?php if($process['t11'] != ''){ echo"11"; }else{ echo"10"; } ?>">
<?php if($building->getTypeLevel(16) == 20) { ?>
<select name="ctar2" class="dropdown">
<option value="0">Random</option>
@@ -305,7 +305,7 @@ $actionType = "Raid";
?><tbody class="infos">
<th>Destination:</th>
<td colspan="10">
<td colspan="<?php if($process['t11'] != ''){ echo"11"; }else{ echo"10"; } ?>">
<?PHP
echo"Warning: Catapult will <b>ONLY</b> shoot with a normal attack (they dont shoot with raids!)";
@@ -393,7 +393,7 @@ $actionType = "Raid";
<td colspan="10">
<td colspan="<?php if($process['t11'] != ''){ echo"11"; }else{ echo"10"; } ?>">
<div class="in">in <?php echo $generator->getTimeFormat($time); ?></div>
+4 -5
View File
@@ -71,13 +71,12 @@ div.c1 {text-align: center}
<div id="content" class="village1">
<h1>Announcement</h1>
<h2>Hi <?php echo $session->username; ?>,</h2>
<br>
</br>
<h3>Hi <?php echo $session->username; ?>,</h3>
<?php include("Templates/text.tpl"); ?>
<div class="c1">
<h2><a href="dorf1.php?ok">&raquo; Go to my village</a></h2>
</br>
<h3><a href="dorf1.php?ok">&raquo; Go to my village</a></h3>
</div>
</div>
-1
View File
@@ -22,5 +22,4 @@ $txt = preg_replace("/\[\/u\]/is",'</u>', $txt);
//nl2br = enter
echo nl2br($txt);
?>
+58 -1
View File
@@ -44,6 +44,9 @@ if(isset($_GET['w'])) {
if(isset($_GET['r'])) {
$r = preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['r']);
}
if(isset($_GET['delprisoners'])) {
$delprisoners = preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['delprisoners']);
}
if(isset($_GET['o'])) {
$o = preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['o']);
$oid = preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['z']);
@@ -158,7 +161,61 @@ if(isset($_GET['o'])) {
include ("Templates/a2b/units_" . $session->tribe . ".tpl");
include ("Templates/a2b/search.tpl");
}
} else {
} else if(isset($delprisoners)){
$prisoner = $database->getPrisonersByID($delprisoners);
if($prisoner['wref'] == $village->wid){
$p_owner = $database->getVillageField($prisoner['from'],"owner");
$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($automation->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()));
$troops = $prisoner['t1']+$prisoner['t2']+$prisoner['t3']+$prisoner['t4']+$prisoner['t5']+$prisoner['t6']+$prisoner['t7']+$prisoner['t8']+$prisoner['t9']+$prisoner['t10']+$prisoner['t11'];
$database->modifyUnit($prisoner['wref'],array("99o"),array($troops),array(0));
$database->deletePrisoners($prisoner['id']);
}else if($prisoner['from'] == $village->wid){
$troops = $prisoner['t1']+$prisoner['t2']+$prisoner['t3']+$prisoner['t4']+$prisoner['t5']+$prisoner['t6']+$prisoner['t7']+$prisoner['t8']+$prisoner['t9']+$prisoner['t10']+$prisoner['t11'];
$database->modifyUnit($prisoner['wref'],array("99o"),array($troops),array(0));
$database->deletePrisoners($prisoner['id']);
}
header("Location: build.php?id=39");} else {
if(isset($process['0'])) {
$coor = $database->getCoor($process['0']);
include ("Templates/a2b/attack.tpl");
Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

+2 -3
View File
@@ -22,16 +22,15 @@ header("Location: install/");
}
include ("GameEngine/config.php");
//Change it to your own domain
/*
if($_SERVER['HTTP_HOST'] != 'YOUR_DOMAIN')
{
header('location: YOUR_DOMAIN');
header('location: '.SERVER.'');
exit;
}
*/
// delete the /* and the */ if you not use localhost. then, change "YOUR_DOMAIN" to you domain.
// delete the /* and the */ if you not use localhost.
error_reporting(E_ALL || E_NOTICE);
+29
View File
@@ -1051,6 +1051,35 @@ CREATE TABLE IF NOT EXISTS `%PREFIX%online` (
-- Dumping data for table `%prefix%online`
--
-- --------------------------------------------------------
--
-- Table structure for table `%PREFIX%prisoners`
--
CREATE TABLE IF NOT EXISTS `%PREFIX%prisoners` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`wref` int(11) unsigned NOT NULL,
`from` int(11) unsigned NOT NULL,
`t1` int(11) unsigned NOT NULL,
`t2` int(11) unsigned NOT NULL,
`t3` int(11) unsigned NOT NULL,
`t4` int(11) unsigned NOT NULL,
`t5` int(11) unsigned NOT NULL,
`t6` int(11) unsigned NOT NULL,
`t7` int(11) unsigned NOT NULL,
`t8` int(11) unsigned NOT NULL,
`t9` int(11) unsigned NOT NULL,
`t10` int(11) unsigned NOT NULL,
`t11` int(11) unsigned NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Dumping data for table `%PREFIX%prisoners`
--
-- --------------------------------------------------------
--
+8 -3
View File
@@ -43,29 +43,34 @@ if (isset($_GET['send']) && isset($_GET['from']))
$_SESSION['m_message'] = preg_replace("/\[url\]([a-z0-9\_\.\:\/\-]*)\[\/url\]/i", "<a href='$1'>$1</a>", $_SESSION['m_message']);
$_SESSION['m_message'] = preg_replace("/\[url\=([a-z0-9\_\.\:\/\-]*)\]([a-z0-9\_\.\:\/\-]*)\[\/url\]/i", "<a href='$1'>$2</a>", $_SESSION['m_message']);
$_SESSION['m_message'] = preg_replace("/\*u([0-9]*)(left|right)\*/i", "<img src='img/u2/u$1.gif' style='float:$2;' alt='unit$1' />", $_SESSION['m_message']);
$_SESSION['m_message'] = "[message]".$_SESSION['m_message']."[/message]";
$users_count = mysql_fetch_assoc(mysql_query("SELECT count(*) as count FROM ".TB_PREFIX."users WHERE id != 0"));
$users_count = $users_count['count'];
if ($_GET['from'] + $max_per_pass <= $users_count) $plus = $max_per_pass; else $plus = $users_count - $_GET['from'];
$sql = "INSERT INTO ".TB_PREFIX."mdata (`target`, `owner`, `topic`, `message`, `viewed`, `archived`, `send`, `time`) VALUES ";
for($i = $_GET['from']; $i < ($_GET['from'] + $plus) ; $i++) {
if($i > 5){
if ($_SESSION['m_color'])
{
$sql .= "($i, 0, '<span style=\'color:{$_SESSION['m_color']};\'>{$_SESSION['m_subject']}</span>', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time()."),";
$sql .= "($i, 5, '<span style=\'color:{$_SESSION['m_color']};\'>{$_SESSION['m_subject']}</span>', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time()."),";
}
else
{
$sql .= "($i, 0, '{$_SESSION['m_subject']}', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time()."),";
$sql .= "($i, 5, '{$_SESSION['m_subject']}', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time()."),";
}
}
}
if($i > 5){
if ($_SESSION['m_color'])
{
$sql .= "($i, 0, '<span style=\'color:{$_SESSION['m_color']};\'>{$_SESSION['m_subject']}</span>', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time().")";
$sql .= "($i, 5, '<span style=\'color:{$_SESSION['m_color']};\'>{$_SESSION['m_subject']}</span>', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time().")";
}
else
{
$sql .= "($i, 0, '{$_SESSION['m_subject']}', \"{$_SESSION['m_message']}\", 0, 0, 0, ".time()."),";
}
}
mysql_query($sql);
if (($users_count - $_GET['from']) > $max_per_pass) echo header("Location: massmessage.php?send=true&from=",$_GET['from'] + $max_per_pass); else $done = true;
}