Merge pull request #2 from yi12345/master

yi12345a's fixes
This commit is contained in:
akshay9
2012-10-13 01:14:01 -07:00
42 changed files with 395 additions and 1376 deletions
+25 -26
View File
@@ -150,34 +150,33 @@
<?php
## not sure if this is correct
$quest = $user['quest'];
if($quest == 0) { $questname = "Woodcutter"; }
elseif($quest ==1) {$questname = "Crop"; }
elseif($quest ==2) {$questname = "Your Villages Name"; }
elseif($quest ==3) {$questname = "Other Players"; }
elseif($quest ==4) {$questname = "Two Building Order"; }
elseif($quest ==5) {$questname = "Messages"; }
elseif($quest ==6) {$questname = "Neighbors"; }
elseif($quest ==7) {$questname = "Huge Army"; }
elseif($quest ==8) {$questname = "One Each!"; }
elseif($quest ==9) {$questname = "Coming Soon!"; }
elseif($quest ==1) {$questname = "Reports"; }
elseif($quest ==11) {$questname = "Everything to 1!"; }
elseif($quest ==12) {$questname = "Dove of Peace"; }
elseif($quest ==13) {$questname = "Cranny"; }
elseif($quest ==14) {$questname = "To Two!"; }
elseif($quest ==15) {$questname = "Instruction"; }
elseif($quest ==16) {$questname = "Main Building"; }
elseif($quest ==17) {$questname = "Advanced!" ;}
elseif($quest ==18) {$questname = "Weapons or Dough?"; }
if($quest == 1) { $questname = "Woodcutter"; }
elseif($quest ==2) {$questname = "Crop"; }
elseif($quest ==3) {$questname = "Your Villages Name"; }
elseif($quest ==4) {$questname = "Other Players"; }
elseif($quest ==5) {$questname = "Two Building Order"; }
elseif($quest ==6) {$questname = "Messages"; }
elseif($quest ==7) {$questname = "Huge Army!"; }
elseif($quest ==8) {$questname = "Everything to 1!"; }
elseif($quest ==9) {$questname = "Dove of Peace"; }
elseif($quest ==10) {$questname = "Cranny"; }
elseif($quest ==11) {$questname = "To Two!"; }
elseif($quest ==12) {$questname = "Instruction"; }
elseif($quest ==13) {$questname = "Main Building"; }
elseif($quest ==14) {$questname = "Advanced!" ;}
elseif($quest ==15) {$questname = "Weapons or Dough"; }
elseif($quest ==16) {$questname = "Military: Rally Point"; }
elseif($quest ==17) {$questname = "Military: Barracks"; }
elseif($quest ==18) {$questname = "Military: Train 2 Troops"; }
elseif($quest ==19) {$questname = "Economy: Granary"; }
elseif($quest ==20) {$questname = "Military: Rally Point"; }
elseif($quest ==21) {$questname = "Economy: Warehouse"; }
elseif($quest ==22) {$questname = "Military: Barracks"; }
elseif($quest ==23) {$questname = "Economy: Marketplace"; }
elseif($quest ==24) {$questname = "Military: Train 2 Troops"; }
elseif($quest ==25) {$questname = "Everything to 2!"; }
elseif($quest ==20) {$questname = "Economy: Warehouse"; }
elseif($quest ==21) {$questname = "Economy: Marketplace"; }
elseif($quest ==22) {$questname = "Everything to 2!"; }
else { $questname = "Unknown"; }
$quesst = $quest +1;
$quesst = $quest;
if($quest > 18){
$quesst = $quest - 3;
}
$questinfo = "$quesst - $questname";
?>
<input disabled="disabled" style="width: 80%;" class="fm" name="quest" value="<?php echo $questinfo; ?>"> <a href="admin.php?p=editUser&uid=<?php echo $id; ?>"><img src="../img/admin/edit.gif" title="Edit Quest"></a></td>
+1 -1
View File
@@ -30,7 +30,7 @@
</select>
</td>
<td>
<input name="s" value="<?php echo $_POST['s'];?>">
<input name="s" value="<?php echo stripslashes(stripslashes($_POST['s']));?>">
</td>
<td>
<input type="submit" value="Search" class="slr3">
+1
View File
@@ -25,6 +25,7 @@ class funct {
switch($get['action']){
case recountPop:
$admin->recountPop($get['did']);
$admin->recountCP($get['did']);
break;
case recountPopUsr:
$admin->recountPopUser($get['uid']);
+29 -8
View File
@@ -28,21 +28,42 @@ $b1dur = $_POST['wood'] * 86400;
$b2dur = $_POST['clay'] * 86400;
$b3dur = $_POST['iron'] * 86400;
$b4dur = $_POST['crop'] * 86400;
$quest = $_POST['quest'];
if($pdur > 1){ $plus = (time() + $pdur); } else { $pdur = 'plus'; }
if($b1dur > 1){ $wood = (time() + $b1dur); } else { $wood = 'b1'; }
if($b2dur > 1){ $clay = (time() + $b2dur); } else { $clay = 'b2'; }
if($b3dur > 1){ $iron = (time() + $b3dur); } else { $iron = 'b3'; }
if($b4dur > 1){ $crop = (time() + $b4dur); } else { $crop = 'b4'; }
$sql1 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$id."");
$user = mysql_fetch_array($sql1);
if($user['plus'] < time()){
if($pdur > 1){ $plus = (time() + $pdur); } else { $plus = time(); }
}else{
if($pdur > 1){ $plus = ($user['plus'] + $pdur); } else { $plus = $user['plus']; }
}
if($user['b1'] < time()){
if($b1dur > 1){ $wood = (time() + $b1dur); } else { $wood = time(); }
}else{
if($b1dur > 1){ $wood = ($user['b1'] + $b1dur); } else { $wood = $user['b1']; }
}
if($user['b2'] < time()){
if($b2dur > 1){ $clay = (time() + $b2dur); } else { $clay = time(); }
}else{
if($b2dur > 1){ $clay = ($user['b2'] + $b2dur); } else { $clay = $user['b2']; }
}
if($user['b3'] < time()){
if($b3dur > 1){ $iron = (time() + $b3dur); } else { $iron = time(); }
}else{
if($b3dur > 1){ $iron = ($user['b3'] + $b3dur); } else { $iron = $user['b3']; }
}
if($user['b4'] < time()){
if($b4dur > 1){ $crop = (time() + $b4dur); } else { $crop = time(); }
}else{
if($b4dur > 1){ $crop = ($user['b4'] + $b4dur); } else { $crop = $user['b4']; }
}
mysql_query("UPDATE ".TB_PREFIX."users SET
plus = '".$plus."',
b1 = '".$wood."',
b2 = '".$clay."',
b3 = '".$iron."',
b4 = '".$crop."',
quest = '".$quest."'
b4 = '".$crop."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
+1
View File
@@ -25,6 +25,7 @@ class funct {
switch($get['action']){
case recountPop:
$admin->recountPop($get['did']);
$admin->recountCP($get['did']);
break;
case recountPopUsr:
$admin->recountPopUser($get['uid']);
+38 -6
View File
@@ -108,7 +108,7 @@
public function sendInvite($post) {
global $form, $database, $session;
if($session->access != BANNED){
if(isset($post['a_name']) or $post['a_uid'] == ""){
if($post['a_name'] != "" or $post['a_uid'] == ""){
$UserData = $database->getUserArray($post['a_name'], 0);
if($this->userPermArray['opt4'] == 0) {
$form->addError("perm", NO_PERMISSION);
@@ -150,7 +150,7 @@
// Insertamos invitacion
$database->sendInvitation($UserData['id'], $aid, $session->uid);
// Log the notice
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . addslashes($session->username) . '</a> has invited <a href="spieler.php?uid=' . $UserData['id'] . '">' . $UserData['username'] . '</a> into the alliance.');
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . addslashes($session->username) . '</a> has invited <a href="spieler.php?uid=' . $UserData['id'] . '">' . addslashes($UserData['username']) . '</a> into the alliance.');
}
}
}else{
@@ -362,7 +362,15 @@
$database->deleteAlliPermissions($post['a_user']);
$database->deleteAlliance($session->alliance);
// log the notice
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $UserData['id'] . '">' . $post['a_user'] . '</a> has quit the alliance.');
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $UserData['id'] . '">' . addslashes($post['a_user']) . '</a> has quit the alliance.');
if($database->isAllianceOwner($UserData['id'])){
$newowner = $database->getAllMember2($session->alliance);
$newleader = $newowner['id'];
$q = "UPDATE " . TB_PREFIX . "alidata set leader = ".$newleader." where id = ".$session->alliance."";
$database->query($q);
$database->updateAlliPermissions($newleader, 1, 1, 1, 1, 1, 1, 1, 1, 1);
$this->updateMax($newleader);
}
}
}else{
header("Location: banned.php");
@@ -377,10 +385,10 @@
if(isset($post['f_link'])){
$database->setAlliForumLink($session->alliance, $post['f_link']);
header("Location: allianz.php?s=5");
}
}else{
header("Location: banned.php");
}
}
}
/*****************************************
Function to quit from alliance
@@ -393,14 +401,15 @@
} elseif(md5($post['pw']) !== $session->userinfo['password']) {
$form->addError("pw2", PW_ERR);
} else {
if($database->isAllianceOwner($sessiom->uid)){
$database->updateUserField($session->uid, 'alliance', 0, 1);
if($database->isAllianceOwner($session->uid)){
$newowner = $database->getAllMember2($session->alliance);
$newleader = $newowner['id'];
$q = "UPDATE " . TB_PREFIX . "alidata set leader = ".$newleader." where id = ".$session->alliance."";
$database->query($q);
$database->updateAlliPermissions($newleader, 1, 1, 1, 1, 1, 1, 1, 1, 1);
$this->updateMax($newleader);
}
$database->updateUserField($session->uid, 'alliance', 0, 1);
$database->deleteAlliPermissions($session->uid);
// log the notice
$database->deleteAlliance($session->alliance);
@@ -448,6 +457,29 @@
header("Location: banned.php");
}
}
private function updateMax($leader) {
global $bid18, $database;
$q = mysql_query("SELECT * FROM " . TB_PREFIX . "alidata where leader = $leader");
if(mysql_num_rows($q) > 0){
$villages = $database->getVillagesID2($leader);
$max = 0;
foreach($villages as $village){
$field = $database->getResourceLevel($village['wref']);
for($i=19;$i<=40;$i++){
if($field['f'.$i.'t'] == 18){
$level = $field['f'.$i];
$attri = $bid18[$level]['attri'];
}
}
if($attri > $max){
$max = $attri;
}
}
$q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $leader";
$database->query($q);
}
}
}
$alliance = new Alliance;
+102 -73
View File
@@ -91,7 +91,7 @@ class Automation {
$popTot += $this->buildingPOP($building,$lvl);
}
}
$this->recountCP($vid);
$q = "UPDATE ".TB_PREFIX."vdata set pop = $popTot where wref = $vid";
mysql_query($q);
@@ -208,6 +208,7 @@ class Automation {
$this->updateStore();
$this->CheckBan();
$this->regenerateOasisTroops();
$this->artefactOfTheFool();
}
@@ -392,8 +393,29 @@ class Automation {
$post['t11'] = $enforce['hero'];
$reference = $database->addAttack($enforce['from'],$post['t1'],$post['t2'],$post['t3'],$post['t4'],$post['t5'],$post['t6'],$post['t7'],$post['t8'],$post['t9'],$post['t10'],$post['t11'],2,0,0,0,0);
$database->addMovement(4,$enforce['vref'],$enforce['from'],$reference,$time,$time+$time2);
$q = "DELETE FROM ".TB_PREFIX."enforcement where id = ".$enforce['id'];
$database->query($q);
}
}
for($i=0;$i<20;$i++){
$q = "SELECT * FROM ".TB_PREFIX."users where friend".$i." = ".$need['uid']." or friend".$i."wait = ".$need['uid']."";
$array = $database->query_return($q);
foreach($array as $friend){
$database->deleteFriend($friend['id'],"friend".$i);
$database->deleteFriend($friend['id'],"friend".$i."wait");
}
}
$database->updateUserField($session->uid, 'alliance', 0, 1);
if($database->isAllianceOwner($need['uid'])){
$alliance = $database->getUserAllianceID($need['uid']);
$newowner = $database->getAllMember2($alliance);
$newleader = $newowner['id'];
$q = "UPDATE " . TB_PREFIX . "alidata set leader = ".$newleader." where id = ".$alliance."";
$database->query($q);
$database->updateAlliPermissions($newleader, $alliance, "Leader", 1, 1, 1, 1, 1, 1, 1);
$this->updateMax($newleader);
}
$database->deleteAlliance($alliance);
$q = "DELETE FROM ".TB_PREFIX."hero where uid = ".$need['uid'];
$database->query($q);
$q = "DELETE FROM ".TB_PREFIX."mdata where target = ".$need['uid']." or owner = ".$need['uid'];
@@ -615,12 +637,6 @@ class Automation {
$pop = $this->getPop($indi['type'],($level-1));
$database->modifyPop($indi['wid'],$pop[0],0);
$database->addCP($indi['wid'],$pop[1]);
if($indi['type'] == 18) {
$owner = $database->getVillageField($indi['wid'],"owner");
$max = $bid18[$level]['attri'];
$q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $owner";
$database->query($q);
}
if($indi['type'] == 10) {
$max=$database->getVillageField($indi['wid'],"maxstore");
@@ -645,7 +661,11 @@ class Automation {
}
$database->setVillageField($indi['wid'],"maxcrop",$max);
}
if($indi['type'] == 18){
$this->updateMax($database->getVillageField($indi['wid'],"owner"));
}
if($indi['type'] == 38) {
$max=$database->getVillageField($indi['wid'],"maxstore");
if($level=='1' && $max==STORAGE_BASE){ $max=STORAGE_BASE; }
@@ -672,7 +692,7 @@ class Automation {
// by SlimShady95 aka Manuel Mannhardt < manuel_mannhardt@web.de >
if($indi['type'] == 40 and ($indi['level'] % 5 == 0 or $indi['level'] > 95) and $indi['level'] != 100){
$this->startNatarAttack($indi['level'], $indi['wid']);
$this->startNatarAttack($indi['level'], $indi['wid'], $indi['timestamp']);
}
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'];
@@ -705,7 +725,7 @@ class Automation {
}
// by SlimShady95 aka Manuel Mannhardt < manuel_mannhardt@web.de >
private function startNatarAttack($level, $vid) {
private function startNatarAttack($level, $vid, $time) {
global $database;
// bad, but should work :D
@@ -844,7 +864,7 @@ class Automation {
$row = mysql_fetch_assoc($query);
// start the attacks
$endtime = time() + round((60 * 60 * 24) / INCREASE_SPEED);
$endtime = $time + round((60 * 60 * 24) / INCREASE_SPEED);
// -.-
mysql_query('INSERT INTO `' . TB_PREFIX . 'ww_attacks` (`vid`, `attack_time`) VALUES (' . $vid . ', ' . $endtime . ')');
@@ -852,20 +872,17 @@ class Automation {
// wave 1
$ref = $database->addAttack($row['wref'], 0, $units[0][0], $units[0][1], 0, $units[0][2], $units[0][3], $units[0][4], $units[0][5], 0, 0, 0, 3, 0, 0, 0, 0, 20, 20, 0, 20, 20, 20, 20);
$database->addMovement(3, $row['wref'], $vid, $ref, time(), $endtime);
$database->addMovement(3, $row['wref'], $vid, $ref, $time, $endtime);
// wave 2
$ref2 = $database->addAttack($row['wref'], 0, $units[1][0], $units[1][1], 0, $units[1][2], $units[1][3], $units[1][4], $units[1][5], 0, 0, 0, 3, 40, 0, 0, 0, 20, 20, 0, 20, 20, 20, 20, array('vid' => $vid, 'endtime' => ($endtime + 1)));
$database->addMovement(3, $row['wref'], $vid, $ref2, time(), $endtime + 1);
$database->addMovement(3, $row['wref'], $vid, $ref2, $time, $endtime + 1);
}
private function checkWWAttacks() {
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'ww_attacks` WHERE `attack_time` <= ' . time());
while ($row = mysql_fetch_assoc($query))
{
// fix for destroyed wws
$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']);
}
@@ -1574,8 +1591,7 @@ class Automation {
$heroxp = $totaldead_def;
$database->modifyHeroXp("experience",$heroxp,$from['owner']);
}
$Defender1 = $database->getUnit($to['wref']);
if($Defender1['hero'] > 0){
if($Defender['hero'] > 0){
$defheroxp = $totaldead_att;
$database->modifyHeroXp("experience",$defheroxp,$toF['owner']);
}
@@ -1874,16 +1890,11 @@ class Automation {
$tblevel = $bdo['f'.$rand];
$tbgid = $bdo['f'.$rand.'t'];
$tbid = $rand;
if($stonemason==0){
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5);
}else{
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
}
if ($battlepart[4]>$needed_cata)
if ($battlepart[4]>$battlepart[3])
{
$info_cat = "".$catp_pic.", ".$this->procResType($tbgid)." destroyed.";
$database->setVillageLevel($data['to'],"f".$tbid."",'0');
if($tbid>=19) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); }
if($tbid>=19 && $tbid!=99) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); }
$buildarray = $GLOBALS["bid".$tbgid];
if ($tbgid==10 || $tbgid==38) {
$tsql=mysql_query("select `maxstore`,`maxcrop` from ".TB_PREFIX."vdata where wref=".$data['to']."");
@@ -1901,6 +1912,9 @@ class Automation {
$q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."'*32 WHERE wref=".$data['to'];
$database->query($q);
}
if ($tbgid==18){
$this->updateMax($database->getVillageField($data['to'],'owner'));
}
$pop=$this->recountPop($data['to']);
$capital = $database->getVillage($data['to']);
if($pop=='0' && $capital['capital']=='0')
@@ -1914,7 +1928,7 @@ class Automation {
}
else
{
$demolish=$battlepart[4]/$needed_cata;
$demolish=$battlepart[4]/$battlepart[3];
$totallvl = round(sqrt(pow(($tblevel+0.5),2)-($battlepart[4]*8)));
if ($tblevel==$totallvl)
$info_cata=" was not damaged.";
@@ -1938,6 +1952,9 @@ class Automation {
$q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."' WHERE wref=".$data['to'];
$database->query($q);
}
if ($tbgid==18){
$this->updateMax($database->getVillageField($data['to'],'owner'));
}
$pop=$this->recountPop($data['to']);
}
$info_cat = "".$catp_pic.",".$this->procResType($tbgid).$info_cata;
@@ -1999,16 +2016,11 @@ class Automation {
$tblevel = $bdo['f'.$rand];
$tbgid = $bdo['f'.$rand.'t'];
$tbid = $rand;
if($stonemason==0){
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5);
}else{
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
}
if (($battlepart[4]/2)>$needed_cata)
if ($battlepart[4]>$battlepart[3])
{
$info_cat = "".$catp_pic.", ".$this->procResType($tbgid)." destroyed.";
$database->setVillageLevel($data['to'],"f".$tbid."",'0');
if($tbid>=19) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); }
if($tbid>=19 && $tbid!=99) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); }
$buildarray = $GLOBALS["bid".$tbgid];
if ($tbgid==10 || $tbgid==38) {
$tsql=mysql_query("select `maxstore`,`maxcrop` from ".TB_PREFIX."vdata where wref=".$data['to']."");
@@ -2026,6 +2038,9 @@ class Automation {
$q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."' WHERE wref=".$data['to'];
$database->query($q);
}
if ($tbgid==18){
$this->updateMax($database->getVillageField($data['to'],'owner'));
}
$pop=$this->recountPop($data['to']);
if($pop=='0')
{
@@ -2041,7 +2056,7 @@ class Automation {
}
else
{
$demolish=($battlepart[4]/2)/$needed_cata;
$demolish=$battlepart[4]/$battlepart[3];
$totallvl = round(sqrt(pow(($tblevel+0.5),2)-(($battlepart[4]/2)*8)));
if ($tblevel==$totallvl)
$info_cata=" was not damaged.";
@@ -2065,6 +2080,9 @@ class Automation {
$q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."' WHERE wref=".$data['to'];
$database->query($q);
}
if ($tbgid==18){
$this->updateMax($database->getVillageField($data['to'],'owner'));
}
$pop=$this->recountPop($data['to']);
}
$info_cat = "".$catp_pic.",".$this->procResType($tbgid).$info_cata;
@@ -2123,17 +2141,12 @@ class Automation {
$tblevel = $bdo['f'.$rand];
$tbgid = $bdo['f'.$rand.'t'];
$tbid = $rand;
if($stonemason==0){
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5);
}else{
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
}
if (($battlepart[4]/2)>$needed_cata)
if ($battlepart[4]>$battlepart[3])
{
$info_cat .= "<br><tbody class=\"goods\"><tr><th>Information</th><td colspan=\"11\">
<img class=\"unit u".$catp_pic."\" src=\"img/x.gif\" alt=\"Catapult\" title=\"Catapult\" /> ".$this->procResType($tbgid)." destroyed.</td></tr></tbody>";
$database->setVillageLevel($data['to'],"f".$tbid."",'0');
if($tbid>=19) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); }
if($tbid>=19 && $tbid!=99) { $database->setVillageLevel($data['to'],"f".$tbid."t",'0'); }
$buildarray = $GLOBALS["bid".$tbgid];
if ($tbgid==10 || $tbgid==38) {
$tsql=mysql_query("select `maxstore`,`maxcrop` from ".TB_PREFIX."vdata where wref=".$data['to']."");
@@ -2151,6 +2164,9 @@ class Automation {
$q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."' WHERE wref=".$data['to'];
$database->query($q);
}
if ($tbgid==18){
$this->updateMax($database->getVillageField($data['to'],'owner'));
}
$pop=$this->recountPop($data['to']);
if($pop=='0')
{
@@ -2167,7 +2183,7 @@ class Automation {
}
else
{
$demolish=($battlepart[4]/2)/$needed_cata;
$demolish=$battlepart[4]/$battlepart[3];
$totallvl = round(sqrt(pow(($tblevel+0.5),2)-(($battlepart[4]/2)*8)));
if ($tblevel==$totallvl)
$info_cata=" was not damaged.";
@@ -2191,6 +2207,9 @@ class Automation {
$q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`='".$tmaxcrop."' WHERE wref=".$data['to'];
$database->query($q);
}
if ($tbgid==18){
$this->updateMax($database->getVillageField($data['to'],'owner'));
}
$pop=$this->recountPop($data['to']);
}
@@ -2633,7 +2652,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
}
}
}
$endtime += time();
$endtime += $AttackArrivalTime;
if($type == 1) {
$database->addNotice($from['owner'],$to['wref'],$ownally,18,''.addslashes($from['name']).' scouts '.addslashes($to['name']).'',$data2,$AttackArrivalTime);
}else {
@@ -2643,15 +2662,15 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$database->addNotice($from['owner'],$to['wref'],$ownally,2,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,$AttackArrivalTime);
}
}
$database->setMovementProc($data['moveid']);
if($chiefing_village != 1 && $village_destroyed != 1){
$database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],time(),$endtime);
$database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],$AttackArrivalTime,$endtime);
// send the bounty on type 6.
if($type !== 1)
{
$reference = $database->sendResource($steal[0],$steal[1],$steal[2],$steal[3],0,0);
$database->addMovement(6,$to['wref'],$from['wref'],$reference,time(),$endtime,1,0,0,0,0,$data['ref']);
$database->addMovement(6,$to['wref'],$from['wref'],$reference,$AttackArrivalTime,$endtime,1,0,0,0,0,$data['ref']);
$totalstolengain=$steal[0]+$steal[1]+$steal[2]+$steal[3];
$totalstolentaken=($totalstolentaken-($steal[0]+$steal[1]+$steal[2]+$steal[3]));
$database->modifyPoints($from['owner'],'RR',$totalstolengain);
@@ -2683,7 +2702,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$database->query($q);
$q = "DELETE FROM ".TB_PREFIX."bdata where wid = ".$data['to'];
$database->query($q);
$q = "DELETE FROM ".TB_PREFIX."enforcement where vref = ".$data['to'];
$q = "DELETE FROM ".TB_PREFIX."enforcement where from = ".$data['to'];
$database->query($q);
$q = "DELETE FROM ".TB_PREFIX."fdata where vref = ".$data['to'];
$database->query($q);
@@ -2707,6 +2726,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
foreach($getmovement as $movedata) {
$time = time();
$time2 = $time - $movedata['starttime'];
$database->setMovementProc($data['moveid']);
$database->addMovement(4,$movedata['to'],$movedata['from'],$movedata['ref'],$time,$time+$time2);
$database->setMovementProc($movedata['moveid']);
}
@@ -2730,22 +2750,6 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$database->modifyUnit($pris['wref'],array("99o"),array($troops),array(0));
$database->deletePrisoners($pris['id']);
}
$enforcement = $database->getEnforceVillage($data['to'],0);
foreach($enforcement as $enforce) {
$time = time();
$fromcoor = $database->getCoor($enforce['vref']);
$tocoor = $database->getCoor($enforce['from']);
$targettribe = $database->getUserField($database->getVillageField($enforce['from'],"owner"),"tribe",0);
$time2 = $this->procDistanceTime($tocoor,$fromcoor,$targettribe,0);
$start = 10*($targettribe-1);
for($i=1;$i<11;$i++){
$unit = $start + $i;
$post['t'.$i] = $enforce['u'.$unit];
}
$post['t11'] = $enforce['hero'];
$reference = $database->addAttack($enforce['from'],$post['t1'],$post['t2'],$post['t3'],$post['t4'],$post['t5'],$post['t6'],$post['t7'],$post['t8'],$post['t9'],$post['t10'],$post['t11'],2,0,0,0,0);
$database->addMovement(4,$enforce['vref'],$enforce['from'],$reference,$time,$time+$time2);
}
}
}
}else{
@@ -2796,9 +2800,10 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
}
}
}
$endtime += $AttackArrivalTime;
$endtime += time();
$database->setMovementProc($data['moveid']);
$database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],time(),$endtime);
$database->addMovement(4,$to['wref'],$from['wref'],$data['ref'],$AttackArrivalTime,$endtime);
$peace = PEACE;
$data2 = ''.$from['owner'].','.$from['wref'].','.$to['owner'].','.$owntribe.','.$unitssend_att.','.$peace.'';
$database->addNotice($from['owner'],$to['wref'],$ownally,22,''.addslashes($from['name']).' attacks '.addslashes($to['name']).'',$data2,time());
@@ -2856,7 +2861,6 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
,$totaldead_def
,$unitsdead_att_check
,$totalattackdead
,$Defender1
,$enforce1
,$defheroowner
,$enforceowner
@@ -3004,7 +3008,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
}
}
$reference = $database->addAttack($enforce['from'],$post['t1'],$post['t2'],$post['t3'],$post['t4'],$post['t5'],$post['t6'],$post['t7'],$post['t8'],$post['t9'],$post['t10'],$post['t11'],2,0,0,0,0);
$database->addMovement(4,$village->wid,$enforce['from'],$reference,time(),($time+time()));
$database->addMovement(4,$village->wid,$enforce['from'],$reference,$AttackArrivalTime,($time+$AttackArrivalTime));
$technology->checkReinf($post['ckey']);
header("Location: build.php?id=39");
@@ -3159,7 +3163,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$dataarray = $database->query_return($q);
foreach($dataarray as $data) {
$to = $database->getMInfo($data['from']);
$user = $database->getUserField($to['owner'],'username',0);
$user = addslashes($database->getUserField($to['owner'],'username',0));
$taken = $database->getVillageState($data['to']);
if($taken != 1){
$database->setFieldTaken($data['to']);
@@ -3802,6 +3806,9 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$q = "UPDATE ".TB_PREFIX."vdata SET `maxcrop`=800 WHERE `maxcrop`<=800 AND wref=".$vil['vref'];
$database->query($q);
}
if ($type==18){
$this->updateMax($database->getVillageField($vil['vref'],'owner'));
}
if ($level==1) { $clear=",f".$vil['buildnumber']."t=0"; } else { $clear=""; }
$q = "UPDATE ".TB_PREFIX."fdata SET f".$vil['buildnumber']."=".($level-1).$clear." WHERE vref=".$vil['vref'];
$database->query($q);
@@ -3834,7 +3841,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$database->modifyHero("lastupdate",time(),$hdata['heroid']);
}
}
if($hdata['experience'] > $hero_levels[$hdata['level']+1] && $hdata['level'] < 100){
while($hdata['experience'] > $hero_levels[$hdata['level']+1] && $hdata['level'] < 100){
mysql_query("UPDATE " . TB_PREFIX ."hero SET level = level + 1 WHERE heroid = '".$hdata['heroid']."'");
mysql_query("UPDATE " . TB_PREFIX ."hero SET points = points + 5 WHERE heroid = '".$hdata['heroid']."'");
}
@@ -4220,9 +4227,7 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
foreach($memberlist as $member) {
$oldrank += $database->getVSumField($member['id'],"pop");
}
if($ally['oldrank'] == 0){
$database->updateoldrankAlly($ally['id'], $oldrank);
}
if($ally['oldrank'] != $oldrank){
if($ally['oldrank'] < $oldrank) {
$totalpoints = $oldrank - $ally['oldrank'];
$database->addclimberrankpopAlly($ally['id'], $totalpoints);
@@ -4235,11 +4240,12 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
}
}
}
}
if(file_exists("GameEngine/Prevention/climbers.txt")) {
unlink("GameEngine/Prevention/climbers.txt");
}
}
private function checkBan() {
global $database;
$time = time();
@@ -4261,7 +4267,30 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$database->updateOasis($oasis['wref']);
}
}
private function updateMax($leader) {
global $bid18, $database;
$q = mysql_query("SELECT * FROM " . TB_PREFIX . "alidata where leader = $leader");
if(mysql_num_rows($q) > 0){
$villages = $database->getVillagesID2($leader);
$max = 0;
foreach($villages as $village){
$field = $database->getResourceLevel($village['wref']);
for($i=19;$i<=40;$i++){
if($field['f'.$i.'t'] == 18){
$level = $field['f'.$i];
$attri = $bid18[$level]['attri'];
}
}
if($attri > $max){
$max = $attri;
}
}
$q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $leader";
$database->query($q);
}
}
private function artefactOfTheFool() {
global $database;
$time = time();
+2 -2
View File
@@ -739,8 +739,8 @@ class Battle {
foreach($DefendersAll as $defenders) {
if($defenders['hero']>0) {
if(!empty($heroarray)) { reset($heroarray); }
$ReinforcerData = $database->getVillageBattleData($defenders['from']);
$heroarraydefender = $this->getBattleHero($ReinforcerData['id']);
$Reinforcer = $database->getVillageField($defenders['from'],"owner");
$heroarraydefender = $this->getBattleHero($Reinforcer);
$_result=mysql_query("select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$heroarraydefender['heroid']."'");
$fdb = mysql_fetch_array($_result);
$hero_id=$fdb['heroid'];
+5 -1
View File
@@ -509,7 +509,7 @@ class Building {
if($this->getTypeLevel(15) >= 10 && $village->capital == 0) { return true; } else { return false; }
break;
case 40:
$wwlevel = $village->resarray['f'.$id];
$wwlevel = $village->resarray['f99'];
if($wwlevel > 50){
$needed_plan = 1;
}else{
@@ -672,10 +672,12 @@ class Building {
public function finishAll() {
global $database,$session,$logging,$village,$bid18,$bid10,$bid11,$technology,$_SESSION;
if($session->access!=BANNED){
$ww = 1;
foreach($this->buildArray as $jobs) {
if($jobs['wid']==$village->wid){
$wwvillage = $database->getResourceLevel($jobs['wid']);
if($wwvillage['f99t']!=40){
$ww = 0;
$level = $jobs['level'];
if($jobs['type'] != 25 AND $jobs['type'] != 26 AND $jobs['type'] != 40) {
$finish = 1;
@@ -715,6 +717,7 @@ class Building {
}
}
}
if($ww == 0){
$database->finishDemolition($village->wid);
$technology->finishTech();
$logging->goldFinLog($village->wid);
@@ -726,6 +729,7 @@ class Building {
$database->query($q);
}
}
}
header("Location: ".$session->referrer);
}else{
header("Location: banned.php");
+22 -3
View File
@@ -221,7 +221,7 @@ class MYSQL_DB {
}
function setDeleting($uid, $mode) {
$time = time() + 72 * 3600;
$time = time() + 5 * 3600;
if(!$mode) {
$q = "INSERT into " . TB_PREFIX . "deleting values ($uid,$time)";
} else {
@@ -693,6 +693,13 @@ class MYSQL_DB {
}
return $newarray;
}
function getVillagesID2($uid) {
$q = "SELECT wref from " . TB_PREFIX . "vdata where owner = $uid order by capital DESC,pop DESC";
$result = mysql_query($q, $this->connection);
$array = $this->mysql_fetch_all($result);
return $array;
}
function getVillage($vid) {
$q = "SELECT * FROM " . TB_PREFIX . "vdata where wref = $vid";
@@ -1861,12 +1868,24 @@ class MYSQL_DB {
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getBuildingByField2($wid,$field) {
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and field = $field and master = 0";
$result = mysql_query($q, $this->connection);
return mysql_num_rows($result);
}
function getBuildingByType($wid,$type) {
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and type = $type and master = 0";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function getBuildingByType2($wid,$type) {
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and type = $type and master = 0";
$result = mysql_query($q, $this->connection);
return mysql_num_rows($result);
}
function getDorf1Building($wid) {
$q = "SELECT * FROM " . TB_PREFIX . "bdata where wid = $wid and field < 19 and master = 0";
@@ -2124,7 +2143,7 @@ class MYSQL_DB {
}
function getARanking() {
$q = "SELECT id,name,tag FROM " . TB_PREFIX . "alidata where id != '' ORDER BY id DESC";
$q = "SELECT id,name,tag,oldrank FROM " . TB_PREFIX . "alidata where id != '' ORDER BY id DESC";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
@@ -2749,7 +2768,7 @@ class MYSQL_DB {
$wid = $row['id'];
$basearray = $this->getOMInfo($wid);
//We switch type of oasis and instert record with apropriate infomation.
$q = "INSERT into " . TB_PREFIX . "odata VALUES ('" . $basearray['id'] . "'," . $basearray['oasistype'] . ",0,400,400,400,400,400,400," . time() . ",100,2,'Unoccupied Oasis',".rand(0,2).")";
$q = "INSERT into " . TB_PREFIX . "odata VALUES ('" . $basearray['id'] . "'," . $basearray['oasistype'] . ",0,800,800,800,800,800,800," . time() . ",100,2,'Unoccupied Oasis',".rand(0,2).")";
$result = mysql_query($q, $this->connection);
}
}
-5
View File
@@ -122,16 +122,11 @@ class Profile {
$form->addError("email",EMAIL_ERROR);
}
if($post['del'] && md5($post['del_pw']) == $session->userinfo['password']) {
if($database->isAllianceOwner($post['uid'])) {
$form->addError("del",ALLI_OWNER);
}
else {
if($session->access!=BANNED){
$database->setDeleting($post['uid'],0);
}else{
header("Location: banned.php");
}
}
}
else {
$form->addError("del",PASS_MISMATCH);
+34 -5
View File
@@ -58,9 +58,11 @@
break;
case 31:
$this->procAttRankArray();
$this->getStart($this->searchRank($session->uid, "userid"));
break;
case 32:
$this->procDefRankArray();
$this->getStart($this->searchRank($session->uid, "userid"));
break;
case 2:
$this->procVRankArray();
@@ -170,8 +172,13 @@
break;
} else {
if(!next($this->rankarray)) {
if($field != "userid"){
return $name;
break;
}else{
return 0;
break;
}
}
}
}
@@ -180,8 +187,9 @@
public function procRankArray() {
global $database, $multisort;
if($database->countUser() > 0){
$holder = array();
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, (
$holder = array();
if(SHOW_NATARS == True){
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, (
SELECT SUM( " . TB_PREFIX . "vdata.pop )
FROM " . TB_PREFIX . "vdata
@@ -200,10 +208,31 @@
)allitag
FROM " . TB_PREFIX . "users
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
AND " . TB_PREFIX . "users.tribe <= 5 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
}else{
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username," . TB_PREFIX . "users.alliance alliance, (
SELECT SUM( " . TB_PREFIX . "vdata.pop )
FROM " . TB_PREFIX . "vdata
WHERE " . TB_PREFIX . "vdata.owner = userid
)totalpop, (
$result = (mysql_query($q));
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
FROM " . TB_PREFIX . "vdata
WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99
)totalvillages, (
SELECT " . TB_PREFIX . "alidata.tag
FROM " . TB_PREFIX . "alidata, " . TB_PREFIX . "users
WHERE " . TB_PREFIX . "alidata.id = " . TB_PREFIX . "users.alliance
AND " . TB_PREFIX . "users.id = userid
)allitag
FROM " . TB_PREFIX . "users
WHERE " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
AND " . TB_PREFIX . "users.tribe <= 3 ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
}
$result = (mysql_query($q));
while($row = mysql_fetch_assoc($result)) {
$datas[] = $row;
}
@@ -354,7 +383,7 @@
WHERE " . TB_PREFIX . "vdata.owner = userid
)pop
FROM " . TB_PREFIX . "users
WHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
WHERE " . TB_PREFIX . "users.dpall >=0 AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . " AND " . TB_PREFIX . "users.tribe <= 3
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)) {
+1 -1
View File
@@ -566,7 +566,7 @@ private function trainUnit($unit,$amt,$great=false) {
if($building->getTypeLevel(22) >= 5 && $building->getTypeLevel(20) >= 5) { return true; } else { return false; }
break;
case 6:
if($building->getTypeLevel(22) >= 5 && $building->getTypeLevel(20) >= 10) { return true; } else { return false; }
if($building->getTypeLevel(22) >= 15 && $building->getTypeLevel(20) >= 10) { return true; } else { return false; }
break;
case 9:
case 29:
+1 -1
View File
@@ -77,7 +77,7 @@ class Units {
}
if($database->isVillageOases($oid) != 0){
$too = $database->getOasisField($oid,"conqured");
if($_GET['conqured'] == 0){$disabledr ="disabled=disabled"; $disabled ="disabled=disabled";}else{
if($too['conqured'] == 0){$disabledr ="disabled=disabled"; $disabled ="disabled=disabled";}else{
$disabledr ="";
if($session->sit == 0){
$disabled ="";
+3
View File
@@ -109,6 +109,9 @@ $neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $do
$image = ($donnees['map_occupied'] == 1 && $donnees['map_fieldtype'] > 0)?(($donnees['ville_user'] == $_SESSION['id_user'])? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b30': 'b20' :'b10' : 'b00') : (($targetalliance != 0)? ($friend==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b31': 'b21' :'b11' : 'b01') : ($war==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b32': 'b22' :'b12' : 'b02') : ($neutral==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b35': 'b25' :'b15' : 'b05') : ($targetalliance == $_SESSION['alliance_user']? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b33': 'b23' :'b13' : 'b03') : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))))) : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))) : $donnees['map_image'];
if($donnees['ville_user']==3 && $donnees['ville_name']=='WW Buildingplan'){
$image = "o99";
}
//Javascript map info
if($yrow!=7){
$map_js .= "[".$donnees['map_x'].",".$donnees['map_y'].",".$donnees['map_fieldtype'].",". ((!empty($donnees['map_oasis'])) ? $donnees['map_oasis'] : 0) .",\"d=".$donnees['map_id']."&c=".$generator->getMapCheck($donnees['map_id'])."\",\"".$image."\"";
+3
View File
@@ -126,6 +126,9 @@ $neutral = (($neutralarray[0]['alli1']>0 and $neutralarray[0]['alli2']>0 and $do
$image = ($donnees['map_occupied'] == 1 && $donnees['map_fieldtype'] > 0)?(($donnees['ville_user'] == $_SESSION['id_user'])? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b30': 'b20' :'b10' : 'b00') : (($targetalliance != 0)? ($friend==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b31': 'b21' :'b11' : 'b01') : ($war==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b32': 'b22' :'b12' : 'b02') : ($neutral==1? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b35': 'b25' :'b15' : 'b05') : ($targetalliance == $_SESSION['alliance_user']? ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b33': 'b23' :'b13' : 'b03') : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))))) : ($donnees['ville_pop']>=100? $donnees['ville_pop']>= 250?$donnees['ville_pop']>=500? 'b34': 'b24' :'b14' : 'b04'))) : $donnees['map_image'];
if($donnees['ville_user']==3 && $donnees['ville_name']=='WW Buildingplan'){
$image = "o99";
}
//Javascript map info
if($yrow!=13){
$map_js .= "[".$donnees['map_x'].",".$donnees['map_y'].",".$donnees['map_fieldtype'].",". ((!empty($donnees['map_oasis'])) ? $donnees['map_oasis'] : 0) .",\"d=".$donnees['map_id']."&c=".$generator->getMapCheck($donnees['map_id'])."\",\"".$image."\"";
+1 -1
View File
@@ -505,7 +505,7 @@ if ($rRes!=$rSubmited){ ?>
<?php } elseif($_SESSION['qst']== 15){
// Ask from plyer ?>
{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> Task 16: Weapons or Dough<\/h1><br \/><i>&rdquo;Now you have to make a decision: Either trade peacefully or become a dreaded warrior.\r\n<br \/><br \/>\r\nFor the marketplace you need a granary, for the barracks you need a rally point.&rdquo;<\/i><br \/><br \/><input type=\"hidden\" id=\"qst_val\" value=\"\" \/><input onclick=\"javascript: qst_next('','19');\" type=\"button\" value=\"Economy\" class=\"qb1\"\/><input onclick=\"javascript: qst_next('','16');\" type=\"button\" value=\"Military\" class=\"qb2\" \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"granary_rally\"><\/div>\n\t\t","number":"-19","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> Task 15: Weapons or Dough<\/h1><br \/><i>&rdquo;Now you have to make a decision: Either trade peacefully or become a dreaded warrior.\r\n<br \/><br \/>\r\nFor the marketplace you need a granary, for the barracks you need a rally point.&rdquo;<\/i><br \/><br \/><input type=\"hidden\" id=\"qst_val\" value=\"\" \/><input onclick=\"javascript: qst_next('','19');\" type=\"button\" value=\"Economy\" class=\"qb1\"\/><input onclick=\"javascript: qst_next('','16');\" type=\"button\" value=\"Military\" class=\"qb2\" \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"granary_rally\"><\/div>\n\t\t","number":"-19","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
<?php } elseif($_SESSION['qst']== 16){
+80 -45
View File
@@ -43,25 +43,60 @@ $greatwarehouse = $building->getTypeLevel(38);
$greatgranary = $building->getTypeLevel(39);
$greatworkshop = $building->getTypeLevel(42);
foreach ($database->getJobs($_SESSION['wid']) as $bdata) {
$UnderConstruction = strtolower(str_replace(array(" ","'"),"",$building->procResType($bdata['type'])));
$$UnderConstruction = ($$UnderConstruction == 0 ? -1 : $$UnderConstruction);
}
$mainbuilding1 = $database->getBuildingByType2($village->wid,15);
$cranny1 = $database->getBuildingByType2($village->wid,23);
$granary1 = $database->getBuildingByType2($village->wid,11);
$warehouse1 = $database->getBuildingByType2($village->wid,10);
$embassy1 = $database->getBuildingByType2($village->wid,18);
$wall1 = $database->getBuildingByField2($village->wid,40);
$rallypoint1 = $database->getBuildingByType2($village->wid,16);
$hero1 = $database->getBuildingByType2($village->wid,37);
$market1 = $database->getBuildingByType2($village->wid,17);
$barrack1 = $database->getBuildingByType2($village->wid,19);
$cropland1 = $database->getBuildingByType2($village->wid,4);
$grainmill1 = $database->getBuildingByType2($village->wid,8);
$residence1 = $database->getBuildingByType2($village->wid,25);
$academy1 = $database->getBuildingByType2($village->wid,22);
$armoury1 = $database->getBuildingByType2($village->wid,13);
$woodcutter1 = $database->getBuildingByType2($village->wid,1);
$palace1 = $database->getBuildingByType2($village->wid,26);
$claypit1 = $database->getBuildingByType2($village->wid,2);
$ironmine1 = $database->getBuildingByType2($village->wid,3);
$blacksmith1 = $database->getBuildingByType2($village->wid,12);
$stable1 = $database->getBuildingByType2($village->wid,20);
$trapper1 = $database->getBuildingByType2($village->wid,36);
$treasury1 = $database->getBuildingByType2($village->wid,27);
$sawmill1 = $database->getBuildingByType2($village->wid,5);
$brickyard1 = $database->getBuildingByType2($village->wid,6);
$ironfoundry1 = $database->getBuildingByType2($village->wid,7);
$workshop1 = $database->getBuildingByType2($village->wid,21);
$stonemasonslodge1 = $database->getBuildingByType2($village->wid,34);
$townhall1 = $database->getBuildingByType2($village->wid,24);
$tournamentsquare1 = $database->getBuildingByType2($village->wid,14);
$bakery1 = $database->getBuildingByType2($village->wid,9);
$tradeoffice1 = $database->getBuildingByType2($village->wid,28);
$greatbarracks1 = $database->getBuildingByType2($village->wid,29);
$greatstable1 = $database->getBuildingByType2($village->wid,30);
$brewery1 = $database->getBuildingByType2($village->wid,35);
$horsedrinkingtrough1 = $database->getBuildingByType2($village->wid,41);
$herosmansion1 = $database->getBuildingByType2($village->wid,37);
$greatwarehouse1 = $database->getBuildingByType2($village->wid,38);
$greatgranary1 = $database->getBuildingByType2($village->wid,39);
$greatworkshop1 = $database->getBuildingByType2($village->wid,42);
?>
<div id="build" class="gid0"><h1>Construct new building</h1>
<?php
if($mainbuilding == 0 && $id != 39 && $id != 40) {
if($mainbuilding == 0 && $mainbuilding1 == 0 && $id != 39 && $id != 40) {
include("avaliable/mainbuilding.tpl");
}
if(($cranny == 0 || $cranny == 10) && $mainbuilding >= 1 && $id != 39 && $id != 40) {
if((($cranny == 0 && $cranny1 == 0) || $cranny == 10) && $mainbuilding >= 1 && $id != 39 && $id != 40) {
include("avaliable/cranny.tpl");
}
if(($granary == 0 || $granary == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40 ) {
if((($granary == 0 && $granary1 == 0) || $granary == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40 ) {
include("avaliable/granary.tpl");
}
if($wall == 0) {
if($wall == 0 && $wall1 == 0) {
if($session->tribe == 1 && $id != 39) {
include("avaliable/citywall.tpl");
}
@@ -78,7 +113,7 @@ if($wall == 0) {
include("avaliable/citywall.tpl");
}
}
if(($warehouse == 0 || $warehouse == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40) {
if((($warehouse == 0 && $warehouse1 == 0) || $warehouse == 20) && $mainbuilding >= 1 && $id != 39 && $id != 40) {
include("avaliable/warehouse.tpl");
}
if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
@@ -86,43 +121,43 @@ if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session
}
if($mainbuilding >= 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
include("avaliable/greatgranary.tpl");
}
if(($trapper ==0 || $trapper == 20) && $rallypoint >= 1 && $session->tribe == 3 && $id != 39 && $id != 40) {
}
if((($trapper == 0 && $trapper1 == 0) || $trapper == 20) && $rallypoint >= 1 && $session->tribe == 3 && $id != 39 && $id != 40) {
include("avaliable/trapper.tpl");
}
if($rallypoint == 0 && $id != 40) {
if($rallypoint == 0 && $rallypoint1 == 0 && $id != 40) {
include("avaliable/rallypoint.tpl");
}
if($embassy == 0 && $id != 39 && $id != 40) {
if($embassy == 0 && $embassy1 == 0 && $id != 39 && $id != 40) {
include("avaliable/embassy.tpl");
}
//fix hero
if($hero == 0 && $mainbuilding >= 3 && $rallypoint >= 1 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) {
if($hero == 0 && $hero1 == 0 && $mainbuilding >= 3 && $rallypoint >= 1 && $id != 39 && $id != 40) {
include("avaliable/hero.tpl");
}
//fix barracks
if($rallypoint >= 1 && $mainbuilding >= 3 && $barrack == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) {
if($rallypoint >= 1 && $mainbuilding >= 3 && $barrack == 0 && $barrack1 == 0 && $id != 39 && $id != 40) {
include("avaliable/barracks.tpl");
}
if($mainbuilding >= 3 && $academy >= 1 && $armoury == 0 && $id != 39 && $id != 40) {
if($mainbuilding >= 3 && $academy >= 1 && $armoury == 0 && $armoury1 == 0 && $id != 39 && $id != 40) {
include("avaliable/armoury.tpl");
}
if($cropland >= 5 && $grainmill == 0 && $id != 39 && $id != 40) {
if($cropland >= 5 && $grainmill == 0 && $grainmill1 == 0 && $id != 39 && $id != 40) {
include("avaliable/grainmill.tpl");
}
//fix marketplace
if($granary >= 1 && $warehouse >= 1 && $mainbuilding >= 3 && $market == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40) {
if($granary >= 1 && $warehouse >= 1 && $mainbuilding >= 3 && $market == 0 && $market1 == 0 && $id != 39 && $id != 40) {
include("avaliable/marketplace.tpl");
}
//fix residence
if($mainbuilding >= 5 && $residence == 0 && $$UnderConstruction <> -1 && $id != 39 && $id != 40 && $palace == 0) {
if($mainbuilding >= 5 && $residence == 0 && $residence1 == 0 && $id != 39 && $id != 40 && $palace == 0 && $palace1 == 0) {
include("avaliable/residence.tpl");
}
if($academy == 0 && $mainbuilding >= 3 && $barrack >= 3 && $id != 39 && $id != 40) {
if($academy == 0 && $academy1 == 0 && $mainbuilding >= 3 && $barrack >= 3 && $id != 39 && $id != 40) {
include("avaliable/academy.tpl");
}
//fix palace
if($palace == 0 && $embassy >= 1 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $residence == 0) {
if($palace == 0 && $palace1 == 0 && $embassy >= 1 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $residence == 0 && $residence1 == 0) {
//Fix Castle
//id user
@@ -156,55 +191,55 @@ if (!$test){
//end Fix
}
if($blacksmith == 0 && $academy >= 3 && $mainbuilding >= 3 && $id != 39 && $id != 40) {
if($blacksmith == 0 && $blacksmith1 == 0 && $academy >= 3 && $mainbuilding >= 3 && $id != 39 && $id != 40) {
include("avaliable/blacksmith.tpl");
}
if($stonemasonslodge == 0 && $palace >= 3 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $village->capital == 1) {
if($stonemasonslodge == 0 && $stonemasonslodge1 == 0 && $palace >= 3 && $mainbuilding >= 5 && $id != 39 && $id != 40 && $village->capital == 1) {
include("avaliable/stonemason.tpl");
}
if($stable == 0 && $blacksmith >= 3 && $academy >= 5 && $id != 39 && $id != 40) {
if($stable == 0 && $stable1 == 0 && $blacksmith >= 3 && $academy >= 5 && $id != 39 && $id != 40) {
include("avaliable/stable.tpl");
}
if($treasury == 0 && $mainbuilding >= 10 && $id != 39 && $id != 40) {
if($treasury == 0 && $treasury1 == 0 && $mainbuilding >= 10 && $id != 39 && $id != 40) {
include("avaliable/treasury.tpl");
}
if($brickyard == 0 && $claypit >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40 ) {
if($brickyard == 0 && $brickyard1 == 0 && $claypit >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40 ) {
include("avaliable/brickyard.tpl");
}
if($sawmill == 0 && $woodcutter >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
if($sawmill == 0 && $sawmill1 == 0 && $woodcutter >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
include("avaliable/sawmill.tpl");
}
if($ironfoundry == 0 && $ironmine >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
if($ironfoundry == 0 && $ironfoundry1 == 0 && $ironmine >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
include("avaliable/ironfoundry.tpl");
}
if($workshop == 0 && $academy >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
if($workshop == 0 && $workshop1 == 0 && $academy >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
include("avaliable/workshop.tpl");
}
if($tournamentsquare == 0 && $rallypoint >= 15 && $id != 39 && $id != 40) {
if($tournamentsquare == 0 && $tournamentsquare1 == 0 && $rallypoint >= 15 && $id != 39 && $id != 40) {
include("avaliable/tsquare.tpl");
}
if($bakery == 0 && $grainmill >= 5 && $cropland >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
if($bakery == 0 && $bakery1 == 0 && $grainmill >= 5 && $cropland >= 10 && $mainbuilding >= 5 && $id != 39 && $id != 40) {
include("avaliable/bakery.tpl");
}
if($townhall == 0 && $mainbuilding >= 10 && $academy >= 10 && $id != 39 && $id != 40) {
if($townhall == 0 && $townhall1 == 0 && $mainbuilding >= 10 && $academy >= 10 && $id != 39 && $id != 40) {
include("avaliable/townhall.tpl");
}
if($tradeoffice == 0 && $market == 20 && $stable >= 10 && $id != 39 && $id != 40) {
if($tradeoffice == 0 && $tradeoffice1 == 0 && $market == 20 && $stable >= 10 && $id != 39 && $id != 40) {
include("avaliable/tradeoffice.tpl");
}
if($session->tribe == 1 && $horsedrinkingtrough == 0 && $rallypoint >= 10 && $stable == 20 && $id != 39 && $id != 40) {
if($session->tribe == 1 && $horsedrinkingtrough == 0 && $horsedrinkingtrough1 == 0 && $rallypoint >= 10 && $stable == 20 && $id != 39 && $id != 40) {
include("avaliable/horsedrinking.tpl");
}
if($session->tribe == 2 && $brewery == 0 && $rallypoint >= 10 && $granary == 20 && $id != 39 && $id != 40) {
if($session->tribe == 2 && $brewery == 0 && $brewery1 == 0 && $rallypoint >= 10 && $granary == 20 && $id != 39 && $id != 40) {
include("avaliable/brewery.tpl");
}
if($greatbarracks == 0 && $barrack == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
if($greatbarracks == 0 && $greatbarracks1 == 0 && $barrack == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
include("avaliable/greatbarracks.tpl");
}
if($greatstable == 0 && $stable == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
if($greatstable == 0 && $greatstable1 == 0 && $stable == 20 && $village->capital == 0 && $id != 39 && $id != 40) {
include("avaliable/greatstable.tpl");
}
if($greatworkshop == 0 && $workshop == 20 && $village->capital == 0 && $id != 39 && $id != 40 && GREAT_WKS) {
if($greatworkshop == 0 && $greatworkshop1 == 0 && $workshop == 20 && $village->capital == 0 && $id != 39 && $id != 40 && GREAT_WKS) {
include("avaliable/greatworkshop.tpl");
}
if($id != 39 && $id != 40) {
@@ -213,19 +248,19 @@ if($id != 39 && $id != 40) {
<div id="build_list_soon" class="hide">
<?php
if($rallypoint == 0 && $session->tribe == 3 && $trapper == 0 ) {
if($rallypoint == 0 && $session->tribe == 3 && $trapper == 0) {
include("soon/trapper.tpl");
}
if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid) {
include("soon/greatwarehouse.tpl");
}
if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid ) {
if($mainbuilding < 10 && $village->capital == 0 && $largeA['owner'] == $session->uid || $normalA['vref'] == $village->wid) {
include("soon/greatgranary.tpl");
}
if($hero == 0 && ($mainbuilding <= 2 || $rallypoint == 0)){
include("soon/hero.tpl");
}
if($barrack == 0 && ($rallypoint == 0 || $mainbuilding <= 2) ) {
if($barrack == 0 && ($rallypoint == 0 || $mainbuilding <= 2)) {
include("soon/barracks.tpl");
}
if($armoury == 0 && ($mainbuilding <= 2 || $academy == 0)) {
@@ -237,13 +272,13 @@ if($cropland <= 4) {
if($marketplace == 0 && ($mainbuilding <= 2 || $granary <= 0 || $warehouse <= 0)) {
include("soon/marketplace.tpl");
}
if($residence == 0 && $mainbuilding <= 4) {
if($residence == 0 && $palace == 0 && $mainbuilding <= 4) {
include("soon/residence.tpl");
}
if($academy == 0 && ($mainbuilding <= 2 || $barrack <= 2)) {
include("soon/academy.tpl");
}
if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4) {
if($embassy == 0 || $mainbuilding >= 2 && $mainbuilding <= 4 && $palace == 0 && $residence == 0) {
//Fix Castle
//id user
+2 -2
View File
@@ -1,7 +1,7 @@
<h2>Brewery</h2>
<h2>Brewery</h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc">In the Teutons brewery mead is brewed, the soldiers drink to give themselves Dutch courage before battle. The higher the level of the brewery, the greater is the attack bonus. The mead-festivals always last 72 hours.</td>
<td class="desc">In the Teutons brewery mead is brewed, the soldiers drink to give themselves Dutch courage before battle. The higher the level of the brewery, the greater is the attack bonus. The mead-festivals always last 72 hours.</td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(19,4);">
<img class="building g35" src="img/x.gif" alt="Brewery" title="Brewery" /></a>
+1 -1
View File
@@ -1,7 +1,7 @@
<h2>Tournament Square</h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc">At the tournament square your troops can train to increase their stamina. The further the building is upgraded the faster your troops are beyond a minimum distance of 30 squares.</td>
<td class="desc">At the tournament square your troops can train to increase their stamina. The further the building is upgraded the faster your troops are beyond a minimum distance of <?php echo TS_THRESHOLD; ?> squares.</td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(14,4);">
<img class="building g14" src="img/x.gif" alt="Tournament Square" title="Tournament Square" /></a>
+1 -1
View File
@@ -1,7 +1,7 @@
<h2>Tournament Square</h2>
<table class="new_building" cellpadding="1" cellspacing="1">
<tbody><tr>
<td class="desc">At the tournament square your troops can train to increase their stamina. The further the building is upgraded the faster your troops are beyond a minimum distance of 30 squares.</td>
<td class="desc">At the tournament square your troops can train to increase their stamina. The further the building is upgraded the faster your troops are beyond a minimum distance of <?php echo TS_THRESHOLD; ?> squares.</td>
<td rowspan="3" class="bimg">
<a href="#" onClick="return Popup(14,4);">
<img class="building g14" src="img/x.gif" alt="Tournament Square" title="Tournament Square" /></a>
+4
View File
@@ -78,8 +78,12 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "<span class=\"none\">Upgrade Granary.</span>";
}
else if($bindicate == 7) {
if($village->allcrop > 0){
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
}else{
echo "<span class=\"none\">Your crop production is negative, you will never get the required resources.</span>";
}
if($session->goldclub == 1){
?> </br>
<?php
+5 -1
View File
@@ -1,7 +1,7 @@
<?php
$bid = $village->resarray['f'.$id.'t'];
$bindicate = $building->canBuild($id,$bid);
$wwlevel = $village->resarray['f'.$id];
$wwlevel = $village->resarray['f99'];
if($wwlevel > 50){
$needed_plan = 1;
}else{
@@ -109,8 +109,12 @@ if($session->userinfo['gold'] >= 3 && $building->getTypeLevel(17) >= 1) {
echo "<span class=\"none\">Upgrade Granary.</span>";
}
else if($bindicate == 7) {
if($village->allcrop > 0){
$neededtime = $building->calculateAvaliable($id,$village->resarray['f'.$id.'t'],1+$loopsame+$doublebuild+$master);
echo "<span class=\"none\">Enough resources ".$neededtime[0]." at ".$neededtime[1]."</span>";
}else{
echo "<span class=\"none\">Your crop production is negative, you will never get the required resources.</span>";
}
if($session->goldclub == 1){
?> </br>
<?php
+1 -1
View File
@@ -1,4 +1,4 @@
<h1><img class="unit ugeb" src="img/x.gif"> Tournament Square</h1><img class="building g14" src="img/x.gif" alt="Tournament Square" title="Tournament Square" />Your troops can increase their stamina at the tournament square. The further the building is upgraded the faster your troops are beyond a minimum distance of 30 squares.<p><b>Costs</b> and <b>construction time</b> for level 1:<br /><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" />1750 | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" />2250 | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" />1530 | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" />240 | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" />1 | <span class="dur"><img class="clock" alt="duration" title="duration" src="img/x.gif" />0:58:20</span></p>
<h1><img class="unit ugeb" src="img/x.gif"> Tournament Square</h1><img class="building g14" src="img/x.gif" alt="Tournament Square" title="Tournament Square" />Your troops can increase their stamina at the tournament square. The further the building is upgraded the faster your troops are beyond a minimum distance of <?php echo TS_THRESHOLD; ?> squares.<p><b>Costs</b> and <b>construction time</b> for level 1:<br /><img class="r1" src="img/x.gif" alt="Lumber" title="Lumber" />1750 | <img class="r2" src="img/x.gif" alt="Clay" title="Clay" />2250 | <img class="r3" src="img/x.gif" alt="Iron" title="Iron" />1530 | <img class="r4" src="img/x.gif" alt="Crop" title="Crop" />240 | <img class="r5" src="img/x.gif" alt="Crop consumption" title="Crop consumption" />1 | <span class="dur"><img class="clock" alt="duration" title="duration" src="img/x.gif" />0:58:20</span></p>
<p><b>Prerequisites</b><br /><a href="manual.php?typ=4&gid=16">Rally Point</a> Level 15</p><map id="nav" name="nav">
<area href="manual.php?typ=4&amp;s=12" title="back" coords="0,0,45,18" shape="rect" alt="" />
<area href="manual.php?s=1" title="Overview" coords="46,0,70,18" shape="rect" alt="" />
+1 -1
View File
@@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) {
if (mysql_num_rows($MyGold)) {
if($golds['b2'] == 0) {
mysql_query("UPDATE ".TB_PREFIX."users set b2 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error());
mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
} else {
mysql_query("UPDATE ".TB_PREFIX."users set b2 = '".($golds['b2']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
}
+1 -1
View File
@@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) {
if (mysql_num_rows($MyGold)) {
if($golds['b3'] == 0) {
mysql_query("UPDATE ".TB_PREFIX."users set b3 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error());
mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
} else {
mysql_query("UPDATE ".TB_PREFIX."users set b3 = '".($golds['b3']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
}
+1 -1
View File
@@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) {
if (mysql_num_rows($MyGold)) {
if($golds['b4'] == 0) {
mysql_query("UPDATE ".TB_PREFIX."users set b4 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error());
mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
} else {
mysql_query("UPDATE ".TB_PREFIX."users set b4 = '".($golds['b4']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
}
+1 -1
View File
@@ -22,7 +22,7 @@ if (mysql_num_rows($MyGold)) {
if (mysql_num_rows($MyGold)) {
if($golds['b1'] == 0) {
mysql_query("UPDATE ".TB_PREFIX."users set b1 = ('".time()."')+".PLUS_PRODUCTION." where `id`='".$session->uid."'") or die(mysql_error());
mysql_query("UPDATE ".TB_PREFIX."users set b1 = '".(time()+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
} else {
mysql_query("UPDATE ".TB_PREFIX."users set b1 = '".($golds['b1']+PLUS_PRODUCTION)."' where `id`='".$session->uid."'") or die(mysql_error());
}
+1 -1
View File
@@ -42,7 +42,7 @@
<th>Players online</th>
<td><?php
$online = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (60*30) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
$online = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE ".time()."-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
echo $online; ?></td>
</tr>
</tbody>
+1 -1
View File
@@ -5,7 +5,7 @@ if (WW == True)
FROM " . TB_PREFIX . "users
INNER JOIN " . TB_PREFIX . "vdata ON " . TB_PREFIX . "users.id = " . TB_PREFIX . "vdata.owner
INNER JOIN " . TB_PREFIX . "fdata ON " . TB_PREFIX . "fdata.vref = " . TB_PREFIX . "vdata.wref
WHERE " . TB_PREFIX . "fdata.f99t = 40 ORDER BY " . TB_PREFIX . "fdata.f99 Desc LIMIT 20");
WHERE " . TB_PREFIX . "fdata.f99t = 40 ORDER BY " . TB_PREFIX . "fdata.f99 Desc, id Desc LIMIT 20");
?>
<table cellpadding="1" cellspacing="1" id="villages" class="row_table_data">
<thead>
+3 -3
View File
@@ -4,10 +4,10 @@
$lid = $_POST['lid'];
$tribe = $_POST['tribe'];
$getFLData = $database->getFLData($lid);
$unitslist = $database->getFLData($lid);
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$lid."");
$sql = "SELECT * FROM ".TB_PREFIX."raidlist WHERE lid = ".$lid." order by id asc";
$array = $database->query_return($sql);
foreach($array as $row){
$sql1 = mysql_fetch_array(mysql_query("SELECT * FROM ".TB_PREFIX."units WHERE vref = ".$getFLData['wref']));
while($row = mysql_fetch_array($sql)){
$sid = $row['id'];
$wref = $row['towref'];
$t1 = $row['t1'];$t2 = $row['t2'];$t3 = $row['t3'];$t4 = $row['t4'];$t5 = $row['t5'];
+1 -1
View File
@@ -51,7 +51,7 @@ if(isset($_GET['o'])) {
$o = preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['o']);
$oid = preg_replace("/[^a-zA-Z0-9_-]/","",$_GET['z']);
$too = $database->getOasisField($oid,"conqured");
if($_GET['conqured'] == 0){$disabledr ="disabled=disabled"; $disabled ="disabled=disabled";}else{
if($too['conqured'] == 0){$disabledr ="disabled=disabled"; $disabled ="disabled=disabled";}else{
$disabledr ="";
if($session->sit == 0){
$disabled ="";
+3 -1
View File
@@ -345,4 +345,6 @@ include("Templates/links.tpl");
</html>
<?php
}else{
}
header("Location: spieler.php");
}
?>
+1
View File
@@ -70,6 +70,7 @@ if(REG_OPEN == true){ ?>
<th><?php echo PASSWORD; ?></th>
<td>
<input class="text" type="password" name="pw" value="<?php echo stripslashes($form->getValue('pw')); ?>" maxlength="20" />
<span style="color: #DD0000"><b>Warning:</b> password with & can cause problems!</span>
<span class="error"><?php echo $form->getError('pw'); ?></span>
</td>
</tr>
+3
View File
@@ -17,6 +17,9 @@ if(isset($_GET['newdid'])) {
$_SESSION['wid'] = $_GET['newdid'];
header("Location: ".$_SERVER['PHP_SELF'].(isset($_GET['id'])?'?id='.$_GET['id']:(isset($_GET['gid'])?'?gid='.$_GET['gid']:'')));
}
if($_GET['id'] == 99 && $village->natar == 0){
header("Location: dorf2.php");
}
if(isset($_GET['buildingFinish'])) {
if($session->gold >= 2) {
$building->finishAll();
+1 -1
View File
@@ -153,7 +153,7 @@ include ("GameEngine/Lang/".LANG.".php");
<td><?php
$online = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*30) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
$online = mysql_num_rows(mysql_query("SELECT * FROM " . TB_PREFIX . "users WHERE " . time() . "-timestamp < (60*10) AND tribe!=0 AND tribe!=4 AND tribe!=5"));
echo $online;
?></td>
+3
View File
@@ -95,6 +95,9 @@ define("PROTECTION","%BEGINNER%");
// ***** Enable WW Statistics
define("WW",%WW%);
// ***** Show Natars in Statistics
define("SHOW_NATARS",%SHOW_NATARS%);
// ***** Enable T4 is Coming screen
define("T4_COMING",%T4_COMING%);
+1
View File
@@ -92,6 +92,7 @@ class Process {
$text = preg_replace("'%GREAT_WKS%'", $_POST['great_wks'], $text);
$text = preg_replace("'%TS_THRESHOLD%'", $_POST['ts_threshold'], $text);
$text = preg_replace("'%WW%'", $_POST['ww'], $text);
$text = preg_replace("'%SHOW_NATARS%'", $_POST['show_natars'], $text);
$text = preg_replace("'%T4_COMING%'", $_POST['t4_coming'], $text);
$text = preg_replace("'%REG_OPEN%'", $_POST['reg_open'], $text);
$text = preg_replace("'%PEACE%'", $_POST['peace'], $text);
+6
View File
@@ -91,6 +91,12 @@ echo "<div class=\"headline\"><span class=\"f10 c5\">Error creating constant.php
<option value="False" selected="selected">False</option>
</select>
</td></tr><tr></tr>
<td><span class="f9 c6">Show Natars in Statistics:</span></td><td>
<select name="show_natars">
<option value="True">True</option>
<option value="False" selected="selected">False</option>
</select>
</td></tr><tr></tr>
<td><span class="f9 c6">Peace system:</span></td><td>
<select name="peace">
<option value="0" selected="selected">None</option>
-1178
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -149,6 +149,8 @@ else if (isset($_GET['s'])) {
if($_GET['s'] > 4 or $session->sit == 1) {
header("Location: ".$_SERVER['PHP_SELF']."?uid=".preg_replace("/[^a-zA-Z0-9_-]/","",$session->uid));
}
}else{
header("Location: ".$_SERVER['PHP_SELF']."?uid=".preg_replace("/[^a-zA-Z0-9_-]/","",$session->uid));
}
?>
</div>
+2 -2
View File
@@ -72,9 +72,9 @@ if(isset($_POST['result'])) {
echo "</b></p>";
if (isset($_POST['result'][3])&&isset($_POST['result'][4])){
if ($_POST['result'][4]>$_POST['result'][3]){
echo "Building destroid";
echo "<p>Building destroyed</p>";
}elseif ($_POST['result'][4]==0){
echo "The building isn't destroid";
echo "<p>The building isn't destroyed</p>";
}else{
$demolish=$_POST['result'][4]/$_POST['result'][3];
//$Katalife=round($_POST['result'][4]-($_POST['result'][4]*$_POST['result'][1]));