finish hero_full.php

This commit is contained in:
yi12345
2013-06-16 10:38:34 +03:00
commit 98e94af807
2800 changed files with 115529 additions and 0 deletions
+240
View File
@@ -0,0 +1,240 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Account.php ##
## Developed by: Songer & Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
include("Session.php");
class Account {
function Account() {
global $session;
if(isset($_POST['ft'])) {
switch($_POST['ft']) {
case "a1":
$this->Signup();
break;
case "a2":
$this->Activate();
break;
case "a3":
$this->Unreg();
break;
case "a4":
$this->Login();
break;
}
} if(isset($_GET['code'])) {
$_POST['id'] = $_GET['code']; $this->Activate();
}
else {
if($session->logged_in && in_array("logout.php",explode("/",$_SERVER['PHP_SELF']))) {
$this->Logout();
}
}
}
private function Signup() {
global $database,$form,$mailer,$generator,$session;
if(!isset($_POST['name']) || trim($_POST['name']) == "") {
$form->addError("name",USRNM_EMPTY);
}
else {
if(strlen($_POST['name']) < USRNM_MIN_LENGTH) {
$form->addError("name",USRNM_SHORT);
}
else if(!USRNM_SPECIAL && preg_match('/[^0-9A-Za-z]/',$_POST['name'])) {
$form->addError("name",USRNM_CHAR);
}
else if($database->checkExist($_POST['name'],0)) {
$form->addError("name",USRNM_TAKEN);
}
else if($database->checkExist_activate($_POST['name'],0)) {
$form->addError("name",USRNM_TAKEN);
}
}
if(!isset($_POST['pw']) || trim($_POST['pw']) == "") {
$form->addError("pw",PW_EMPTY);
}
else {
if(strlen($_POST['pw']) < PW_MIN_LENGTH) {
$form->addError("pw",PW_SHORT);
}
else if($_POST['pw'] == $_POST['name']) {
$form->addError("pw",PW_INSECURE);
}
}
if(!isset($_POST['email'])) {
$form->addError("email",EMAIL_EMPTY);
}
else {
if(!$this->validEmail($_POST['email'])) {
$form->addError("email",EMAIL_INVALID);
}
else if($database->checkExist($_POST['email'],1)) {
$form->addError("email",EMAIL_TAKEN);
}
else if($database->checkExist_activate($_POST['email'],1)) {
$form->addError("email",EMAIL_TAKEN);
}
}
if(!isset($_POST['vid'])) {
$form->addError("tribe",TRIBE_EMPTY);
}
if(!isset($_POST['agb'])) {
$form->addError("agree",AGREE_ERROR);
}
if($form->returnErrors() > 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: anmelden.php");
}
else {
if(AUTH_EMAIL){
$act = $generator->generateRandStr(10);
$act2 = $generator->generateRandStr(5);
$uid = $database->activate($_POST['name'],md5($_POST['pw']),$_POST['email'],$_POST['vid'],$_POST['kid'],$act,$act2);
if($uid) {
$mailer->sendActivate($_POST['email'],$_POST['name'],$_POST['pw'],$act);
header("Location: activate.php?id=$uid&q=$act2");
}
}
else {
$uid = $database->register($_POST['name'],md5($_POST['pw']),$_POST['email'],$_POST['vid'],$act);
if($uid) {
setcookie("COOKUSR",$_POST['name'],time()+COOKIE_EXPIRE,COOKIE_PATH);
setcookie("COOKEMAIL",$_POST['email'],time()+COOKIE_EXPIRE,COOKIE_PATH);
$database->updateUserField($uid,"act","",1);
$database->updateUserField($uid,"invited",$_POST['invited'],1);
$this->generateBase($_POST['kid'],$uid,$_POST['name']);
header("Location: login.php");
}
}
}
}
private function Activate() {
if(START_DATE < date('m/d/Y') or START_DATE == date('m/d/Y') && START_TIME <= date('H:i'))
{
global $database;
$q = "SELECT * FROM ".TB_PREFIX."activate where act = '".$_POST['id']."'";
$result = mysql_query($q, $database->connection);
$dbarray = mysql_fetch_array($result);
if($dbarray['act'] == $_POST['id']) {
$uid = $database->register($dbarray['username'],$dbarray['password'],$dbarray['email'],$dbarray['tribe'],"");
if($uid) {
$database->unreg($dbarray['username']);
$this->generateBase($dbarray['kid'],$uid,$dbarray['username']);
header("Location: activate.php?e=2");
}
}
else
{
header("Location: activate.php?e=3");
}
}
else
{
header("Location: activate.php");
}
}
private function Unreg() {
global $database;
$q = "SELECT * FROM ".TB_PREFIX."activate where id = '".$_POST['id']."'";
$result = mysql_query($q, $database->connection);
$dbarray = mysql_fetch_array($result);
if(md5($_POST['pw']) == $dbarray['password']) {
$database->unreg($dbarray['username']);
header("Location: anmelden.php");
}
else {
header("Location: activate.php?e=3");
}
}
private function Login() {
global $database,$session,$form;
if(!isset($_POST['user']) || $_POST['user'] == "") {
$form->addError("user",LOGIN_USR_EMPTY);
}
else if(!$database->checkExist($_POST['user'],0)) {
$form->addError("user",USR_NT_FOUND);
}
if(!isset($_POST['pw']) || $_POST['pw'] == "") {
$form->addError("pw",LOGIN_PASS_EMPTY);
}
else if(!$database->login($_POST['user'],$_POST['pw']) && !$database->sitterLogin($_POST['user'],$_POST['pw'])) {
$form->addError("pw",LOGIN_PW_ERROR);
}
if($database->getUserField($_POST['user'],"act",1) != "") {
$form->addError("activate",$_POST['user']);
}
if($form->returnErrors() > 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: login.php");
}
else {
$userid = $database->getUserArray($_POST['user'], 0);
if($database->login($_POST['user'],$_POST['pw'])){
$database->UpdateOnline("login" ,$_POST['user'],time(),$userid['id']);
}else if($database->sitterLogin($_POST['user'],$_POST['pw'])){
$database->UpdateOnline("sitter" ,$_POST['user'],time(),$userid['id']);
}
setcookie("COOKUSR",$_POST['user'],time()+COOKIE_EXPIRE,COOKIE_PATH);
$session->login($_POST['user']);
}
}
private function Logout() {
global $session,$database;
unset($_SESSION['wid']);
$database->activeModify(addslashes($session->username),1);
$database->UpdateOnline("logout") or die(mysql_error());
$session->Logout();
}
private function validEmail($email) {
$regexp="/^[a-z0-9]+([_\\.-][a-z0-9]+)*@([a-z0-9]+([\.-][a-z0-9]+)*)+\\.[a-z]{2,}$/i";
if ( !preg_match($regexp, $email) ) {
return false;
}
return true;
}
function generateBase($kid,$uid,$username) {
global $database,$message;
if($kid == 0) {
$kid = rand(1,4);
}
else{
$kid = $_POST['kid'];
}
$wid = $database->generateBase($kid);
$database->setFieldTaken($wid);
$database->addVillage($wid,$uid,$username,1);
$database->addResourceFields($wid,$database->getVillageType($wid));
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
$database->updateUserField($uid,"access",USER,1);
$message->sendWelcome($uid,$username);
}
};
$account = new Account;
?>
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
+4
View File
@@ -0,0 +1,4 @@
<Files ~ "\.tpl$">
Order allow,deny
Deny from all
</Files>
+104
View File
@@ -0,0 +1,104 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename addTroops.php ##
## Developed by: Dzoki & Advocatie ##
## License: TravianX Project ##
## Thanks to: Dzoki & itay2277 (edit troops) ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
include_once("../../Account.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$id = $_POST['id'];
$village = $database->getVillage($id);
$user = $database->getUserArray($village['owner'],1);
$coor = $database->getCoor($village['wref']);
$varray = $database->getProfileVillages($village['owner']);
$type = $database->getVillageType($village['wref']);
$fdata = $database->getResourceLevel($village['wref']);
$units = $database->getUnit($village['wref']);
$u1 = $_POST['u1'];
$u2 = $_POST['u2'];
$u3 = $_POST['u3'];
$u4 = $_POST['u4'];
$u5 = $_POST['u5'];
$u6 = $_POST['u6'];
$u7 = $_POST['u7'];
$u8 = $_POST['u8'];
$u9 = $_POST['u9'];
$u10 = $_POST['u10'];
////////////////////
$u11 = $_POST['u11'];
$u12 = $_POST['u12'];
$u13 = $_POST['u13'];
$u14 = $_POST['u14'];
$u15 = $_POST['u15'];
$u16 = $_POST['u16'];
$u17 = $_POST['u17'];
$u18 = $_POST['u18'];
$u19 = $_POST['u19'];
$u20 = $_POST['u20'];
////////////////////
$u21 = $_POST['u21'];
$u22 = $_POST['u22'];
$u23 = $_POST['u23'];
$u24 = $_POST['u24'];
$u25 = $_POST['u25'];
$u26 = $_POST['u26'];
$u27 = $_POST['u27'];
$u28 = $_POST['u28'];
$u29 = $_POST['u29'];
$u30 = $_POST['u30'];
////////////////////
$u31 = $_POST['u31'];
$u32 = $_POST['u32'];
$u33 = $_POST['u33'];
$u34 = $_POST['u34'];
$u35 = $_POST['u35'];
$u36 = $_POST['u36'];
$u37 = $_POST['u37'];
$u38 = $_POST['u38'];
$u39 = $_POST['u39'];
$u40 = $_POST['u40'];
////////////////////
$u41 = $_POST['u41'];
$u42 = $_POST['u42'];
$u43 = $_POST['u43'];
$u44 = $_POST['u44'];
$u45 = $_POST['u45'];
$u46 = $_POST['u46'];
$u47 = $_POST['u47'];
$u48 = $_POST['u48'];
$u49 = $_POST['u49'];
$u50 = $_POST['u50'];
if($user['tribe'] == 1){
$q = "UPDATE ".TB_PREFIX."units SET u1 = $u1, u2 = $u2, u3 = $u3, u4 = $u4, u5 = $u5, u6 = $u6, u7 = $u7, u8 = $u8, u9 = $u9, u10 = $u10 WHERE vref = $id";
mysql_query($q);
} else if($user['tribe'] == 2){
$q = "UPDATE ".TB_PREFIX."units SET u11 = '$u11', u12 = '$u12', u13 = '$u13', u14 = '$u14', u15 = '$u15', u16 = '$u16', u17 = '$u17', u18 = '$u18', u19 = '$u19', u20 = '$u20' WHERE vref = $id";
mysql_query($q);
} else if($user['tribe'] == 3){
$q = "UPDATE ".TB_PREFIX."units SET u21 = '$u21', u22 = '$u22', u23 = '$u23', u24 = '$u24', u25 = '$u25', u26 = '$u26', u27 = '$u27', u28 = '$u28', u29 = '$u29', u30 = '$u30' WHERE vref = $id";
mysql_query($q);
} else if($user['tribe'] == 4){
$q = "UPDATE ".TB_PREFIX."units SET u31 = '$u31', u32 = '$u32', u33 = '$u33', u34 = '$u34', u35 = '$u35', u36 = '$u36', u37 = '$u37', u38 = '$u38', u39 = '$u39', u40 = '$u40' WHERE vref = $id";
mysql_query($q);
} else if($user['tribe'] == 5){
$q = "UPDATE ".TB_PREFIX."units SET u41 = '$u41', u42 = '$u42', u43 = '$u43', u44 = '$u44', u45 = '$u45', u46 = '$u46', u47 = '$u47', u48 = '$u48', u49 = '$u49', u50 = '$u50' WHERE vref = $id";
mysql_query($q);
}
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Changed troop anmount in village <a href=\'admin.php?p=village&did=$id\'>$id</a> ',".time().")");
header("Location: ../../../Admin/admin.php?p=addTroops&did=".$id."&d");
?>
+29
View File
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename cp.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$id = $_POST['id'];
$admid = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$admid."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET cp = cp + ".$_POST['cp']." WHERE id = ".$id."");
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+30
View File
@@ -0,0 +1,30 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename delallymedal.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$delete = $_POST['medalid'];
$aid = $_POST['aid'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."allimedal set del = 1 WHERE id = ".$delete."");
header("Location: ../../../Admin/admin.php?p=alliance&aid=".$aid."");
?>
@@ -0,0 +1,30 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletemedalsbyuser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$allyid = $_POST['allyid'];
$aid = $_POST['aid'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."allimedal set del = 1 WHERE allyid = ".$aid."");
header("Location: ../../../Admin/admin.php?p=alliance&aid=".$aid."");
?>
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletemedalsbyweek.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$deleteweek = $_POST['deleteweek'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."allimedal set del = 1 WHERE week = ".$deleteweek."");
header("Location: ../../../Admin/admin.php?p=delallymedal");
?>
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletemedalsbyuser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$userid = $_POST['userid'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."medal set del = 1 WHERE userid = ".$userid."");
header("Location: ../../../Admin/admin.php?p=player&uid=".$userid."");
?>
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletemedalsbyweek.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$deleteweek = $_POST['medalweek'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."medal set del = 1 WHERE week = ".$deleteweek."");
header("Location: ../../../Admin/admin.php?p=delmedal");
?>
+33
View File
@@ -0,0 +1,33 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['uid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$access = $_POST['access'];
mysql_query("UPDATE ".TB_PREFIX."users SET
access = ".$access."
WHERE id = ".$id."") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+110
View File
@@ -0,0 +1,110 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editBuildings.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."fdata SET
f1 = '".$_POST['id1level']."',
f1t = '".$_POST['id1gid']."',
f2 = '".$_POST['id2level']."',
f2t = '".$_POST['id2gid']."',
f3 = '".$_POST['id3level']."',
f3t = '".$_POST['id3gid']."',
f4 = '".$_POST['id4level']."',
f4t = '".$_POST['id4gid']."',
f5 = '".$_POST['id5level']."',
f5t = '".$_POST['id5gid']."',
f6 = '".$_POST['id6level']."',
f6t = '".$_POST['id6gid']."',
f7 = '".$_POST['id7level']."',
f7t = '".$_POST['id7gid']."',
f8 = '".$_POST['id8level']."',
f8t = '".$_POST['id8gid']."',
f9 = '".$_POST['id9level']."',
f9t = '".$_POST['id9gid']."',
f10 = '".$_POST['id10level']."',
f10t = '".$_POST['id10gid']."',
f11 = '".$_POST['id11level']."',
f11t = '".$_POST['id11gid']."',
f12 = '".$_POST['id12level']."',
f12t = '".$_POST['id12gid']."',
f13 = '".$_POST['id13level']."',
f13t = '".$_POST['id13gid']."',
f14 = '".$_POST['id14level']."',
f14t = '".$_POST['id14gid']."',
f15 = '".$_POST['id15level']."',
f15t = '".$_POST['id15gid']."',
f16 = '".$_POST['id16level']."',
f16t = '".$_POST['id16gid']."',
f17 = '".$_POST['id17level']."',
f17t = '".$_POST['id17gid']."',
f18 = '".$_POST['id18level']."',
f18t = '".$_POST['id18gid']."',
f19 = '".$_POST['id19level']."',
f19t = '".$_POST['id19gid']."',
f20 = '".$_POST['id20level']."',
f20t = '".$_POST['id20gid']."',
f21 = '".$_POST['id21level']."',
f21t = '".$_POST['id21gid']."',
f22 = '".$_POST['id22level']."',
f22t = '".$_POST['id22gid']."',
f23 = '".$_POST['id23level']."',
f23t = '".$_POST['id23gid']."',
f24 = '".$_POST['id24level']."',
f24t = '".$_POST['id24gid']."',
f25 = '".$_POST['id25level']."',
f25t = '".$_POST['id25gid']."',
f26 = '".$_POST['id26level']."',
f26t = '".$_POST['id26gid']."',
f27 = '".$_POST['id27level']."',
f27t = '".$_POST['id27gid']."',
f28 = '".$_POST['id28level']."',
f28t = '".$_POST['id28gid']."',
f29 = '".$_POST['id29level']."',
f29t = '".$_POST['id29gid']."',
f30 = '".$_POST['id30level']."',
f30t = '".$_POST['id30gid']."',
f31 = '".$_POST['id31level']."',
f31t = '".$_POST['id31gid']."',
f32 = '".$_POST['id32level']."',
f32t = '".$_POST['id32gid']."',
f33 = '".$_POST['id33level']."',
f33t = '".$_POST['id33gid']."',
f34 = '".$_POST['id34level']."',
f34t = '".$_POST['id34gid']."',
f35 = '".$_POST['id35level']."',
f35t = '".$_POST['id35gid']."',
f36 = '".$_POST['id36level']."',
f36t = '".$_POST['id36gid']."',
f37 = '".$_POST['id37level']."',
f37t = '".$_POST['id37gid']."',
f38 = '".$_POST['id38level']."',
f38t = '".$_POST['id38gid']."',
f39 = '".$_POST['id39level']."',
f39t = '".$_POST['id39gid']."',
f40 = '".$_POST['id40level']."',
f40t = '".$_POST['id40gid']."'
WHERE vref = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?action=recountPop&did=".$id."");
?>
+32
View File
@@ -0,0 +1,32 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET
apall = '".$_POST['off']."',
dpall = '".$_POST['def']."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+32
View File
@@ -0,0 +1,32 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['uid'];
$pass = md5($_POST['newpw']);
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET
password = '".$pass."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+70
View File
@@ -0,0 +1,70 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$pdur = $_POST['plus'] * 86400;
$b1dur = $_POST['wood'] * 86400;
$b2dur = $_POST['clay'] * 86400;
$b3dur = $_POST['iron'] * 86400;
$b4dur = $_POST['crop'] * 86400;
$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."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+34
View File
@@ -0,0 +1,34 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$dur = $_POST['protect'] * 86400;
$protection = (time() + $dur);
mysql_query("UPDATE ".TB_PREFIX."users SET
protect = '".$protection."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+36
View File
@@ -0,0 +1,36 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editResources.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['did'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."vdata SET
wood = '".$_POST['wood']."',
clay = '".$_POST['clay']."',
iron = '".$_POST['iron']."',
crop = '".$_POST['crop']."',
maxstore = '".$_POST['maxstore']."',
maxcrop = '".$_POST['maxcrop']."'
WHERE wref = '".$id."'") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=village&did=".$id."");
?>
+32
View File
@@ -0,0 +1,32 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET
sit1 = '".$_POST['sitter1']."',
sit2 = '".$_POST['sitter2']."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+36
View File
@@ -0,0 +1,36 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET
email = '".$_POST['email']."',
tribe = ".$_POST['tribe'].",
location = '".$_POST['location']."',
desc1 = '".$_POST['desc1']."',
desc2 = '".$_POST['desc2']."',
quest = '".$_POST['quest']."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+29
View File
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletemedalsbyuser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$uid = $_POST['uid'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET username = '".$_POST['username']."' WHERE id = ".$uid."");
header("Location: ../../../Admin/admin.php?p=player&uid=".$uid."");
?>
@@ -0,0 +1,31 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['did'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."vdata SET
owner = '".$_POST['newowner']."'
WHERE wref = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$_POST['newowner']."");
?>
+33
View File
@@ -0,0 +1,33 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET
ap = '".$_POST['off']."',
dp = '".$_POST['def']."',
RR = '".$_POST['res']."'
WHERE id = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+44
View File
@@ -0,0 +1,44 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$sql = "SELECT id FROM ".TB_PREFIX."users ORDER BY ID DESC LIMIT 1";
$loops = mysql_result(mysql_query($sql), 0);
$plusdur = $_POST['plus'] * 86400;
for($i = 0; $i < $loops + 1; $i++)
{
$query = "SELECT * FROM ".TB_PREFIX."users WHERE id = ".$i."";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
if($row['plus'] < time()) { $plusbefore = time(); $addplus = $plusbefore + $plusdur; } elseif($row['plus'] > time()) { $plusbefore = $row['plus']; $addplus = $plusbefore + $plusdur; }
mysql_query("UPDATE ".TB_PREFIX."users SET
plus = '".$addplus."'
WHERE id = '".$row['id']."'");
}
}
header("Location: ../../../Admin/admin.php?p=givePlus&g");
?>
+53
View File
@@ -0,0 +1,53 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$sql = "SELECT id FROM ".TB_PREFIX."users ORDER BY ID DESC LIMIT 1";
$loops = mysql_result(mysql_query($sql), 0);
$wood = $_POST['wood'] * 86400;
$clay = $_POST['clay'] * 86400;
$iron = $_POST['iron'] * 86400;
$crop = $_POST['crop'] * 86400;
for($i = 0; $i < $loops + 1; $i++)
{
$query = "SELECT * FROM ".TB_PREFIX."users WHERE id = ".$i."";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
if($row['b1'] < time()) { $b1before = time(); $addb1 = $b1before + $wood; } elseif($row['b1'] > time()) { $b1before = $row['b1']; $addb1 = $b1before + $wood; }
if($row['b2'] < time()) { $b2before = time(); $addb2 = $b1before + $clay; } elseif($row['b2'] > time()) { $b2before = $row['b2']; $addb2 = $b1before + $clay; }
if($row['b3'] < time()) { $b3before = time(); $addb3 = $b1before + $iron; } elseif($row['b3'] > time()) { $b3before = $row['b3']; $addb3 = $b1before + $iron; }
if($row['b4'] < time()) { $b4before = time(); $addb4 = $b1before + $crop; } elseif($row['b4'] > time()) { $b4before = $row['b4']; $addb4 = $b1before + $crop; }
mysql_query("UPDATE ".TB_PREFIX."users SET
b1 = '".$addb1."',
b2 = '".$addb2."',
b3 = '".$addb3."',
b4 = '".$addb4."'
WHERE id = '".$row['id']."'");
}
}
header("Location: ../../../Admin/admin.php?p=givePlusRes&g");
?>
+31
View File
@@ -0,0 +1,31 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename gold_1.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
error_reporting(E_ALL);
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$q = "UPDATE ".TB_PREFIX."users SET gold = gold + ".$_POST['gold']." WHERE id != '0'";
mysql_query($q) or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=maintenenceResetPlusBonus&g");
?>
+31
View File
@@ -0,0 +1,31 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename gold.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
error_reporting(E_ALL);
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$q = "UPDATE ".TB_PREFIX."users SET gold = gold + ".$_POST['gold']." WHERE id != '0'";
mysql_query($q) or die(mysql_error());
header("Location: ../../../Admin/admin.php?p=gold&g");
?>
+29
View File
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename gold_1.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET gold = gold + ".$_POST['gold']." WHERE id = ".$id."");
header("Location: ../../../Admin/admin.php?p=usergold&g");
?>
+51
View File
@@ -0,0 +1,51 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$users = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users"));
$duration = $_POST['duration'] * 3600;
$start = $_POST['start'];
$startts = strtotime($start);
$endts = $startts + $duration;
$reason = $_POST['reason'];
$admin = $session;
$active = '1';
$access = '2';
$sql = "SELECT id FROM ".TB_PREFIX."users ORDER BY ID DESC LIMIT 1";
$loops = mysql_result(mysql_query($sql), 0);
for($i = 0; $i < $loops + 1; $i++)
{
$query = "SELECT * FROM ".TB_PREFIX."users WHERE id = ".$i." AND access = ".$access."";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
##mysql_query("INSERT INTO ".TB_PREFIX."banlist ".$row['id'].", ".$row['username'].", ".$reason.", ".$startts.", ".$endts.", ".$admin.", ".$active."");
mysql_query("INSERT INTO ".TB_PREFIX."banlist (`uid`, `name`, `reason`, `time`, `end`, `admin`, `active`) VALUES (".$row['id'].", '".$row['username']."' , '$reason', '$startts', '$endts', '$admin', '1')");
}
}
header("Location: ../../../Admin/admin.php?p=ban");
?>
@@ -0,0 +1,28 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceCleanBanData.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("TRUNCATE ".TB_PREFIX."banlist");
header("Location: ../../../Admin/admin.php?p=ban");
?>
@@ -0,0 +1,28 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET gold = '0' WHERE id !=0");
header("Location: ../../../Admin/admin.php?p=maintenenceResetGold&g");
?>
@@ -0,0 +1,28 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET plus = '0' WHERE id !=0");
header("Location: ../../../Admin/admin.php?p=resetPlusBonus&g");
?>
@@ -0,0 +1,28 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceBan.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."users SET b1 = '0', b2 = '0', b3='0', b4='0' WHERE id !=0");
header("Location: ../../../Admin/admin.php?p=givePlus&g");
?>
+47
View File
@@ -0,0 +1,47 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename mainteneceUnban.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$users = mysql_num_rows(mysql_query("SELECT * FROM ".TB_PREFIX."users"));
$reason = $_POST['unbanreason'];
$admin = $session;
$active = '0';
$access = '2';
$actualend = time();
$sql = "SELECT id FROM ".TB_PREFIX."users ORDER BY ID DESC LIMIT 1";
$loops = mysql_result(mysql_query($sql), 0);
for($i = 0; $i < $loops + 1; $i++)
{
$query = "SELECT * FROM ".TB_PREFIX."users WHERE id = ".$i." AND access = ".$access."";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
mysql_query("UPDATE ".TB_PREFIX."banlist SET active = '".$active."', end = '".$actualend."' WHERE reason = '".$reason."'");
}
}
header("Location: ../../../Admin/admin.php?p=ban");
?>
+34
View File
@@ -0,0 +1,34 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename medals.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
#################################################################################
include_once("../../Account.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
if ($session->access < ADMIN) die("Access Denied: You are not Admin!");
$medalid = $_POST['medalid'];
$uid = $_POST['uid'];
mysql_query("UPDATE ".TB_PREFIX."medal set del = 1 WHERE id = ".$medalid."");
$name = mysql_query("SELECT name FROM ".TB_PREFIX."users WHERE id= ".$uid."");
$name = mysql_result($name, 0);
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$admid,'Deleted medal id [#".$medalid."] from the user <a href=\'admin.php?p=player&uid=$uid\'>$name</a> ',".time().")");
$deleteweek = $_POST['medalweek'];
mysql_query("UPDATE ".TB_PREFIX."medal set del = 1 WHERE week = ".$deleteweek."");
header("Location: ../../../Admin/admin.php?p=player&uid=".$uid."");
?>
@@ -0,0 +1,85 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename natarbuildingplan.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
include_once("../../Session.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$id = $_POST['id'];
$amt = $_POST['vill_amount'];
for($i=1;$i<=$amt;$i++) {
$kid = $_POST['kid'];
$wid = $database->generateBase($kid);
$database->setFieldTaken($wid);
$time = time();
$q = "insert into ".TB_PREFIX."vdata (`wref`,`owner`,`name`,`capital`,`pop`,`cp`,`celebration`,`type`,`wood`,`clay`,`iron`,`maxstore`,`crop`,`maxcrop`,`lastupdate`,`loyalty`,`exp1`,`exp2`,`exp3`,`created`) values ('$wid','3','WW Buildingplan',0,0,0,0,0,80000.00,80000.00,80000.00,80000,80000.00,80000,1314974534,100,0,0,0,1314968914)";
mysql_query($q) or die(mysql_error());
$q = "insert into ".TB_PREFIX."fdata (`vref`,`f1`,`f1t`,`f2`,`f2t`,`f3`,`f3t`,`f4`,`f4t`,`f5`,`f5t`,`f6`,`f6t`,`f7`,`f7t`,`f8`,`f8t`,`f9`,`f9t`,`f10`,`f10t`,`f11`,`f11t`,`f12`,`f12t`,`f13`,`f13t`,`f14`,`f14t`,`f15`,`f15t`,`f16`,`f16t`,`f17`,`f17t`,`f18`,`f18t`,`f19`,`f19t`,`f20`,`f20t`,`f21`,`f21t`,`f22`,`f22t`,`f23`,`f23t`,`f24`,`f24t`,`f25`,`f25t`,`f26`,`f26t`,`f27`,`f27t`,`f28`,`f28t`,`f29`,`f29t`,`f30`,`f30t`,`f31`,`f31t`,`f32`,`f32t`,`f33`,`f33t`,`f34`,`f34t`,`f35`,`f35t`,`f36`,`f36t`,`f37`,`f37t`,`f38`,`f38t`,`f39`,`f39t`,`f40`,`f40t`,`f99`,`f99t`,`wwname`) values ($wid,0,1,0,4,0,1,0,3,0,2,0,2,0,3,0,4,0,4,0,3,0,3,0,4,0,4,0,1,0,4,0,2,0,1,0,2,20,17,20,11,10,27,20,10,10,22,10,25,0,0,20,15,10,19,0,0,0,0,0,0,10,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,0,0,0,0,'World Wonder')";
mysql_query($q);
$pop = $automation->recountPop($wid);
$cp = $automation->recountPop($wid);
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
$speed = NATARS_UNITS;
$q = "UPDATE ".TB_PREFIX."units SET u41 = u41 + " . (1500 * $speed) . ", u42 = u42 + " . (1500 * $speed) . ", u43 = u43 + " . (1500 * $speed) . ", u44 = u44 + " . (1500 * $speed) . ", u45 = u45 + " . (1500 * $speed) . ", u46 = u46 + " . (1500 * $speed) . ", u47 = u47 + " . (1500 * $speed) . ", u48 = u48 + " . (1500 * $speed) . " , u49 = u49 + " . (1500 * $speed) . ", u50 = u50 + " . (1500 * $speed) . " WHERE vref = '".$wid."'";
mysql_query($q);
$desc = 'With this ancient construction plan you will able to build World Wonder to level 50. to build further, your alliance must hold at least two plans.';
$database->addArtefact($wid, 3, 11, 1, 'Ancient Construction Plan', $desc, '', 'typeww.gif');
}
$myFile = "../../../Templates/text.tpl";
$fh = fopen($myFile, 'w') or die("<br/><br/><br/>Can't open file: templates/text.tpl");
$text = file_get_contents("../../../Templates/text_format.tpl");
$text = preg_replace("'%TEKST%'","World Wonder Construction Plans
Many moons ago the tribes of Travian were surprised by the unforeseen return of the Natars. This tribe from immemorial times surpassing all in wisdom, might and glory was about to trouble the free ones again. Thus they put all their efforts in preparing a last war against the Natars and vanquishing them forever. Many thought about the so-called 'Wonders of the World', a construction of many legends, as the only solution. It was told that it would render anyone invincible once completed. Ultimately making the constructors the rulers and conquerors of all known Travian.
However, it was also told that one would need construction plans to construct such a building. Due to this fact, the architects devised cunning plans about how to store these safely. After a while, one could see temple-like buildings in many a city and metropolis - the Treasure Chambers (Treasuries).
Sadly, no one - not even the wise and well versed - knew where to find these construction plans. The harder people tried to locate them, the more it seemed as if they where only legends.
Today, however, this last secret will be revealed. Deprivations and endeavors of the past will not have been in vain, as today scouts of several tribes have successfully obtained the whereabouts of the construction plans. Well guarded by the Natars, they lie hidden in several oases to be found all over Travian. Only the most valiant heroes will be able to secure such a plan and bring it home safely so that the construction can begin.
In the end, we will see whether the free tribes of Travian can once again outwit the Natars and vanquish them once and for all. Do not be so foolish as to assume that the Natars will leave without a fight, though!
To steal a set of Construction Plans from the Natars, the following things must happen:
- You must Attack the village (NOT Raid!)
- You must WIN the Attack
- You must DESTROY the Treasure Chamber (Treasury)
- Your Hero MUST be in that attack, as he is the only one who may carry the Construction Plans
- An empty level 10 Treasure Chamber (Treasury) MUST be in the village where that attack came from
NOTE: If the above criteria is not met during the attack, the next attack on that village which does meet the above criteria will take the Construction Plans.
To build a Treasure Chamber (Treasury), you will need a Main Building level 10 and the village MUST NOT be a Capital or contain a World Wonder.
To build a World Wonder, you must own the Construction Plans yourself (you = the World Wonder Village Owner) from level 0 to 50, and then from level 51 to 100 you will need an additional set of Construction Plans in your Alliance! Two sets of Construction Plans in the World Wonder Village Account will not work!" ,$text);
fwrite($fh, $text);
$query="SELECT * FROM ".TB_PREFIX."users ORDER BY id + 0 DESC";
$result=mysql_query($query) or die (mysql_error());
for ($i=0; $row=mysql_fetch_row($result); $i++) {
$updateattquery = mysql_query("UPDATE ".TB_PREFIX."users SET ok = '1' WHERE id = '".$row[0]."'")
or die(mysql_error());
}
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$id,'Added <b>$amt</b> WW Buildingplan Villages',".time().")");
header("Location: ../../../Admin/admin.php?p=natarbuildingplan&g");
?>
+45
View File
@@ -0,0 +1,45 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename natarend.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
include_once("../../Session.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$id = $_POST['id'];
$amt = $_POST['vill_amount'];
for($i=1;$i<=$amt;$i++) {
$kid = $_POST['kid'];
$wid = $database->generateBase($kid);
$database->setFieldTaken($wid);
$time = time();
$q = "insert into ".TB_PREFIX."vdata (`wref`,`owner`,`name`,`capital`,`pop`,`cp`,`celebration`,`type`,`wood`,`clay`,`iron`,`maxstore`,`crop`,`maxcrop`,`lastupdate`,`loyalty`,`exp1`,`exp2`,`exp3`,`created`,`natar`) values ('$wid','3','WW village',0,0,0,0,0,80000.00,80000.00,80000.00,80000,80000.00,80000,1314974534,100,0,0,0,$time,1)";
mysql_query($q) or die(mysql_error());
$q = "insert into ".TB_PREFIX."fdata (`vref`,`f1`,`f1t`,`f2`,`f2t`,`f3`,`f3t`,`f4`,`f4t`,`f5`,`f5t`,`f6`,`f6t`,`f7`,`f7t`,`f8`,`f8t`,`f9`,`f9t`,`f10`,`f10t`,`f11`,`f11t`,`f12`,`f12t`,`f13`,`f13t`,`f14`,`f14t`,`f15`,`f15t`,`f16`,`f16t`,`f17`,`f17t`,`f18`,`f18t`,`f19`,`f19t`,`f20`,`f20t`,`f21`,`f21t`,`f22`,`f22t`,`f23`,`f23t`,`f24`,`f24t`,`f25`,`f25t`,`f26`,`f26t`,`f27`,`f27t`,`f28`,`f28t`,`f29`,`f29t`,`f30`,`f30t`,`f31`,`f31t`,`f32`,`f32t`,`f33`,`f33t`,`f34`,`f34t`,`f35`,`f35t`,`f36`,`f36t`,`f37`,`f37t`,`f38`,`f38t`,`f39`,`f39t`,`f40`,`f40t`,`f99`,`f99t`,`wwname`) values ($wid,0,1,0,4,0,1,0,3,0,2,0,2,0,3,0,4,0,4,0,3,0,3,0,4,0,4,0,1,0,4,0,2,0,1,0,2,20,17,20,11,20,15,20,10,10,22,10,25,0,0,0,0,10,19,0,0,0,0,0,0,10,23,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,16,0,0,0,40,'World Wonder')";
mysql_query($q);
$pop = $automation->recountPop($wid);
$cp = $automation->recountPop($wid);
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
$q = "UPDATE ".TB_PREFIX."units SET u41 = u41 + " . (1500 * $speed) . ", u42 = u42 + " . (1500 * $speed) . ", u43 = u43 + " . (1500 * $speed) . ", u44 = u44 + " . (1500 * $speed) . ", u45 = u45 + " . (1500 * $speed) . ", u46 = u46 + " . (1500 * $speed) . ", u47 = u47 + " . (1500 * $speed) . ", u48 = u48 + " . (1500 * $speed) . " , u49 = u49 + " . (1500 * $speed) . ", u50 = u50 + " . (1500 * $speed) . " WHERE vref = '".$wid."'";
mysql_query($q);
}
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$id,'Added <b>$amt</b> WW Villages',".time().")");
header("Location: ../../../Admin/admin.php?p=natarend&g");
?>
+110
View File
@@ -0,0 +1,110 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editBuildings.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$id = $_POST['id'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
mysql_query("UPDATE ".TB_PREFIX."fdata SET
f1 = '".$_POST['id1level']."',
f1t = '".$_POST['id1gid']."',
f2 = '".$_POST['id2level']."',
f2t = '".$_POST['id2gid']."',
f3 = '".$_POST['id3level']."',
f3t = '".$_POST['id3gid']."',
f4 = '".$_POST['id4level']."',
f4t = '".$_POST['id4gid']."',
f5 = '".$_POST['id5level']."',
f5t = '".$_POST['id5gid']."',
f6 = '".$_POST['id6level']."',
f6t = '".$_POST['id6gid']."',
f7 = '".$_POST['id7level']."',
f7t = '".$_POST['id7gid']."',
f8 = '".$_POST['id8level']."',
f8t = '".$_POST['id8gid']."',
f9 = '".$_POST['id9level']."',
f9t = '".$_POST['id9gid']."',
f10 = '".$_POST['id10level']."',
f10t = '".$_POST['id10gid']."',
f11 = '".$_POST['id11level']."',
f11t = '".$_POST['id11gid']."',
f12 = '".$_POST['id12level']."',
f12t = '".$_POST['id12gid']."',
f13 = '".$_POST['id13level']."',
f13t = '".$_POST['id13gid']."',
f14 = '".$_POST['id14level']."',
f14t = '".$_POST['id14gid']."',
f15 = '".$_POST['id15level']."',
f15t = '".$_POST['id15gid']."',
f16 = '".$_POST['id16level']."',
f16t = '".$_POST['id16gid']."',
f17 = '".$_POST['id17level']."',
f17t = '".$_POST['id17gid']."',
f18 = '".$_POST['id18level']."',
f18t = '".$_POST['id18gid']."',
f19 = '".$_POST['id19level']."',
f19t = '".$_POST['id19gid']."',
f20 = '".$_POST['id20level']."',
f20t = '".$_POST['id20gid']."',
f21 = '".$_POST['id21level']."',
f21t = '".$_POST['id21gid']."',
f22 = '".$_POST['id22level']."',
f22t = '".$_POST['id22gid']."',
f23 = '".$_POST['id23level']."',
f23t = '".$_POST['id23gid']."',
f24 = '".$_POST['id24level']."',
f24t = '".$_POST['id24gid']."',
f25 = '".$_POST['id25level']."',
f25t = '".$_POST['id25gid']."',
f26 = '".$_POST['id26level']."',
f26t = '".$_POST['id26gid']."',
f27 = '".$_POST['id27level']."',
f27t = '".$_POST['id27gid']."',
f28 = '".$_POST['id28level']."',
f28t = '".$_POST['id28gid']."',
f29 = '".$_POST['id29level']."',
f29t = '".$_POST['id29gid']."',
f30 = '".$_POST['id30level']."',
f30t = '".$_POST['id30gid']."',
f31 = '".$_POST['id31level']."',
f31t = '".$_POST['id31gid']."',
f32 = '".$_POST['id32level']."',
f32t = '".$_POST['id32gid']."',
f33 = '".$_POST['id33level']."',
f33t = '".$_POST['id33gid']."',
f34 = '".$_POST['id34level']."',
f34t = '".$_POST['id34gid']."',
f35 = '".$_POST['id35level']."',
f35t = '".$_POST['id35gid']."',
f36 = '".$_POST['id36level']."',
f36t = '".$_POST['id36gid']."',
f37 = '".$_POST['id37level']."',
f37t = '".$_POST['id37gid']."',
f38 = '".$_POST['id38level']."',
f38t = '".$_POST['id38gid']."',
f39 = '".$_POST['id39level']."',
f39t = '".$_POST['id39gid']."',
f40 = '".$_POST['id40level']."',
f40t = '".$_POST['id40gid']."'
WHERE vref = $id") or die(mysql_error());
header("Location: ../../../Admin/admin.php?action=recountPop&did=".$id."");
?>
+31
View File
@@ -0,0 +1,31 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename renameVillage.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$did = $_POST['did'];
$name = $_POST['villagename'];
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$sql = "UPDATE ".TB_PREFIX."vdata SET name = '$name' WHERE wref = $did";
mysql_query($sql);
header("Location: ../../../Admin/admin.php?p=village&did=".$did."&name=".$name."");
?>
+31
View File
@@ -0,0 +1,31 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename sendMessage.php ##
## Developed by: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2012. All rights reserved. ##
## ##
#################################################################################
include_once("../../config.php");
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
$session = $_POST['admid'];
$sql = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE id = ".$session."");
$access = mysql_fetch_array($sql);
$sessionaccess = $access['access'];
if($sessionaccess != 9) die("<h1><font color=\"red\">Access Denied: You are not Admin!</font></h1>");
$query = "INSERT INTO ".TB_PREFIX."mdata (target, owner, topic, message, viewed, time) VALUES ('$uid', 1, '$topic', '$message', 0, '$time')";
mysql_query($query);
header("Location: ../../../Admin/admin.php?p=Newmessage&uid=".$uid."&msg=ok");
?>
+108
View File
@@ -0,0 +1,108 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename admin.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
session_start();
include("../GameEngine/Database.php");
include("../GameEngine/Admin/database.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link REL="shortcut icon" HREF="favicon.ico"/>
<title>Admin Control Panel - TravianX</title>
<link rel=stylesheet type="text/css" href="../img/admin/admin.css">
<link rel=stylesheet type="text/css" href="../img/admin/acp.css">
<link rel=stylesheet type="text/css" href="../img/../img.css">
<script src="mt-full.js?423cb" type="text/javascript"></script>
<script src="ajax.js" type="text/javascript"></script>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta http-equiv="imagetoolbar" content="no">
</head>
<body>
<script language="javascript">
function aktiv() {this.srcElement.className='fl1'; }
function inaktiv() {event.srcElement.className='fl2'; }
function del(e,id){
if(e == 'did'){ var conf = confirm('Dou you really want delete village id '+id+'?'); }
if(e == 'unban'){ var conf = confirm('Dou you really want unban player '+id+'?'); }
if(e == 'stopDel'){ var conf = confirm('Dou you really want stop deleting user '+id+'?'); }
if(conf){return true;}else{return false;}
}
</script>
<div id="ltop1">
<div style="position:relative; width:231px; height:100px; float:left;">
<img src="../img/x.gif" width="1" height="1">
</div>
<img class="fl2" src="../img/admin/x1.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="../img/admin/x2.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="../img/admin/x3.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="../img/admin/x4.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="../img/admin/x5.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"></div>
<div id="lmidall">
<div id="lmidlc">
<div id="lleft">
<a href="index.php"><img src="../img/en/a/travian0.gif" class="logo_plus" width="116" height="60" border="0"></a>
<table id="navi_table" cellspacing="0" cellpadding="0">
<tr>
<td class="menu">
<?php
if($funct->CheckLogin()){?>
<a href="admin.php">ACP Home</a>
<a href="<?php echo HOMEPAGE; ?>">Homepage</a>
<a href="#"></a><a href="#"></a>
<a href="?p=server_info">Server Info</a>
<a href="?p=online">Online users</a>
<a href="?p=search">Search</a>
<a href="?p=message">Msg/Rep</a>
<a href="?p=ban">Ban</a>
<a href="?p=config">Config</a>
<a href="?p=config_editor">Config Editor</a>
<a href="#"></a><a href="#"></a><a href="#"></a>
<a href="?action=logout">Logout</a>
<?php }?>
</td>
</tr>
</table></div>
<div id="lmid1">
<div id="lmid3">
<?php
if($funct->CheckLogin()){
if($_POST or $_GET){
if($_GET['p'] and $_GET['p']!="search"){
$filename = '../Templates/Admin/'.$_GET['p'].'.tpl';
if(file_exists($filename)){
include($filename);
}else{
include('../Templates/Admin/404.tpl');
}
}else{
include('../Templates/Admin/search.tpl');
}
if($_POST['p'] and $_POST['s']){
$filename = '../Templates/Admin/results_'.$_POST['p'].'.tpl';
if(file_exists($filename)){
include($filename);
}else{
include('../Templates/Admin/404.tpl');
}
}
}else{
include('../Templates/Admin/home.tpl');
}
}else{
+70
View File
@@ -0,0 +1,70 @@
var http_request = false;
function macheRequest(url, id)
{
http_request = false;
if (window.XMLHttpRequest)
{ // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType)
{
http_request.overrideMimeType('text/xml');
// zu dieser Zeile siehe weiter unten
}
}
else if (window.ActiveXObject)
{ // IE
try
{
http_request = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e)
{
try
{
http_request = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e)
{
}
}
}
if (!http_request)
{
alert('Ende :( Kann keine XMLHTTP-Instanz erzeugen');
return false;
}
http_request.onreadystatechange = function()
{
alertInhalt2(id);
};
http_request.open('GET', url, true);
http_request.send(null);
}
function alertInhalt2(id)
{
if (http_request.readyState == 4)
{
if (http_request.status == 200)
{
// alert(http_request.responseText);
myElement = document.getElementById(id);
if (myElement != null)
{
myElement.innerHTML = http_request.responseText;
}
}
else
{
alert('Bei dem Request ist ein Problem aufgetreten.');
}
}
}
+348
View File
@@ -0,0 +1,348 @@
<?php
#################################################################################
## ##
## -= YOU MUST NOT REMOVE OR CHANGE THIS NOTICE =- ##
## ##
## --------------------------------------------------------------------------- ##
## ##
## Project: ZravianX ##
## Version: 2011.11.07 ##
## Filename: GameEngine/Admin/database.php ##
## Developed by: Dzoki ##
## Edited by: ZZJHONS ##
## License: Creative Commons BY-NC-SA 3.0 ##
## Copyright: ZravianX (c) 2011 - All rights reserved ##
## URLs: http://zravianx.zzjhons.com ##
## Source code: http://www.github.com/ZZJHONS/ZravianX ##
## ##
#################################################################################
if($gameinstall == 1){
include("../../GameEngine/config.php");
include("../../GameEngine/Data/buidata.php");
}else{
include("../GameEngine/config.php");
include("../GameEngine/Data/buidata.php");
}
class adm_DB {
var $connection;
function adm_DB(){
global $database;
$this->connection = mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS) or die(mysql_error());
mysql_select_db(SQL_DB, $this->connection) or die(mysql_error());
}
function Login($username,$password){
$q = "SELECT password FROM ".TB_PREFIX."users where username = '$username' and access >= ".MULTIHUNTER;
$result = mysql_query($q, $this->connection);
$dbarray = mysql_fetch_array($result);
if($dbarray['password'] == md5($password)) {
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,'X','$username logged in (IP: <b>".$_SERVER['REMOTE_ADDR']."</b>)',".time().")");
return true;
}
else {
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,'X','<font color=\'red\'><b>IP: ".$_SERVER['REMOTE_ADDR']." tried to log in with username <u> $username</u> but access was denied!</font></b>',".time().")");
return false;
}
}
function recountPopUser($uid){
global $database;
$villages = $database->getProfileVillages($uid);
for ($i = 0; $i <= count($villages)-1; $i++) {
$vid = $villages[$i]['wref'];
$this->recountPop($vid);
$this->recountCP($vid);
}
}
function recountPop($vid){
global $database;
$fdata = $database->getResourceLevel($vid);
$popTot = 0;
for ($i = 1; $i <= 40; $i++) {
$lvl = $fdata["f".$i];
$building = $fdata["f".$i."t"];
if($building){
$popTot += $this->buildingPOP($building,$lvl);
}
}
$q = "UPDATE ".TB_PREFIX."vdata set pop = $popTot where wref = $vid";
mysql_query($q, $this->connection);
}
function recountCP($vid){
global $database;
$fdata = $database->getResourceLevel($vid);
$popTot = 0;
for ($i = 1; $i <= 40; $i++) {
$lvl = $fdata["f".$i];
$building = $fdata["f".$i."t"];
if($building){
$popTot += $this->buildingCP($building,$lvl);
}
}
$q = "UPDATE ".TB_PREFIX."vdata set cp = $popTot where wref = $vid";
mysql_query($q, $this->connection);
}
function buildingPOP($f,$lvl){
$name = "bid".$f;
global $$name;
$popT = 0;
$dataarray = $$name;
for ($i = 0; $i <= $lvl; $i++) {
$popT += $dataarray[$i]['pop'];
}
return $popT;
}
function buildingCP($f,$lvl){
$name = "bid".$f;
global $$name;
$popT = 0;
$dataarray = $$name;
for ($i = 0; $i <= $lvl; $i++) {
$popT += $dataarray[$i]['cp'];
}
return $popT;
}
function getWref($x,$y) {
$q = "SELECT id FROM ".TB_PREFIX."wdata where x = $x and y = $y";
$result = mysql_query($q, $this->connection);
$r = mysql_fetch_array($result);
return $r['id'];
}
function AddVillage($post){
global $database;
$wid = $this->getWref($post['x'],$post['y']);
$uid = $post['uid'];
$status = $database->getVillageState($wid);
$status = 0;
if($status == 0){
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Added new village <b><a href=\'admin.php?p=village&did=$wid\'>$wid</a></b> to user <b><a href=\'admin.php?p=player&uid=$uid\'>$uid</a></b>',".time().")");
$database->setFieldTaken($wid);
$database->addVillage($wid,$uid,'new village','0');
$database->addResourceFields($wid,$database->getVillageType($wid));
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
}
}
function Punish($post){
global $database;
$villages = $database->getProfileVillages($post['uid']);
$admid = $post['admid'];
$user = $database->getUserArray($post['uid'],1);
for ($i = 0; $i <= count($villages)-1; $i++) {
$vid = $villages[$i]['wref'];
if($post['punish']){
$popOld = $villages[$i]['pop'];
$proc = 100-$post['punish'];
$pop = floor(($popOld/100)*($proc));
if($pop <= 1 ){$pop = 2;}
$this->PunishBuilding($vid,$proc,$pop);
}
if($post['del_troop']){
if($user['tribe'] == 1) {
$unit = 1;
}else if($user['tribe'] == 2) {
$unit = 11;
}else if($user['tribe'] == 3) {
$unit = 21;
}
$this->DelUnits($villages[$i]['wref'],$unit);
}
if($post['clean_ware']){
$time = time();
$q = "UPDATE ".TB_PREFIX."vdata SET `wood` = '0', `clay` = '0', `iron` = '0', `crop` = '0', `lastupdate` = '$time' WHERE wref = $vid;";
mysql_query($q, $this->connection);
}
}
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Punished user: <a href=\'admin.php?p=player&uid=".$post['uid']."\'>".$post['uid']."</a> with <b>-".$post['punish']."%</b> population',".time().")");
}
function PunishBuilding($vid,$proc,$pop){
global $database;
$q = "UPDATE ".TB_PREFIX."vdata set pop = $pop where wref = $vid;";
mysql_query($q, $this->connection);
$fdata = $database->getResourceLevel($vid);
for ($i = 1; $i <= 40; $i++) {
if($fdata['f'.$i]>1){
$zm = ($fdata['f'.$i]/100)*$proc;
if($zm < 1){$zm = 1;}else{$zm = floor($zm);}
$q = "UPDATE ".TB_PREFIX."fdata SET `f$i` = '$zm' WHERE `vref` = $vid;";
mysql_query($q, $this->connection);
}
}
}
function DelUnits($vid,$unit){
for ($i = $unit; $i <= 9+$unit; $i++) {
$this->DelUnits2($vid,$unit);
}
}
function DelUnits2($vid,$unit){
$q = "UPDATE ".TB_PREFIX."units SET `u$unit` = '0' WHERE `vref` = $vid;";
mysql_query($q, $this->connection);
}
function DelPlayer($uid,$pass){
global $database;
$ID = $_SESSION['id'];//$database->getUserField($_SESSION['username'],'id',1);
if($this->CheckPass($pass,$ID)){
$villages = $database->getProfileVillages($uid);
for ($i = 0; $i <= count($villages)-1; $i++) {
$this->DelVillage($villages[$i]['wref']);
}
$name = $database->getUserField($uid,"username",0);
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$ID,'Deleted user <a>$name</a>',".time().")");
$q = "DELETE FROM ".TB_PREFIX."users WHERE `id` = $uid;";
mysql_query($q, $this->connection);
}
}
function getUserActive() {
$time = time() - (60*5);
$q = "SELECT * FROM ".TB_PREFIX."users where timestamp > $time and username != 'support'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function CheckPass($password,$uid){
$q = "SELECT password FROM ".TB_PREFIX."users where id = '$uid' and access = ".ADMIN;
$result = mysql_query($q, $this->connection);
$dbarray = mysql_fetch_array($result);
if($dbarray['password'] == md5($password)) {
return true;
}else{
return false;
}
}
function DelVillage($wref){
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `wref` = $wref and capital = 0";
$result = mysql_query($q, $this->connection);
if(mysql_num_rows($result) > 0){
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Deleted village <b>$wref</b>',".time().")");
$q = "DELETE FROM ".TB_PREFIX."vdata WHERE `wref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."units WHERE `vref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."bdata WHERE `wid` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."abdata WHERE `wid` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."fdata WHERE `vref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."training WHERE `vref` = $wref";
mysql_query($q, $this->connection);
$q = "DELETE FROM ".TB_PREFIX."movement WHERE `from` = $wref";
mysql_query($q, $this->connection);
$q = "UPDATE ".TB_PREFIX."wdata SET `occupied` = '0' WHERE `id` = $wref";
mysql_query($q, $this->connection);
}
}
function DelBan($uid,$id){
global $database;
$name = addslashes($database->getUserField($uid,"username",0));
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Unbanned user <a href=\'admin.php?p=player&uid=$uid\'>$name</a>',".time().")");
$q = "UPDATE ".TB_PREFIX."users SET `access` = '".USER."' WHERE `id` = $uid;";
mysql_query($q, $this->connection);
$q = "UPDATE ".TB_PREFIX."banlist SET `active` = '0' WHERE `id` = $id;";
mysql_query($q, $this->connection);
}
function AddBan($uid,$end,$reason){
global $database;
$name = addslashes($database->getUserField($uid,"username",0));
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Banned user <a href=\'admin.php?p=player&uid=$uid\'>$name</a>',".time().")");
$q = "UPDATE ".TB_PREFIX."users SET `access` = '0' WHERE `id` = $uid;";
mysql_query($q, $this->connection);
$time = time();
$admin = $_SESSION['id']; //$database->getUserField($_SESSION['username'],'id',1);
$name = addslashes($database->getUserField($uid,'username',0));
$q = "INSERT INTO ".TB_PREFIX."banlist (`uid`, `name`, `reason`, `time`, `end`, `admin`, `active`) VALUES ($uid, '$name' , '$reason', '$time', '$end', '$admin', '1');";
mysql_query($q, $this->connection);
}
function search_player($player){
$q = "SELECT id,username FROM ".TB_PREFIX."users WHERE `username` LIKE '%$player%' and username != 'support'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function search_email($email){
$q = "SELECT id,email FROM ".TB_PREFIX."users WHERE `email` LIKE '%$email%' and username != 'support'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function search_village($village){
$q = "SELECT * FROM ".TB_PREFIX."vdata WHERE `name` LIKE '%$village%' or `wref` LIKE '%$village%'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function search_alliance($alliance){
$q = "SELECT * FROM ".TB_PREFIX."alidata WHERE `name` LIKE '%$alliance%' or `tag` LIKE '%$alliance%' or `id` LIKE '%$alliance%'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function search_ip($ip){
$q = "SELECT * FROM ".TB_PREFIX."login_log WHERE `ip` LIKE '%$ip%'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function search_banned(){
$q = "SELECT * FROM ".TB_PREFIX."banlist where active = '1'";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
function Del_banned(){
//$q = "SELECT * FROM ".TB_PREFIX."banlist";
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
/***************************
Function to process MYSQLi->fetch_all (Only exist in MYSQL)
References: Result
***************************/
function mysql_fetch_all($result) {
$all = array();
if($result) {
while ($row = mysql_fetch_assoc($result)){ $all[] = $row; }
return $all;
}
}
function query_return($q) {
$result = mysql_query($q, $this->connection);
return $this->mysql_fetch_all($result);
}
/***************************
Function to do free query
References: Query
***************************/
function query($query) {
return mysql_query($query, $this->connection);
}
};
$admin = new adm_DB;
include("function.php");
?>
+168
View File
@@ -0,0 +1,168 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename function.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class funct {
function CheckLogin(){
if($_SESSION['access'] >= MULTIHUNTER and $_SESSION['id']){
return true;
}else{
return false;
}
}
function Act($get){
global $admin,$database;
switch($get['action']){
case recountPop:
$admin->recountPop($get['did']);
$admin->recountCP($get['did']);
break;
case recountPopUsr:
$admin->recountPopUser($get['uid']);
break;
case StopDel:
//stop deleting
break;
case delVil:
$admin->DelVillage($get['did']);
break;
case delBan:
$admin->DelBan($get['uid'],$get['id']);
//remove ban
break;
case addBan:
if($get['time']){$end = time()+$get['time']; }else{$end = '';}
if(is_numeric($get['uid'])){
$get['uid'] = $get['uid'];
}else{
$get['uid'] = $database->getUserField(addslashes($get['uid']),'id',1);
}
$admin->AddBan($get['uid'],$end,$get['reason']);
//add ban
break;
case delOas:
//oaza
break;
case logout:
$this->LogOut();
break;
}
if($get['action'] == 'logout'){
header("Location: admin.php");
}else{
header("Location: ".$_SERVER['HTTP_REFERER']);
}
}
function Act2($post){
global $admin,$database;
switch($post['action']){
case DelPlayer:
$admin->DelPlayer($post['uid'],$post['pass']);
header("Location: ?p=search&msg=ursdel");
break;
case punish:
$admin->Punish($post);
header("Location: ".$_SERVER['HTTP_REFERER']);
break;
case addVillage:
$admin->AddVillage($post);
header("Location: ".$_SERVER['HTTP_REFERER']);
break;
}
}
function LogIN($username,$password){
global $admin,$database;
if($admin->Login($username,$password)){
//$_SESSION['username'] = $username;
$_SESSION['access'] = $database->getUserField($username,'access',1);
$_SESSION['id'] = $database->getUserField($username,'id',1);
header("Location: ".$_SERVER['HTTP_REFERER']);
//header("Location: admin.php");
}else{
echo "Error";
}
}
function LogOut(){
$_SESSION['access'] = '';
$_SESSION['id'] = '';
}
public function procResType($ref) {
global $session;
switch($ref) {
case 1: $build = "Woodcutter"; break;
case 2: $build = "Clay Pit"; break;
case 3: $build = "Iron Mine"; break;
case 4: $build = "Cropland"; break;
case 5: $build = "Sawmill"; break;
case 6: $build = "Brickyard"; break;
case 7: $build = "Iron Foundry"; break;
case 8: $build = "Grain Mill"; break;
case 9: $build = "Bakery"; break;
case 10: $build = "Warehouse"; break;
case 11: $build = "Granary"; break;
case 12: $build = "Blacksmith"; break;
case 13: $build = "Armoury"; break;
case 14: $build = "Tournament Square"; break;
case 15: $build = "Main Building"; break;
case 16: $build = "Rally Point"; break;
case 17: $build = "Marketplace"; break;
case 18: $build = "Embassy"; break;
case 19: $build = "Barracks"; break;
case 20: $build = "Stable"; break;
case 21: $build = "Workshop"; break;
case 22: $build = "Academy"; break;
case 23: $build = "Cranny"; break;
case 24: $build = "Town Hall"; break;
case 25: $build = "Residence"; break;
case 26: $build = "Palace"; break;
case 27: $build = "Treasury"; break;
case 28: $build = "Trade Office"; break;
case 29: $build = "Great Barracks"; break;
case 30: $build = "Great Stable"; break;
case 31: $build = "City Wall"; break;
case 32: $build = "Earth Wall"; break;
case 33: $build = "Palisade"; break;
case 34: $build = "Stonemason's Lodge"; break;
case 35: $build = "Brewery"; break;
case 36: $build = "Trapper"; break;
case 37: $build = "Hero's Mansion"; break;
case 38: $build = "Great Warehouse"; break;
case 39: $build = "Great Granary"; break;
case 40: $build = "Wonder of the World"; break;
case 41: $build = "Horse Drinking Trough"; break;
default: $build = "Error"; break;
}
return $build;
}
};
$funct = new funct;
if($funct->CheckLogin()){
if($_GET['action']){
$funct->Act($_GET);
}
if($_POST['action']){
$funct->Act2($_POST);
}
}
if($_POST['action']=='login'){
$funct->LogIN($_POST['name'],$_POST['pw']);
}
?>
+6
View File
@@ -0,0 +1,6 @@
Hello %USER%,
Thank you for registering on our server.
Since the %START% at %TIME% Romans, Gauls and Teutons attack each other on this game world. Right now, %PLAYERS% players in %ALLI% Alliances are fighting for supremacy.
Regards, %SERVER_NAME%
+464
View File
@@ -0,0 +1,464 @@
<?php
/*
|--------------------------------------------------------------------------
| PLEASE DO NOT REMOVE THIS COPYRIGHT NOTICE!
|--------------------------------------------------------------------------
|
| Project owner: Dzoki < dzoki.travian@gmail.com >
|
| This script is property of TravianX Project. You are allowed to change
| its source and release it under own name, not under name `TravianX`.
| You have no rights to remove copyright notices.
|
| TravianX All rights reserved
|
*/
class Alliance {
public $gotInvite = false;
public $inviteArray = array();
public $allianceArray = array();
public $userPermArray = array();
public function procAlliance($get) {
global $session, $database;
if($session->alliance != 0) {
$this->allianceArray = $database->getAlliance($session->alliance);
// Permissions Array
// [id] => id [uid] => uid [alliance] => alliance [opt1] => X [opt2] => X [opt3] => X [opt4] => X [opt5] => X [opt6] => X [opt7] => X [opt8] => X
$this->userPermArray = $database->getAlliPermissions($session->uid, $session->alliance);
} else {
$this->inviteArray = $database->getInvitation($session->uid);
$this->gotInvite = count($this->inviteArray) == 0 ? false : true;
}
if(isset($get['a'])) {
switch($get['a']) {
case 2:
$this->rejectInvite($get);
break;
case 3:
$this->acceptInvite($get);
break;
default:
break;
}
}
if(isset($get['o'])) {
switch($get['o']) {
case 4:
$this->delInvite($get);
break;
default:
break;
}
}
}
public function procAlliForm($post) {
if(isset($post['ft'])) {
switch($post['ft']) {
case "ali1":
$this->createAlliance($post);
break;
}
}
if(isset($_POST['dipl']) and isset($_POST['a_name'])) {
$this->changediplomacy($post);
}
if(isset($post['s'])) {
if(isset($post['o'])) {
switch($post['o']) {
case 1:
if(isset($_POST['a'])) {
$this->changeUserPermissions($post);
}
break;
case 2:
if(isset($_POST['a_user'])) {
$this->kickAlliUser($post);
}
break;
case 4:
if(isset($_POST['a']) && $_POST['a'] == 4) {
$this->sendInvite($post);
}
break;
case 3:
$this->updateAlliProfile($post);
break;
case 11:
$this->quitally($post);
break;
case 100:
$this->changeAliName($post);
break;
}
}
}
}
/*****************************************
Function to process of sending invitations
*****************************************/
public function sendInvite($post) {
global $form, $database, $session;
if($session->access != BANNED){
$UserData = $database->getUserArray(stripslashes($post['a_name']), 0);
if($this->userPermArray['opt4'] == 0) {
$form->addError("perm", NO_PERMISSION);
}elseif(!isset($post['a_name']) || $post['a_name'] == "") {
$form->addError("name1", NAME_EMPTY);
}elseif(!$database->checkExist(stripslashes($post['a_name']), 0)) {
$form->addError("name2", NAME_NO_EXIST."".stripslashes(stripslashes($post['a_name'])));
}elseif($UserData['id'] == $session->uid) {
$form->addError("name3", SAME_NAME);
}elseif($database->getInvitation2($UserData['id'],$session->alliance)) {
$form->addError("name4", $post['a_name'].ALREADY_INVITED);
}elseif($UserData['alliance'] == $session->alliance) {
$form->addError("name5", $post['a_name'].ALREADY_IN_ALLY);
}else{
// Obtenemos la informacion necesaria
$aid = $session->alliance;
// 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'] . '">' . addslashes($UserData['username']) . '</a> into the alliance.');
}
}else{
header("Location: banned.php");
}
}
/*****************************************
Function to reject an invitation
*****************************************/
private function rejectInvite($get) {
global $database, $session;
if($session->access != BANNED){
foreach($this->inviteArray as $invite) {
if($invite['id'] == $get['d']) {
$database->removeInvitation($get['d']);
$database->insertAlliNotice($invite['alliance'], '<a href="spieler.php?uid=' . $session->uid . '">' . addslashes($session->username) . '</a> has rejected the invitation.');
}
}
header("Location: build.php?id=".$get['id']);
}else{
header("Location: banned.php");
}
}
/*****************************************
Function to del an invitation
*****************************************/
private function delInvite($get) {
global $database, $session;
if($session->access != BANNED){
$inviteArray = $database->getAliInvitations($session->alliance);
foreach($inviteArray as $invite) {
if($invite['id'] == $get['d']) {
$invitename = $database->getUserArray($invite['uid'], 1);
$database->removeInvitation($get['d']);
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . addslashes($session->username) . '</a> has deleted the invitation for <a href="spieler.php?uid=' . $invitename['id'] . '">' . addslashes($invitename['username']) . '</a>.');
}
}
header("Location: allianz.php?delinvite");
}else{
header("Location: banned.php");
}
}
/*****************************************
Function to accept an invitation
*****************************************/
private function acceptInvite($get) {
global $form, $database, $session;
if($session->access != BANNED){
foreach($this->inviteArray as $invite) {
if($session->alliance == 0){
if($invite['id'] == $get['d'] && $invite['uid'] == $session->uid) {
$memberlist = $database->getAllMember($invite['alliance']);
$alliance_info = $database->getAlliance($invite['alliance']);
if(count($memberlist) < $alliance_info['max']){
$database->removeInvitation($database->RemoveXSS($get['d']));
$database->updateUserField($database->RemoveXSS($invite['uid']), "alliance", $database->RemoveXSS($invite['alliance']), 1);
$database->createAlliPermissions($database->RemoveXSS($invite['uid']), $database->RemoveXSS($invite['alliance']), '', '0', '0', '0', '0', '0', '0', '0', '0');
// Log the notice
$database->insertAlliNotice($invite['alliance'], '<a href="spieler.php?uid=' . $session->uid . '">' . addslashes($session->username) . '</a> has joined the alliance.');
}else{
$accept_error = 1;
$max = $alliance_info['max'];
}
}
}
}
if($accept_error == 1){
$form->addError("ally_accept", "The alliance can contain only ".$max." peoples right now.");
}else{
header("Location: build.php?id=" . $get['id']);
}
}else{
header("Location: banned.php");
}
}
/*****************************************
Function to create an alliance
*****************************************/
private function createAlliance($post) {
global $form, $database, $session, $bid18, $village;
if($session->access != BANNED){
if(!isset($post['ally1']) || $post['ally1'] == "") {
$form->addError("ally1", ATAG_EMPTY);
}
if(!isset($post['ally2']) || $post['ally2'] == "") {
$form->addError("ally2", ANAME_EMPTY);
}
if($database->aExist($post['ally1'], "tag")) {
$form->addError("ally1", ATAG_EXIST);
}
if($database->aExist($post['ally2'], "name")) {
$form->addError("ally2", ANAME_EXIST);
}
if($form->returnErrors() != 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $post;
header("Location: build.php?id=" . $post['id']);
} else {
$max = $bid18[$village->resarray['f' . $post['id']]]['attri'];
$aid = $database->createAlliance($database->RemoveXSS($post['ally1']), $database->RemoveXSS($post['ally2']), $session->uid, $max);
$database->updateUserField($database->RemoveXSS($session->uid), "alliance", $database->RemoveXSS($aid), 1);
$database->procAllyPop($aid);
// Asign Permissions
$database->createAlliPermissions($database->RemoveXSS($session->uid), $database->RemoveXSS($aid), 'Alliance founder', '1', '1', '1', '1', '1', '1', '1', '1');
// log the notice
$database->insertAlliNotice($aid, 'The alliance has been founded by <a href="spieler.php?uid=' . $session->uid . '">' . addslashes($session->username) . '</a>.');
header("Location: build.php?id=" . $post['id']);
}
}else{
header("Location: banned.php");
}
}
/*****************************************
Function to change the alliance name
*****************************************/
private function changeAliName($get) {
global $form, $database, $session;
if($session->access != BANNED){
if(!isset($get['ally1']) || $get['ally1'] == "") {
$form->addError("ally1", ATAG_EMPTY);
}
if(!isset($get['ally2']) || $get['ally2'] == "") {
$form->addError("ally2", ANAME_EMPTY);
}
if($database->aExist($get['ally1'], "tag")) {
$form->addError("tag", ATAG_EXIST);
}
if($database->aExist($get['ally2'], "name")) {
$form->addError("name", ANAME_EXIST);
}
if($this->userPermArray['opt3'] == 0) {
$form->addError("perm", NO_PERMISSION);
}
if($form->returnErrors() != 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $post;
//header("Location: build.php?id=".$post['id']);
} else {
$database->setAlliName($database->RemoveXSS($session->alliance), $database->RemoveXSS($get['ally2']), $database->RemoveXSS($get['ally1']));
// log the notice
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . addslashes($session->username) . '</a> has changed the alliance name.');
}
}else{
header("Location: banned.php");
}
}
/*****************************************
Function to create/change the alliance description
*****************************************/
private function updateAlliProfile($post) {
global $database, $session, $form;
if($session->access != BANNED){
if($this->userPermArray['opt3'] == 0) {
$form->addError("perm", NO_PERMISSION);
}
if($form->returnErrors() != 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $post;
//header("Location: build.php?id=".$post['id']);
} else {
$database->submitAlliProfile($database->RemoveXSS($session->alliance), $post['be2'], $post['be1']);
// log the notice
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . addslashes($session->username) . '</a> has changed the alliance description.');
}
}else{
header("Location: banned.php");
}
}
/*****************************************
Function to change the user permissions
*****************************************/
private function changeUserPermissions($post) {
global $database, $session, $form;
if($session->access != BANNED){
if($this->userPermArray['opt1'] == 0) {
$form->addError("perm", NO_PERMISSION);
}
if($form->returnErrors() != 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $post;
//header("Location: build.php?id=".$post['id']);
} else {
$database->updateAlliPermissions($post['a_user'], $session->alliance, $post['a_titel'], $post['e1'], $post['e2'], $post['e3'], $post['e4'], $post['e5'], $post['e6'], $post['e7']);
// log the notice
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . addslashes($session->username) . '</a> has changed permissions.');
}
}else{
header("Location: banned.php");
}
}
/*****************************************
Function to kick a user from alliance
*****************************************/
private function kickAlliUser($post) {
global $database, $session, $form;
if($session->access != BANNED){
$UserData = $database->getUserArray($post['a_user'], 0);
if($this->userPermArray['opt2'] == 0) {
$form->addError("perm", NO_PERMISSION);
} else if($UserData['id'] != $session->uid){
$database->updateUserField($post['a_user'], 'alliance', 0, 1);
$database->deleteAlliPermissions($post['a_user']);
$database->deleteAlliance($session->alliance);
// log the notice
$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");
}
}
/*****************************************
Function to set forum link
*****************************************/
public function setForumLink($post) {
global $database, $session;
if($session->access != BANNED){
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
*****************************************/
private function quitally($post) {
global $database, $session, $form;
if($session->access != BANNED){
if(!isset($post['pw']) || $post['pw'] == "") {
$form->addError("pw1", PW_EMPTY);
} elseif(md5($post['pw']) !== $session->userinfo['password']) {
$form->addError("pw2", PW_ERR);
} else {
$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->deleteAlliPermissions($session->uid);
// log the notice
$database->deleteAlliance($session->alliance);
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . addslashes($session->username) . '</a> has quit the alliance.');
header("Location: spieler.php?uid=".$session->uid);
}
}else{
header("Location: banned.php");
}
}
private function changediplomacy($post) {
global $database, $session, $form;
if($session->access != BANNED){
$aName = $database->RemoveXSS($_POST['a_name']);
$aType = (int)intval($_POST['dipl']);
if($database->aExist($aName, "tag")) {
if($database->getAllianceID($aName) != $session->alliance) {
if($aType >= 1 and $aType <= 3) {
if(!$database->diplomacyInviteCheck2($session->alliance, $database->getAllianceID($aName))) {
$database->diplomacyInviteAdd($session->alliance, $database->getAllianceID($aName), $aType);
if($aType == 1){
$notice = "offer a confederation to";
}else if($aType == 2){
$notice = "offer non-aggression pact to";
}else if($aType == 3){
$notice = "declare war on";
}
$database->insertAlliNotice($session->alliance, '<a href="allianz.php?aid=' . $session->alliance . '">' . $database->getAllianceName($session->alliance) . '</a> '. $notice .' <a href="allianz.php?aid=' . $database->getAllianceID($aName) . '">' . $aName . '</a>.');
$form->addError("name", "Invite sended");
} else {
$form->addError("name", "You have already sended them a invite");
}
} else {
$form->addError("name", "wrong choice made");
}
} else {
$form->addError("name", "You can not invite your own alliance");
}
} else {
$form->addError("name", "Alliance does not exist");
}
}else{
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;
?>
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
+799
View File
@@ -0,0 +1,799 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Buildng.php ##
## Developed by: Dzoki & Dixie ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class Building {
public $NewBuilding = false;
private $maxConcurrent;
private $allocated;
private $basic,$inner,$plus = 0;
public $buildArray = array();
public function Building() {
global $session;
$this->maxConcurrent = BASIC_MAX;
if(ALLOW_ALL_TRIBE || $session->tribe == 1) {
$this->maxConcurrent += INNER_MAX;
}
if($session->plus) {
$this->maxConcurrent += PLUS_MAX;
}
$this->LoadBuilding();
foreach($this->buildArray as $build) {
if($build['master']==1){
$this->maxConcurrent += 1;
}
}
}
public function procBuild($get) {
global $session;
if(isset($get['a']) && $get['c'] == $session->checker && !isset($get['id'])) {
if($get['a'] == 0) {
$this->removeBuilding($get['d']);
}
else {
$session->changeChecker();
$this->upgradeBuilding($get['a']);
}
}
if(isset($get['a']) && $get['c'] == $session->checker && isset($get['id'])) {
$session->changeChecker();
$this->constructBuilding($get['id'],$get['a']);
}
if(isset($get['buildingFinish'])) {
if($session->gold >= 2 && $session->sit == 0) {
$this->finishAll();
}
}
}
public function canBuild($id,$tid) {
global $village,$session,$database;
$demolition = $database->getDemolition($village->wid);
if($demolition[0]['buildnumber']==$id) { return 11; }
if($this->isMax($tid,$id)) {
return 1;
} else if($this->isMax($tid,$id,1) && ($this->isLoop($id) || $this->isCurrent($id))) {
return 10;
} else if($this->isMax($tid,$id,2) && $this->isLoop($id) && $this->isCurrent($id)) {
return 10;
} else if($this->isMax($tid,$id,3) && $this->isLoop($id) && $this->isCurrent($id) && count($database->getMasterJobs($village->wid)) > 0) {
return 10;
}
else {
if($this->allocated <= $this->maxConcurrent) {
$resRequired = $this->resourceRequired($id,$village->resarray['f'.$id.'t']);
$resRequiredPop = $resRequired['pop'];
if ($resRequiredPop == "") {
$buildarray = $GLOBALS["bid".$tid];
$resRequiredPop = $buildarray[1]['pop'];
}
$jobs = $database->getJobs($village->wid);
if ($jobs > 0) {
$soonPop = 0;
foreach ($jobs as $j) {
$buildarray = $GLOBALS["bid".$j['type']];
$soonPop += $buildarray[$database->getFieldLevel($village->wid,$j['field'])+1]['pop'];
}
}
if(($village->allcrop - $village->pop - $soonPop - $resRequiredPop) <= 1 && $village->resarray['f'.$id.'t'] <> 4) {
return 4;
}
else {
switch($this->checkResource($tid,$id)) {
case 1:
return 5;
break;
case 2:
return 6;
break;
case 3:
return 7;
break;
case 4:
if($id >= 19) {
if($session->tribe == 1 || ALLOW_ALL_TRIBE) {
if($this->inner == 0) {
return 8;
}
else {
if($session->plus or $tid==40) {
if($this->plus == 0) {
return 9;
}
else {
return 3;
}
}
else {
return 2;
}
}
}
else {
if($this->basic == 0) {
return 8;
}
else {
if($session->plus or $tid==40) {
if($this->plus == 0) {
return 9;
}
else {
return 3;
}
}
else {
return 2;
}
}
}
}
else {
if($this->basic == 1) {
if(($session->plus or $tid==40) && $this->plus == 0) {
return 9;
}
else {
return 3;
}
}
else {
return 8;
}
}
break;
}
}
}
else {
return 2;
}
}
}
public function walling() {
global $session;
$wall = array(31,32,33);
foreach($this->buildArray as $job) {
if(in_array($job['type'],$wall)) {
return "3".$session->tribe;
}
}
return false;
}
public function rallying() {
foreach($this->buildArray as $job) {
if($job['type'] == 16) {
return true;
}
}
return false;
}
public function procResType($ref) {
global $session;
switch($ref) {
case 1: $build = "Woodcutter"; break;
case 2: $build = "Clay Pit"; break;
case 3: $build = "Iron Mine"; break;
case 4: $build = "Cropland"; break;
case 5: $build = "Sawmill"; break;
case 6: $build = "Brickyard"; break;
case 7: $build = "Iron Foundry"; break;
case 8: $build = "Grain Mill"; break;
case 9: $build = "Bakery"; break;
case 10: $build = "Warehouse"; break;
case 11: $build = "Granary"; break;
case 12: $build = "Blacksmith"; break;
case 13: $build = "Armoury"; break;
case 14: $build = "Tournament Square"; break;
case 15: $build = "Main Building"; break;
case 16: $build = "Rally Point"; break;
case 17: $build = "Marketplace"; break;
case 18: $build = "Embassy"; break;
case 19: $build = "Barracks"; break;
case 20: $build = "Stable"; break;
case 21: $build = "Workshop"; break;
case 22: $build = "Academy"; break;
case 23: $build = "Cranny"; break;
case 24: $build = "Town Hall"; break;
case 25: $build = "Residence"; break;
case 26: $build = "Palace"; break;
case 27: $build = "Treasury"; break;
case 28: $build = "Trade Office"; break;
case 29: $build = "Great Barracks"; break;
case 30: $build = "Great Stable"; break;
case 31: $build = "City Wall"; break;
case 32: $build = "Earth Wall"; break;
case 33: $build = "Palisade"; break;
case 34: $build = "Stonemason's Lodge"; break;
case 35: $build = "Brewery"; break;
case 36: $build = "Trapper"; break;
case 37: $build = "Hero's Mansion"; break;
case 38: $build = "Great Warehouse"; break;
case 39: $build = "Great Granary"; break;
case 40: $build = "Wonder of the World"; break;
case 41: $build = "Horse Drinking Trough"; break;
case 42: $build = "Great Workshop"; break;
default: $build = "Error"; break;
}
return $build;
}
private function loadBuilding() {
global $database,$village,$session;
$this->buildArray = $database->getJobs($village->wid);
$this->allocated = count($this->buildArray);
if($this->allocated > 0) {
foreach($this->buildArray as $build) {
if($build['loopcon'] == 1) {
$this->plus = 1;
}
else {
if($build['field'] <= 18) {
$this->basic += 1;
}
else {
if($session->tribe == 1 || ALLOW_ALL_TRIBE) {
$this->inner += 1;
}
else {
$this->basic += 1;
}
}
}
}
$this->NewBuilding = true;
}
}
private function removeBuilding($d) {
global $database,$village;
foreach($this->buildArray as $jobs) {
if($jobs['id'] == $d) {
$uprequire = $this->resourceRequired($jobs['field'],$jobs['type']);
if($database->removeBuilding($d)) {
if($jobs['master'] == 0){
$database->modifyResource($village->wid,$uprequire['wood'],$uprequire['clay'],$uprequire['iron'],$uprequire['crop'],1);
}
if($jobs['field'] >= 19) {
header("Location: dorf2.php");
}
else {
header("Location: dorf1.php");
}
}
}
}
}
private function upgradeBuilding($id) {
global $database,$village,$session,$logging;
if($this->allocated < $this->maxConcurrent) {
$uprequire = $this->resourceRequired($id,$village->resarray['f'.$id.'t']);
$time = time() + $uprequire['time'];
$bindicate = $this->canBuild($id,$village->resarray['f'.$id.'t']);
$loop = ($bindicate == 9 ? 1 : 0);
$loopsame = 0;
if($loop == 1) {
foreach($this->buildArray as $build) {
if($build['field']==$id) {
$loopsame += 1;
$uprequire = $this->resourceRequired($id,$village->resarray['f'.$id.'t'],($loopsame>0?2:1));
}
}
if($session->tribe == 1 || ALLOW_ALL_TRIBE) {
if($id >= 19) {
foreach($this->buildArray as $build) {
if($build['field'] >= 19) {
$time = $build['timestamp'] + $uprequire['time'];
}
}
}
else {
foreach($this->buildArray as $build) {
if($build['field'] <= 18) {
$time = $build['timestamp'] + $uprequire['time'];
}
}
}
}
else {
$time = $this->buildArray[0]['timestamp'] + $uprequire['time'];
}
}
$level = $database->getResourceLevel($village->wid);
if($session->access!=BANNED){
if($database->addBuilding($village->wid,$id,$village->resarray['f'.$id.'t'],$loop,$time+($loop==1?ceil(60/SPEED):0),0,$level['f'.$id] + 1 + count($database->getBuildingByField($village->wid,$id)))) {
$database->modifyResource($village->wid,$uprequire['wood'],$uprequire['clay'],$uprequire['iron'],$uprequire['crop'],0);
$logging->addBuildLog($village->wid,$this->procResType($village->resarray['f'.$id.'t']),($village->resarray['f'.$id]+($loopsame>0?2:1)),0);
if($id >= 19) {
header("Location: dorf2.php");
}
else {
header("Location: dorf1.php");
}
}
}else{
header("Location: banned.php");
}
}
}
private function downgradeBuilding($id) {
global $database,$village,$session,$logging;
if($this->allocated < $this->maxConcurrent) {
$name = "bid".$village->resarray['f'.$id.'t'];
global $$name;
$dataarray = $$name;
$time = time() + round($dataarray[$village->resarray['f'.$id]-1]['time'] / 4);
$loop = 0;
if($this->inner == 1 || $this->basic == 1) {
if(($session->plus or $village->resarray['f'.$id.'t']==40)&& $this->plus == 0) {
$loop = 1;
}
}
if($loop == 1) {
if($session->tribe == 1 || ALLOW_ALL_TRIBE) {
if($id >= 19) {
foreach($this->buildArray as $build) {
if($build['field'] >= 19) {
$time = $build['timestamp'] + round($dataarray[$village->resarray['f'.$id]-1]['time'] / 4);
}
}
}
}
else {
$time = $this->buildArray[0]['timestamp'] + round($dataarray[$village->resarray['f'.$id]-1]['time'] / 4);
}
}
if($session->access!=BANNED){
$level = $database->getResourceLevel($village->wid);
if($database->addBuilding($village->wid,$id,$village->resarray['f'.$id.'t'],$loop,$time,0,0,$level['f'.$id] + 1 + count($database->getBuildingByField($village->wid,$id)))) {
$logging->addBuildLog($village->wid,$this->procResType($village->resarray['f'.$id.'t']),($village->resarray['f'.$id]-1),2);
header("Location: dorf2.php");
}
}else{
header("Location: banned.php");
}
}
}
private function constructBuilding($id,$tid) {
global $database,$village,$session,$logging;
if($this->allocated < $this->maxConcurrent) {
if($tid == 16) {
$id = 39;
}
else if($tid == 31 || $tid == 32 || $tid == 33) {
$id = 40;
}
$uprequire = $this->resourceRequired($id,$tid);
$time = time() + $uprequire['time'];
$bindicate = $this->canBuild($id,$village->resarray['f'.$id.'t']);
$loop = ($bindicate == 9 ? 1 : 0);
if($loop == 1) {
foreach($this->buildArray as $build) {
if($build['field'] >= 19 || ($session->tribe <> 1 && !ALLOW_ALL_TRIBE)) {
$time = $build['timestamp'] + ceil(60/SPEED) + $uprequire['time'];
}
}
}
if($this->meetRequirement($tid)) {
if($session->access!=BANNED){
$level = $database->getResourceLevel($village->wid);
if($database->addBuilding($village->wid,$id,$tid,$loop,$time,0,$level['f'.$id] + 1 + count($database->getBuildingByField($village->wid,$id)))) {
$logging->addBuildLog($village->wid,$this->procResType($tid),($village->resarray['f'.$id]+1),1);
$database->modifyResource($village->wid,$uprequire['wood'],$uprequire['clay'],$uprequire['iron'],$uprequire['crop'],0);
header("Location: dorf2.php");
}
}else{
header("Location: banned.php");
}
}
}
}
private function meetRequirement($id) {
global $village,$session,$database;
switch($id) {
case 1:
case 2:
case 3:
case 4:
case 11:
case 15:
case 16:
case 18:
case 23:
case 31:
case 32:
case 33:
return true;
break;
case 10:
case 20:
return ($this->getTypeLevel(15) >= 1)? true : false;
break;
case 5:
if($this->getTypeLevel(1) >= 10 && $this->getTypeLevel(15) >= 5) { return true; } else { return false; }
break;
case 6:
if($this->getTypeLevel(2) >= 10 && $this->getTypeLevel(15) >= 5) { return true; } else { return false; }
break;
case 7:
if($this->getTypeLevel(3) >= 10 && $this->getTypeLevel(15) >= 5) { return true; } else { return false; }
break;
case 8:
if($this->getTypeLevel(4) >= 5) { return true; } else { return false; }
break;
case 9:
if($this->getTypeLevel(15) >= 5 && $this->getTypeLevel(4) >= 10 && $this->getTypeLevel(8) >= 5) { return true; } else { return false; }
break;
case 12:
if($this->getTypeLevel(22) >= 3 && $this->getTypeLevel(15) >= 3) { return true; } else { return false; }
break;
case 13:
if($this->getTypeLevel(15) >= 3 && $this->getTypeLevel(22) >= 1) { return true; } else { return false; }
break;
case 14:
if($this->getTypeLevel(16) >= 15) { return true; } else { return false; }
break;
case 17:
if($this->getTypeLevel(15) >= 3 && $this->getTypeLevel(10) >= 1 && $this->getTypeLevel(11) >= 1) { return true; } else { return false; }
break;
case 19:
if($this->getTypeLevel(15) >= 3 && $this->getTypeLevel(16) >= 1) { return true; } else { return false; }
break;
case 20:
if($this->getTypeLevel(12) >= 3 && $this->getTypeLevel(22) >= 5) { return true; } else { return false; }
break;
case 21:
if($this->getTypeLevel(22) >= 10 && $this->getTypeLevel(15) >= 5) { return true; } else { return false; }
break;
case 22:
if($this->getTypeLevel(15) >= 3 && $this->getTypeLevel(16) >= 1) { return true; } else { return false; }
break;
case 24:
if($this->getTypeLevel(22) >= 10 && $this->getTypeLevel(15) >= 10) { return true; } else { return false; }
break;
case 25:
if($this->getTypeLevel(15) >= 5) { return true; } else { return false; }
break;
case 26:
if($this->getTypeLevel(18) >= 1 && $this->getTypeLevel(15) >= 5 && $this->getTypeLevel(25) == 0) { return true; } else { return false; }
break;
case 27:
if($this->getTypeLevel(15) >= 10) { return true; } else { return false; }
break;
case 28:
if($this->getTypeLevel(17) == 20 && $this->getTypeLevel(20) >= 10) { return true; } else { return false; }
break;
case 29:
if($this->getTypeLevel(19) == 20 && $village->capital == 0) { return true; } else { return false; }
break;
case 30:
if($this->getTypeLevel(20) == 20 && $village->capital == 0) { return true; } else { return false; }
break;
case 34:
if($this->getTypeLevel(26) >= 3 && $this->getTypeLevel(15) >= 5 && $this->getTypeLevel(25) == 0) { return true; } else { return false; }
break;
case 35:
if($this->getTypeLevel(16) >= 10 && $this->getTypeLevel(11) == 20) { return true; } else { return false; }
break;
case 36:
if($this->getTypeLevel(16) >= 1) { return true; } else { return false; }
break;
case 37:
if($this->getTypeLevel(15) >= 3 && $this->getTypeLevel(16) >= 1) { return true; } else { return false; }
break;
case 38:
if($this->getTypeLevel(15) >= 10 && $village->capital == 0) { return true; } else { return false; }
break;
case 39:
if($this->getTypeLevel(15) >= 10 && $village->capital == 0) { return true; } else { return false; }
break;
case 40:
$wwlevel = $village->resarray['f99'];
if($wwlevel > 50){
$needed_plan = 1;
}else{
$needed_plan = 0;
}
$wwbuildingplan = 0;
$villages = $database->getVillagesID($session->uid);
foreach($villages as $village1){
$plan = count($database->getOwnArtefactInfoByType2($village1,11));
if($plan > 0){
$wwbuildingplan = 1;
}
}
if($session->alliance != 0){
$alli_users = $database->getUserByAlliance($session->alliance);
foreach($alli_users as $users){
$villages = $database->getVillagesID($users['id']);
if($users['id'] != $session->uid){
foreach($villages as $village1){
$plan = count($database->getOwnArtefactInfoByType2($village1,11));
if($plan > 0){
$wwbuildingplan += 1;
}
}
}
}
}
if($village->natar == 1 && $wwbuildingplan > $needed_plan) { return true; } else { return false; }
break;
case 41:
if($this->getTypeLevel(16) >= 10 && $this->getTypeLevel(20) == 20) { return true; } else { return false; }
break;
case 42:
if($this->getTypeLevel(21) == 20 && $village->capital == 0) { return true; } else { return false; }
break;
}
}
private function checkResource($tid,$id) {
$name = "bid".$tid;
global $village,$$name,$database;
$plus = 1;
foreach($this->buildArray as $job) {
if($job['type'] == $tid && $job['field'] == $id) {
$plus = 2;
}
}
$dataarray = $$name;
$wood = $dataarray[$village->resarray['f'.$id]+$plus]['wood'];
$clay = $dataarray[$village->resarray['f'.$id]+$plus]['clay'];
$iron = $dataarray[$village->resarray['f'.$id]+$plus]['iron'];
$crop = $dataarray[$village->resarray['f'.$id]+$plus]['crop'];
if($wood > $village->maxstore || $clay > $village->maxstore || $iron > $village->maxstore) {
return 1;
}
else {
if($crop > $village->maxcrop) {
return 2;
}
else {
if($wood > $village->awood || $clay > $village->aclay || $iron > $village->airon || $crop > $village->acrop) {
return 3;
}
else {
if($village->awood-$wood > 0 && $village->aclay-$clay > 0 && $village->airon-$iron > 0 && $village->acrop-$crop >0){
return 4;
}
else {
return 3;
}
}
}
}
}
public function isMax($id,$field,$loop=0) {
$name = "bid".$id;
global $$name,$village;
$dataarray = $$name;
if($id <= 4) {
if($village->capital == 1) {
return ($village->resarray['f'.$field] == (count($dataarray) - 1 - $loop));
}
else {
return ($village->resarray['f'.$field] == (count($dataarray) - 11 - $loop));
}
}
else {
return ($village->resarray['f'.$field] == count($dataarray) - $loop);
}
}
public function getTypeLevel($tid,$vid=0) {
global $village,$database;
$keyholder = array();
if($vid == 0) {
$resourcearray = $village->resarray;
} else {
$resourcearray = $database->getResourceLevel($vid);
}
foreach(array_keys($resourcearray,$tid) as $key) {
if(strpos($key,'t')) {
$key = preg_replace("/[^0-9]/", '', $key);
array_push($keyholder, $key);
}
}
$element = count($keyholder);
if($element >= 2) {
if($tid <= 4) {
$temparray = array();
for($i=0;$i<=$element-1;$i++) {
array_push($temparray,$resourcearray['f'.$keyholder[$i]]);
}
foreach ($temparray as $key => $val) {
if ($val == max($temparray))
$target = $key;
}
}
else {
$target = 0;
for($i=1;$i<=$element-1;$i++) {
if($resourcearray['f'.$keyholder[$i]] > $resourcearray['f'.$keyholder[$target]]) {
$target = $i;
}
}
}
}
else if($element == 1) {
$target = 0;
}
else {
return 0;
}
if($keyholder[$target] != "") {
return $resourcearray['f'.$keyholder[$target]];
}
else {
return 0;
}
}
public function isCurrent($id) {
foreach($this->buildArray as $build) {
if($build['field'] == $id && $build['loopcon'] <> 1) {
return true;
}
}
}
public function isLoop($id=0) {
foreach($this->buildArray as $build) {
if(($build['field'] == $id && $build['loopcon']) || ($build['loopcon'] == 1 && $id == 0)) {
return true;
}
}
return false;
}
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){
$level = $jobs['level'];
if($jobs['type'] != 25 AND $jobs['type'] != 26 AND $jobs['type'] != 40) {
$finish = 1;
$resource = $this->resourceRequired($jobs['field'],$jobs['type']);
if($jobs['master'] == 0){
$q = "UPDATE ".TB_PREFIX."fdata set f".$jobs['field']." = ".$jobs['level'].", f".$jobs['field']."t = ".$jobs['type']." where vref = ".$jobs['wid'];
}else{
$villwood = $database->getVillageField($jobs['wid'],'wood');
$villclay = $database->getVillageField($jobs['wid'],'clay');
$villiron = $database->getVillageField($jobs['wid'],'iron');
$villcrop = $database->getVillageField($jobs['wid'],'crop');
$type = $jobs['type'];
$buildarray = $GLOBALS["bid".$type];
$buildwood = $buildarray[$level]['wood'];
$buildclay = $buildarray[$level]['clay'];
$buildiron = $buildarray[$level]['iron'];
$buildcrop = $buildarray[$level]['crop'];
if($buildwood < $villwood && $buildclay < $villclay && $buildiron < $villiron && $buildcrop < $villcrop){
$newgold = $session->gold-1;
$database->updateUserField($session->uid, "gold", $newgold, 1);
$enought_res = 1;
$q = "UPDATE ".TB_PREFIX."fdata set f".$jobs['field']." = ".$jobs['level'].", f".$jobs['field']."t = ".$jobs['type']." where vref = ".$jobs['wid'];
}
}
if($database->query($q) && ($enought_res == 1 or $jobs['master'] == 0)) {
$database->modifyPop($jobs['wid'],$resource['pop'],0);
$database->addCP($jobs['wid'],$resource['cp']);
$q = "DELETE FROM ".TB_PREFIX."bdata where id = ".$jobs['id'];
$database->query($q);
if($jobs['type'] == 18) {
$owner = $database->getVillageField($jobs['wid'],"owner");
$max = $bid18[$level]['attri'];
$q = "UPDATE ".TB_PREFIX."alidata set max = $max where leader = $owner";
$database->query($q);
}
}
if(($jobs['field'] >= 19 && ($session->tribe == 1 || ALLOW_ALL_TRIBE)) || (!ALLOW_ALL_TRIBE && $session->tribe != 1)) { $innertimestamp = $jobs['timestamp']; }
}
}
}
}
$wwvillage1 = $database->getResourceLevel($village->wid);
if($wwvillage1['f99t']!=40){
$ww = 0;
}
if($ww == 0){
$database->finishDemolition($village->wid);
$technology->finishTech();
$logging->goldFinLog($village->wid);
$database->modifyGold($session->uid,2,0);
$stillbuildingarray = $database->getJobs($village->wid);
if(count($stillbuildingarray) == 1) {
if($stillbuildingarray[0]['loopcon'] == 1) {
$q = "UPDATE ".TB_PREFIX."bdata SET loopcon=0,timestamp=".(time()+$stillbuildingarray[0]['timestamp']-$innertimestamp)." WHERE id=".$stillbuildingarray[0]['id'];
$database->query($q);
}
}
}
header("Location: ".$session->referrer);
}else{
header("Location: banned.php");
}
}
public function resourceRequired($id,$tid,$plus=1) {
$name = "bid".$tid;
global $$name,$village,$bid15;
$dataarray = $$name;
$wood = $dataarray[$village->resarray['f'.$id]+$plus]['wood'];
$clay = $dataarray[$village->resarray['f'.$id]+$plus]['clay'];
$iron = $dataarray[$village->resarray['f'.$id]+$plus]['iron'];
$crop = $dataarray[$village->resarray['f'.$id]+$plus]['crop'];
$pop = $dataarray[$village->resarray['f'.$id]+$plus]['pop'];
if ($tid == 15) {
if($this->getTypeLevel(15) == 0) {
$time = round($dataarray[$village->resarray['f'.$id]+$plus]['time']/ SPEED *5);
}
else {
$time = round($dataarray[$village->resarray['f'.$id]+$plus]['time'] / SPEED);
}
}
else {
if($this->getTypeLevel(15) != 0) {
$time = round($dataarray[$village->resarray['f'.$id]+$plus]['time'] * ($bid15[$this->getTypeLevel(15)]['attri']/100) / SPEED);
}
else {
$time = round($dataarray[$village->resarray['f'.$id]+$plus]['time']*5 / SPEED);
}
}
$cp = $dataarray[$village->resarray['f'.$id]+$plus]['cp'];
return array("wood"=>$wood,"clay"=>$clay,"iron"=>$iron,"crop"=>$crop,"pop"=>$pop,"time"=>$time,"cp"=>$cp);
}
public function getTypeField($type) {
global $village;
for($i=19;$i<=40;$i++) {
if($village->resarray['f'.$i.'t'] == $type) {
return $i;
}
}
}
public function calculateAvaliable($id,$tid,$plus=1) {
global $village,$generator;
$uprequire = $this->resourceRequired($id,$tid,$plus);
$rwood = $uprequire['wood']-$village->awood;
$rclay = $uprequire['clay']-$village->aclay;
$rcrop = $uprequire['crop']-$village->acrop;
$riron = $uprequire['iron']-$village->airon;
$rwtime = $rwood / $village->getProd("wood") * 3600;
$rcltime = $rclay / $village->getProd("clay")* 3600;
$rctime = $rcrop / $village->getProd("crop")* 3600;
$ritime = $riron / $village->getProd("iron")* 3600;
$reqtime = max($rwtime,$rctime,$rcltime,$ritime);
$reqtime += time();
return $generator->procMtime($reqtime);
}
};
?>
+384
View File
@@ -0,0 +1,384 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Chat.php ##
## Developed by: TTMMTT ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
if (!isset($SAJAX_INCLUDED)) {
$GLOBALS['sajax_version'] = '0.12';
$GLOBALS['sajax_debug_mode'] = 0;
$GLOBALS['sajax_export_list'] = array();
$GLOBALS['sajax_request_type'] = 'GET';
$GLOBALS['sajax_remote_uri'] = '';
$GLOBALS['sajax_failure_redirect'] = '';
function sajax_init() {
}
function sajax_get_my_uri() {
return $_SERVER["REQUEST_URI"];
}
$sajax_remote_uri = sajax_get_my_uri();
function sajax_get_js_repr($value) {
$type = gettype($value);
if ($type == "boolean") {
return ($value) ? "Boolean(true)" : "Boolean(false)";
}
elseif ($type == "integer") {
return "parseInt($value)";
}
elseif ($type == "double") {
return "parseFloat($value)";
}
elseif ($type == "array" || $type == "object" ) {
$s = "{ ";
if ($type == "object") {
$value = get_object_vars($value);
}
foreach ($value as $k=>$v) {
$esc_key = sajax_esc($k);
if (is_numeric($k))
$s .= "$k: " . sajax_get_js_repr($v) . ", ";
else
$s .= "\"$esc_key\": " . sajax_get_js_repr($v) . ", ";
}
if (count($value))
$s = substr($s, 0, -2);
return $s . " }";
}
else {
$esc_val = sajax_esc($value);
$s = "'$esc_val'";
return $s;
}
}
function sajax_handle_client_request() {
global $sajax_export_list;
$mode = "";
if (! empty($_GET["rs"]))
$mode = "get";
if (!empty($_POST["rs"]))
$mode = "post";
if (empty($mode))
return;
$target = "";
if ($mode == "get") {
header ("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header ("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header ("Cache-Control: no-cache, must-revalidate");
header ("Pragma: no-cache");
$func_name = $_GET["rs"];
if (! empty($_GET["rsargs"]))
$args = $_GET["rsargs"];
else
$args = array();
}
else {
$func_name = $_POST["rs"];
if (! empty($_POST["rsargs"]))
$args = $_POST["rsargs"];
else
$args = array();
}
if (! in_array($func_name, $sajax_export_list))
echo "-:$func_name not callable";
else {
echo "+:";
$result = call_user_func_array($func_name, $args);
echo "var res = " . trim(sajax_get_js_repr($result)) . "; res;";
}
exit;
}
function sajax_get_common_js() {
global $sajax_debug_mode;
global $sajax_request_type;
global $sajax_remote_uri;
global $sajax_failure_redirect;
$t = strtoupper($sajax_request_type);
if ($t != "" && $t != "GET" && $t != "POST")
return "// Invalid type: $t.. \n\n";
ob_start();
?>
// remote scripting library
// (c) copyright 2005 modernmethod, inc
// edited by ttmtt
var sajax_debug_mode = <?php echo $sajax_debug_mode ? "true" : "false"; ?>;
var sajax_request_type = "<?php echo $t; ?>";
var sajax_target_id = "";
var sajax_failure_redirect = "<?php echo $sajax_failure_redirect; ?>";
function sajax_debug(text) {
if (sajax_debug_mode)
alert(text);
}
function sajax_init_object() {
sajax_debug("sajax_init_object() called..")
var A;
var msxmlhttp = new Array(
'Msxml2.XMLHTTP.5.0',
'Msxml2.XMLHTTP.4.0',
'Msxml2.XMLHTTP.3.0',
'Msxml2.XMLHTTP',
'Microsoft.XMLHTTP');
for (var i = 0; i < msxmlhttp.length; i++) {
try {
A = new ActiveXObject(msxmlhttp[i]);
} catch (e) {
A = null;
}
}
if(!A && typeof XMLHttpRequest != "undefined")
A = new XMLHttpRequest();
if (!A)
sajax_debug("Could not create connection object.");
return A;
}
var sajax_requests = new Array();
function sajax_cancel() {
for (var i = 0; i < sajax_requests.length; i++)
sajax_requests[i].abort();
}
function sajax_do_call(func_name, args) {
var i, x, n;
var uri;
var post_data;
var target_id;
sajax_debug("in sajax_do_call().." + sajax_request_type + "/" + sajax_target_id);
target_id = sajax_target_id;
if (typeof(sajax_request_type) == "undefined" || sajax_request_type == "")
sajax_request_type = "GET";
uri = "<?php echo $sajax_remote_uri; ?>";
if (sajax_request_type == "GET") {
// alert(args);
if (uri.indexOf("?") == -1)
uri += "?rs=" + escape(func_name);
else
uri += "&rs=" + escape(func_name);
uri += "&rst=" + escape(sajax_target_id);
uri += "&rsrnd=" + new Date().getTime();
for (i = 0; i < args.length-1; i++) {
uri += "&rsargs[]=" + args[i];
}
post_data = null;
}
else if (sajax_request_type == "POST") {
post_data = "rs=" + escape(func_name);
post_data += "&rst=" + escape(sajax_target_id);
post_data += "&rsrnd=" + new Date().getTime();
for (i = 0; i < args.length-1; i++)
post_data = post_data + "&rsargs[]=" + escape(args[i]);
}
else {
alert("Illegal request type: " + sajax_request_type);
}
x = sajax_init_object();
if (x == null) {
if (sajax_failure_redirect != "") {
location.href = sajax_failure_redirect;
return false;
} else {
sajax_debug("NULL sajax object for user agent:\n" + navigator.userAgent);
return false;
}
} else {
x.open(sajax_request_type, uri, true);
// window.open(uri);
sajax_requests[sajax_requests.length] = x;
if (sajax_request_type == "POST") {
x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");
x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
}
x.onreadystatechange = function() {
if (x.readyState != 4)
return;
sajax_debug("received " + x.responseText);
var status;
var data;
var txt = x.responseText.replace(/^\s*|\s*$/g,"");
status = txt.charAt(0);
data = txt.substring(2);
if (status == "") {
// let's just assume this is a pre-response bailout and let it slide for now
} else if (status == "-")
alert("Error: " + data);
else {
if (target_id != "")
document.getElementById(target_id).innerHTML = eval(data);
else {
try {
var callback;
var extra_data = false;
if (typeof args[args.length-1] == "object") {
callback = args[args.length-1].callback;
extra_data = args[args.length-1].extra_data;
} else {
callback = args[args.length-1];
}
callback(eval(data), extra_data);
} catch (e) {
sajax_debug("Caught error " + e + ": Could not eval " + data );
}
}
}
}
}
sajax_debug(func_name + " uri = " + uri + "/post = " + post_data);
x.send(post_data);
sajax_debug(func_name + " waiting..");
delete x;
return true;
}
<?php
$html = ob_get_contents();
ob_end_clean();
return $html;
}
function sajax_show_common_js() {
echo sajax_get_common_js();
}
// javascript escape a value
function sajax_esc($val)
{
$val = str_replace("\\", "\\\\", $val);
$val = str_replace("\r", "\\r", $val);
$val = str_replace("\n", "\\n", $val);
$val = str_replace("'", "\\'", $val);
return str_replace('"', '\\"', $val);
}
function sajax_get_one_stub($func_name) {
ob_start();
?>
// wrapper for <?php echo $func_name; ?>
function x_<?php echo $func_name; ?>() {
sajax_do_call("<?php echo $func_name; ?>",
x_<?php echo $func_name; ?>.arguments);
}
<?php
$html = ob_get_contents();
ob_end_clean();
return $html;
}
function sajax_show_one_stub($func_name) {
echo sajax_get_one_stub($func_name);
}
function sajax_export() {
global $sajax_export_list;
$n = func_num_args();
for ($i = 0; $i < $n; $i++) {
$sajax_export_list[] = func_get_arg($i);
}
}
$sajax_js_has_been_shown = 0;
function sajax_get_javascript()
{
global $sajax_js_has_been_shown;
global $sajax_export_list;
$html = "";
if (! $sajax_js_has_been_shown) {
$html .= sajax_get_common_js();
$sajax_js_has_been_shown = 1;
}
foreach ($sajax_export_list as $func) {
$html .= sajax_get_one_stub($func);
}
return $html;
}
function sajax_show_javascript()
{
echo sajax_get_javascript();
}
$SAJAX_INCLUDED = 1;
}
function add_data($data) {
global $session,$database;
//$data = explode("|",$data);
if (is_array($data)){$msg = htmlspecialchars($data[1]);}else{$msg = htmlspecialchars($data);};
// $msg=htmlspecialchars($msg);
$name = $session->username;
$id_user = $session->uid;
$alliance = $session->alliance;
$now = time();
echo $q = "INSERT into ".TB_PREFIX."chat (id_user,name,alli,date,msg) values ('$id_user','$name','$alliance','$now','$msg')";
mysql_query($q, $database->connection);
}
function get_data() {
global $session,$database;
$alliance = $session->alliance;
$query = mysql_query("select * from ".TB_PREFIX."chat where alli='$alliance' order by id desc limit 0,13");
while ($r = mysql_fetch_array($query)) {
$dates = date("g:i",$r[date]);
$data .= "[{$dates}] <a href='spieler.php?uid={$r['id_user']}'>{$r['name']}</a>: {$r[msg]} <br>";
}
return $data;
}
$sajax_request_type = "GET";
sajax_init();
sajax_export("add_data","get_data");
sajax_handle_client_request();
?>
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+49
View File
@@ -0,0 +1,49 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename cel.php ##
## Developed by: G3n3s!s & JimJam & LoppyLukas ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
$cel=array(1=>array('name'=>'Small Celebration','wood'=>6400,'clay'=>6650,'iron'=>5940,'crop'=>1340,'attri'=>500,'time'=>86400),array('name'=>'Great Celebration','wood'=>29700,'clay'=>33250,'iron'=>32000,'crop'=>6700,'attri'=>2000,'time'=>216000));
$sc = array(
1 => 86400,
2 => 83290,
3 => 80291,
4 => 77401,
5 => 74614,
6 => 71928,
7 => 69338,
8 => 66843,
9 => 64436,
10 => 62117,
11 => 59880,
12 => 57725,
13 => 55647,
14 => 53643,
15 => 51712,
16 => 49850,
17 => 48056,
18 => 46326,
19 => 44658,
20 => 43050);
$gc= array(
10 => 155291,
11 => 149701,
12 => 144312,
13 => 139116,
14 => 134108,
15 => 129280,
16 => 124626,
17 => 120140,
18 => 115815,
19 => 111645,
20 => 107626);
?>
+267
View File
@@ -0,0 +1,267 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename cp.php ##
## Developed by: G3n3s!s & JimJam & LoppyLukas ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
$cp0 = array(
1 => 0,
2 => 500,
3 => 2600,
4 => 6700,
5 => 12900,
6 => 21600,
7 => 32900,
8 => 46000,
9 => 63000,
10 => 83500,
11 => 106400,
12 => 132500,
13 => 161900,
14 => 194600,
15 => 230700,
16 => 270400,
17 => 313700,
18 => 360600,
19 => 411300,
20 => 465700,
21 => 524000,
22 => 586300,
23 => 652500,
24 => 722700,
25 => 797000,
26 => 875500,
27 => 958200,
28 => 1045000,
29 => 1136200,
30 => 1231700,
31 => 1316000,
32 => 1435900,
33 => 1435900,
34 => 1658000,
35 => 1775800,
36 => 1898300,
37 => 2025300,
38 => 2157100,
39 => 2293500,
40 => 2434700,
41 => 2580700,
42 => 2731500,
43 => 2887200,
44 => 3047700,
45 => 3213200,
46 => 3383700,
47 => 3559100,
48 => 3739600,
49 => 3925100,
50 => 4115800,
51 => 4311500,
52 => 4512400,
53 => 4718500,
54 => 4929800,
55 => 5146400,
56 => 5368300,
57 => 5595400,
58 => 5827900,
59 => 6065700,
60 => 6309000,
61 => 6557600,
62 => 6811700,
63 => 7071300,
64 => 7336400,
65 => 7607000,
66 => 7883100,
67 => 8164900,
68 => 8452200,
69 => 8745200,
70 => 9043800,
71 => 9348100,
72 => 9659100,
73 => 9973900,
74 => 10295400,
75 => 10622600,
76 => 10955700,
77 => 11294600,
78 => 11639300,
79 => 11989900,
80 => 12346400,
81 => 12708800,
82 => 13077200,
83 => 13451500,
84 => 13831800,
85 => 14218100,
86 => 14610400,
87 => 15008800,
88 => 15413200,
89 => 15823700,
90 => 16240400,
91 => 16663100,
92 => 17092000,
93 => 17527100,
94 => 17968400,
95 => 18415900,
96 => 18869600,
97 => 19329600,
98 => 19795800,
99 => 20268400,
100 => 20747200,
101 => 21232400,
102 => 21723900,
103 => 22221800,
104 => 22726100,
105 => 23236800,
106 => 23753900,
107 => 24277400,
108 => 24807400,
109 => 25343900,
110 => 25886900,
111 => 26436400,
112 => 26992400,
113 => 27555000,
114 => 28124100,
115 => 28699900,
116 => 29282200,
117 => 29871200,
118 => 30466800,
119 => 31069000,
120 => 31677900,
121 => 32293500,
122 => 32915900,
123 => 33544900,
124 => 34180700,
125 => 34823200);
$cp1= array(
1 => 0,
2 => 2000,
3 => 8000,
4 => 20000,
5 => 39000,
6 => 65000,
7 => 99000,
8 => 141000,
9 => 191000,
10 => 251000,
11 => 319000,
12 => 397000,
13 => 486000,
14 => 584000,
15 => 692000,
16 => 811000,
17 => 941000,
18 => 1082000,
19 => 1234000,
20 => 1397000,
21 => 1572000,
22 => 1759000,
23 => 1957000,
24 => 2168000,
25 => 2391000,
26 => 2627000,
27 => 2874000,
28 => 3135000,
29 => 3409000,
30 => 3695000,
31 => 3995000,
32 => 4308000,
33 => 4634000,
34 => 4974000,
35 => 5327000,
36 => 5695000,
37 => 6076000,
38 => 6471000,
39 => 6881000,
40 => 7304000,
41 => 7742000,
42 => 8195000,
43 => 8662000,
44 => 9143000,
45 => 9640000,
46 => 10151000,
47 => 10677000,
48 => 11219000,
49 => 11775000,
50 => 12347000,
51 => 12935000,
52 => 13537000,
53 => 14156000,
54 => 14790000,
55 => 15439000,
56 => 16105000,
57 => 16786000,
58 => 17484000,
59 => 18197000,
60 => 18927000,
61 => 19673000,
62 => 20435000,
63 => 21214000,
64 => 22009000,
65 => 22821000,
66 => 23649000,
67 => 24495000,
68 => 25357000,
69 => 26236000,
70 => 27131000,
71 => 28044000,
72 => 28974000,
73 => 29922000,
74 => 30886000,
75 => 31868000,
76 => 32867000,
77 => 33884000,
78 => 34918000,
79 => 35970000,
80 => 37039000,
81 => 38127000,
82 => 39232000,
83 => 40354000,
84 => 41495000,
85 => 42654000,
86 => 43831000,
87 => 45026000,
88 => 46240000,
89 => 47471000,
90 => 48721000,
91 => 49989000,
92 => 51276000,
93 => 52581000,
94 => 53905000,
95 => 55248000,
96 => 56609000,
97 => 57989000,
98 => 59387000,
99 => 60805000,
100 => 62242000,
101 => 63697000,
102 => 65172000,
103 => 66665000,
104 => 68178000,
105 => 69710000,
106 => 71262000,
107 => 72832000,
108 => 74422000,
109 => 76032000,
110 => 77661000,
111 => 79309000,
112 => 80977000,
113 => 82665000,
114 => 84372000,
115 => 86000000,
116 => 87847000,
117 => 89613000,
118 => 91400000,
119 => 93207000,
120 => 95034000,
121 => 96881000,
122 => 98748000,
123 => 100635000,
124 => 102542000,
125 => 104470000);
?>
+182
View File
@@ -0,0 +1,182 @@
<?php
$hero_levels = array(0 => 0, 100, 300, 600, 1000, 1500, 2100, 2800, 3600, 4500, 5500, 6600, 7800, 9100, 10500, 12000, 13600, 15300, 17100, 19000, 21000, 23100, 25300, 27600, 30000, 32500, 35100, 37800, 40600, 43500, 46500, 49600, 52800, 56100, 59500, 63000, 66600, 70300, 74100, 78000, 82000, 86100, 90300, 94600, 99000, 103500, 108100, 112800, 117600, 122500, 127500, 132600, 137800, 143100, 148500, 154000, 159600, 165300, 171100, 177000, 183000, 189100, 195300, 201600, 208000, 214500, 221100, 227800,
234600, 241500, 248500, 255600, 262800, 270100, 277500, 285000, 292600, 300300, 308100, 316000, 324000, 332100, 340300, 348600, 357000, 365500, 374100, 382800, 391600, 400500, 409500, 418600, 427800, 437100, 446500, 456000, 465600, 475300, 485100, 495000);
//ROMAN UNITS
$h1_full = array(array('wood' => 240, 'clay' => 200, 'iron' => 300, 'crop' => 60, 'time' => 3200), array('wood' => 640, 'clay' => 550, 'iron' => 780, 'crop' => 210, 'time' => 6400), array('wood' => 1100, 'clay' => 910, 'iron' => 1300, 'crop' => 360, 'time' => 9600), array('wood' => 1500, 'clay' => 1300, 'iron' => 1900, 'crop' => 510, 'time' => 12800), array('wood' => 2000, 'clay' => 1700, 'iron' => 2500, 'crop' => 670, 'time' => 16000), array('wood' => 2500, 'clay' => 2200, 'iron' => 3100, 'crop' => 850, 'time' =>
19200), array('wood' => 3100, 'clay' => 2600, 'iron' => 3800, 'crop' => 1000, 'time' => 22400), array('wood' => 3600, 'clay' => 3100, 'iron' => 4400, 'crop' => 1200, 'time' => 25580), array('wood' => 4200, 'clay' => 3600, 'iron' => 5100, 'crop' => 1400, 'time' => 28800), array('wood' => 4800, 'clay' => 4100, 'iron' => 5900, 'crop' => 1600, 'time' => 32000), array('wood' => 5400, 'clay' => 4600, 'iron' => 6600, 'crop' => 1800, 'time' => 35200), array('wood' => 6000, 'clay' => 5100, 'iron' => 7400, 'crop' => 2000,
'time' => 38400), array('wood' => 6700, 'clay' => 5700, 'iron' => 8100, 'crop' => 2200, 'time' => 41600), array('wood' => 7300, 'clay' => 6200, 'iron' => 8900, 'crop' => 2400, 'time' => 44800), array('wood' => 8000, 'clay' => 6800, 'iron' => 9700, 'crop' => 2700, 'time' => 48000), array('wood' => 8600, 'clay' => 7400, 'iron' => 10500, 'crop' => 2900, 'time' => 51200), array('wood' => 9300, 'clay' => 7900, 'iron' => 11500, 'crop' => 3100, 'time' => 54400), array('wood' => 10000, 'clay' => 8500, 'iron' => 12000,
'crop' => 3300, 'time' => 57600), array('wood' => 10500, 'clay' => 9100, 'iron' => 13000, 'crop' => 3600, 'time' => 60800), array('wood' => 11500, 'clay' => 9700, 'iron' => 14000, 'crop' => 3800, 'time' => 64000), array('wood' => 12000, 'clay' => 10500, 'iron' => 15000, 'crop' => 4000, 'time' => 67200), array('wood' => 13000, 'clay' => 11000, 'iron' => 15500, 'crop' => 4300, 'time' => 70400), array('wood' => 13500, 'clay' => 11500, 'iron' => 16500, 'crop' => 4500, 'time' => 73600), array('wood' => 14500, 'clay' =>
12000, 'iron' => 17500, 'crop' => 4800, 'time' => 76800), array('wood' => 15000, 'clay' => 13000, 'iron' => 18500, 'crop' => 5000, 'time' => 80000), array('wood' => 16000, 'clay' => 13500, 'iron' => 19500, 'crop' => 5300, 'time' => 83200), array('wood' => 16500, 'clay' => 14000, 'iron' => 20500, 'crop' => 5500, 'time' => 86400), array('wood' => 17500, 'clay' => 15000, 'iron' => 21500, 'crop' => 5800, 'time' => 89600), array('wood' => 18000, 'clay' => 15500, 'iron' => 22000, 'crop' => 6100, 'time' => 92800),
array('wood' => 19000, 'clay' => 16000, 'iron' => 23000, 'crop' => 6300, 'time' => 96000), array('wood' => 19500, 'clay' => 17000, 'iron' => 24000, 'crop' => 6600, 'time' => 99200), array('wood' => 20500, 'clay' => 17500, 'iron' => 25000, 'crop' => 6800, 'time' => 102400), array('wood' => 21500, 'clay' => 18000, 'iron' => 26000, 'crop' => 7100, 'time' => 105600), array('wood' => 22000, 'clay' => 19000, 'iron' => 27000, 'crop' => 7400, 'time' => 108800), array('wood' => 23000, 'clay' => 19500, 'iron' => 28000, 'crop' =>
7700, 'time' => 112000), array('wood' => 24000, 'clay' => 20500, 'iron' => 29000, 'crop' => 7900, 'time' => 115200), array('wood' => 24500, 'clay' => 21000, 'iron' => 30000, 'crop' => 8200, 'time' => 118400), array('wood' => 25500, 'clay' => 21500, 'iron' => 31000, 'crop' => 8500, 'time' => 121600), array('wood' => 26500, 'clay' => 22500, 'iron' => 32000, 'crop' => 8800, 'time' => 124800), array('wood' => 27000, 'clay' => 23000, 'iron' => 33000, 'crop' => 9100, 'time' => 128000), array('wood' => 28000, 'clay' => 24000,
'iron' => 34000, 'crop' => 9300, 'time' => 131200), array('wood' => 29000, 'clay' => 24500, 'iron' => 35500, 'crop' => 9600, 'time' => 134400), array('wood' => 29500, 'clay' => 25500, 'iron' => 36500, 'crop' => 9900, 'time' => 137600), array('wood' => 30500, 'clay' => 26000, 'iron' => 37500, 'crop' => 10000, 'time' => 140800), array('wood' => 31500, 'clay' => 27000, 'iron' => 38500, 'crop' => 10500, 'time' => 144000), array('wood' => 32500, 'clay' => 27500, 'iron' => 39500, 'crop' => 11000, 'time' => 147200),
array('wood' => 34000, 'clay' => 28500, 'iron' => 40500, 'crop' => 11000, 'time' => 150400), array('wood' => 34000, 'clay' => 29000, 'iron' => 41500, 'crop' => 11500, 'time' => 153600), array('wood' => 35000, 'clay' => 30000, 'iron' => 43000, 'crop' => 11500, 'time' => 156800), array('wood' => 36000, 'clay' => 30500, 'iron' => 44000, 'crop' => 12000, 'time' => 160000), array('wood' => 37000, 'clay' => 31500, 'iron' => 45000, 'crop' => 12500, 'time' => 163200), array('wood' => 37500, 'clay' => 32000, 'iron' => 46000,
'crop' => 12500, 'time' => 166400), array('wood' => 38500, 'clay' => 33000, 'iron' => 47000, 'crop' => 13000, 'time' => 169600), array('wood' => 39500, 'clay' => 33500, 'iron' => 48500, 'crop' => 13000, 'time' => 172800), array('wood' => 40500, 'clay' => 34500, 'iron' => 49500, 'crop' => 13500, 'time' => 176000), array('wood' => 41500, 'clay' => 35000, 'iron' => 50500, 'crop' => 14000, 'time' => 179200), array('wood' => 42500, 'clay' => 36000, 'iron' => 51500, 'crop' => 14000, 'time' => 182400), array('wood' => 43000,
'clay' => 37000, 'iron' => 53000, 'crop' => 14500, 'time' => 185600), array('wood' => 44000, 'clay' => 37500, 'iron' => 54000, 'crop' => 14500, 'time' => 188800), array('wood' => 45000, 'clay' => 38500, 'iron' => 55000, 'crop' => 15000, 'time' => 192000), array('wood' => 46000, 'clay' => 39000, 'iron' => 56500, 'crop' => 15500, 'time' => 195200));
$h2_full = array(array('wood' => 200, 'clay' => 260, 'iron' => 320, 'crop' => 140, 'time' => 3520), array('wood' => 550, 'clay' => 690, 'iron' => 830, 'crop' => 400, 'time' => 7040), array('wood' => 910, 'clay' => 1100, 'iron' => 1400, 'crop' => 670, 'time' => 10560), array('wood' => 1300, 'clay' => 1600, 'iron' => 2000, 'crop' => 960, 'time' => 14080), array('wood' => 1700, 'clay' => 2200, 'iron' => 2600, 'crop' => 1300, 'time' => 17600), array('wood' => 2200, 'clay' => 2700, 'iron' => 3300, 'crop' => 1600, 'time' =>
21120), array('wood' => 2600, 'clay' => 3300, 'iron' => 4000, 'crop' => 1900, 'time' => 24640), array('wood' => 3100, 'clay' => 3900, 'iron' => 4700, 'crop' => 2300, 'time' => 28160), array('wood' => 3600, 'clay' => 4500, 'iron' => 5500, 'crop' => 2700, 'time' => 31680), array('wood' => 4100, 'clay' => 5200, 'iron' => 6200, 'crop' => 3000, 'time' => 35200), array('wood' => 4600, 'clay' => 5800, 'iron' => 7000, 'crop' => 3400, 'time' => 38720), array('wood' => 5100, 'clay' => 6500, 'iron' => 7800, 'crop' => 3800, 'time' =>
42240), array('wood' => 5700, 'clay' => 7200, 'iron' => 8600, 'crop' => 4200, 'time' => 45760), array('wood' => 6200, 'clay' => 7900, 'iron' => 9500, 'crop' => 4600, 'time' => 49280), array('wood' => 6800, 'clay' => 8600, 'iron' => 10500, 'crop' => 5000, 'time' => 52800), array('wood' => 7400, 'clay' => 9300, 'iron' => 11000, 'crop' => 5400, 'time' => 56320), array('wood' => 7900, 'clay' => 10000, 'iron' => 12000, 'crop' => 5900, 'time' => 59840), array('wood' => 8500, 'clay' => 11000, 'iron' => 13000, 'crop' => 6300,
'time' => 63360), array('wood' => 9100, 'clay' => 11500, 'iron' => 14000, 'crop' => 6700, 'time' => 66880), array('wood' => 9700, 'clay' => 12500, 'iron' => 15000, 'crop' => 7200, 'time' => 70400), array('wood' => 10500, 'clay' => 13000, 'iron' => 15500, 'crop' => 7600, 'time' => 73920), array('wood' => 11000, 'clay' => 14000, 'iron' => 16500, 'crop' => 8100, 'time' => 77440), array('wood' => 11500, 'clay' => 14500, 'iron' => 17500, 'crop' => 8600, 'time' => 80960), array('wood' => 12000, 'clay' => 15500, 'iron' => 18500,
'crop' => 9000, 'time' => 84480), array('wood' => 13000, 'clay' => 16000, 'iron' => 19500, 'crop' => 9500, 'time' => 88000), array('wood' => 13500, 'clay' => 17000, 'iron' => 20500, 'crop' => 10000, 'time' => 91520), array('wood' => 14000, 'clay' => 18000, 'iron' => 21500, 'crop' => 10500, 'time' => 95040), array('wood' => 15000, 'clay' => 18500, 'iron' => 22500, 'crop' => 11000, 'time' => 98560), array('wood' => 15500, 'clay' => 19500, 'iron' => 23500, 'crop' => 11500, 'time' => 102080), array('wood' => 16000, 'clay' =>
20500, 'iron' => 24500, 'crop' => 12000, 'time' => 105600), array('wood' => 17000, 'clay' => 21000, 'iron' => 25500, 'crop' => 12500, 'time' => 109120), array('wood' => 17500, 'clay' => 22000, 'iron' => 26500, 'crop' => 13000, 'time' => 112640), array('wood' => 18000, 'clay' => 23000, 'iron' => 27500, 'crop' => 13500, 'time' => 116160), array('wood' => 19000, 'clay' => 24000, 'iron' => 28500, 'crop' => 14000, 'time' => 119680), array('wood' => 19500, 'clay' => 24500, 'iron' => 30000, 'crop' => 14500, 'time' => 123200),
array('wood' => 20500, 'clay' => 25500, 'iron' => 31000, 'crop' => 15000, 'time' => 126270), array('wood' => 21000, 'clay' => 26500, 'iron' => 32000, 'crop' => 15500, 'time' => 130240), array('wood' => 21500, 'clay' => 27500, 'iron' => 33000, 'crop' => 16000, 'time' => 133760), array('wood' => 22500, 'clay' => 28500, 'iron' => 34000, 'crop' => 16500, 'time' => 137280), array('wood' => 23000, 'clay' => 29000, 'iron' => 35000, 'crop' => 17000, 'time' => 140800), array('wood' => 24000, 'clay' => 30000, 'iron' => 36500, 'crop' =>
17500, 'time' => 144320), array('wood' => 24500, 'clay' => 31000, 'iron' => 37500, 'crop' => 18000, 'time' => 147840), array('wood' => 25500, 'clay' => 32000, 'iron' => 38500, 'crop' => 18500, 'time' => 151360), array('wood' => 26000, 'clay' => 33000, 'iron' => 39500, 'crop' => 19500, 'time' => 154880), array('wood' => 27000, 'clay' => 34000, 'iron' => 41000, 'crop' => 20000, 'time' => 158400), array('wood' => 27500, 'clay' => 34500, 'iron' => 42000, 'crop' => 20500, 'time' => 161920), array('wood' => 28500, 'clay' => 35500,
'iron' => 43000, 'crop' => 21000, 'time' => 165440), array('wood' => 29000, 'clay' => 36500, 'iron' => 44000, 'crop' => 21500, 'time' => 168960), array('wood' => 30000, 'clay' => 37500, 'iron' => 45500, 'crop' => 22000, 'time' => 172480), array('wood' => 30500, 'clay' => 38500, 'iron' => 46500, 'crop' => 22500, 'time' => 176000), array('wood' => 31500, 'clay' => 39500, 'iron' => 47500, 'crop' => 23000, 'time' => 179520), array('wood' => 32000, 'clay' => 40500, 'iron' => 49000, 'crop' => 23500, 'time' => 183040), array('wood' =>
33000, 'clay' => 41500, 'iron' => 50000, 'crop' => 24500, 'time' => 186560), array('wood' => 33500, 'clay' => 42500, 'iron' => 51000, 'crop' => 25000, 'time' => 190080), array('wood' => 34500, 'clay' => 43500, 'iron' => 52500, 'crop' => 25500, 'time' => 193600), array('wood' => 35000, 'clay' => 44500, 'iron' => 53500, 'crop' => 26000, 'time' => 197120), array('wood' => 36000, 'clay' => 45500, 'iron' => 55000, 'crop' => 26500, 'time' => 200640), array('wood' => 37000, 'clay' => 46500, 'iron' => 56000, 'crop' => 27000, 'time' =>
204160), array('wood' => 37500, 'clay' => 47500, 'iron' => 57000, 'crop' => 28000, 'time' => 207680), array('wood' => 38500, 'clay' => 48500, 'iron' => 58500, 'crop' => 28500, 'time' => 211200), array('wood' => 39000, 'clay' => 49500, 'iron' => 59500, 'crop' => 29000, 'time' => 214720));
$h3_full = array(array('wood' => 300, 'clay' => 320, 'iron' => 420, 'crop' => 160, 'time' => 3840), array('wood' => 780, 'clay' => 830, 'iron' => 1100, 'crop' => 450, 'time' => 7680), array('wood' => 1300, 'clay' => 1400, 'iron' => 1800, 'crop' => 750, 'time' => 11520), array('wood' => 1900, 'clay' => 2000, 'iron' => 2500, 'crop' => 1100, 'time' => 15360), array('wood' => 2500, 'clay' => 2600, 'iron' => 3400, 'crop' => 1400, 'time' => 19200), array('wood' => 3100, 'clay' => 3300, 'iron' => 4200, 'crop' => 1800, 'time' => 23040),
array('wood' => 3800, 'clay' => 4000, 'iron' => 5100, 'crop' => 2200, 'time' => 26880), array('wood' => 4400, 'clay' => 4700, 'iron' => 6100, 'crop' => 2600, 'time' => 30720), array('wood' => 5100, 'clay' => 5500, 'iron' => 7000, 'crop' => 3000, 'time' => 34560), array('wood' => 5900, 'clay' => 6200, 'iron' => 8000, 'crop' => 3400, 'time' => 38400), array('wood' => 6600, 'clay' => 7000, 'iron' => 9000, 'crop' => 3800, 'time' => 42240), array('wood' => 7400, 'clay' => 7800, 'iron' => 10000, 'crop' => 4200, 'time' => 46080),
array('wood' => 8100, 'clay' => 8600, 'iron' => 11000, 'crop' => 4700, 'time' => 49920), array('wood' => 8900, 'clay' => 9500, 'iron' => 12000, 'crop' => 5100, 'time' => 53760), array('wood' => 9700, 'clay' => 10500, 'iron' => 13500, 'crop' => 5600, 'time' => 57600), array('wood' => 10500, 'clay' => 11000, 'iron' => 14500, 'crop' => 6100, 'time' => 61440), array('wood' => 11500, 'clay' => 12000, 'iron' => 15500, 'crop' => 6600, 'time' => 65280), array('wood' => 12000, 'clay' => 13000, 'iron' => 16500, 'crop' => 7000, 'time' =>
69120), array('wood' => 13000, 'clay' => 14000, 'iron' => 18000, 'crop' => 7500, 'time' => 72960), array('wood' => 14000, 'clay' => 15000, 'iron' => 19000, 'crop' => 8000, 'time' => 76800), array('wood' => 15000, 'clay' => 15500, 'iron' => 20000, 'crop' => 8500, 'time' => 80640), array('wood' => 15500, 'clay' => 16500, 'iron' => 21500, 'crop' => 9100, 'time' => 84480), array('wood' => 16500, 'clay' => 17500, 'iron' => 22500, 'crop' => 9600, 'time' => 88320), array('wood' => 17500, 'clay' => 18500, 'iron' => 24000, 'crop' => 10000,
'time' => 92160), array('wood' => 18500, 'clay' => 19500, 'iron' => 25000, 'crop' => 10500, 'time' => 96000), array('wood' => 19500, 'clay' => 20500, 'iron' => 26500, 'crop' => 11000, 'time' => 99840), array('wood' => 20500, 'clay' => 21500, 'iron' => 27500, 'crop' => 11500, 'time' => 103680), array('wood' => 21500, 'clay' => 22500, 'iron' => 29000, 'crop' => 12000, 'time' => 107520), array('wood' => 22000, 'clay' => 23500, 'iron' => 30500, 'crop' => 13000, 'time' => 111360), array('wood' => 23000, 'clay' => 24500, 'iron' => 31500,
'crop' => 13500, 'time' => 115200), array('wood' => 24000, 'clay' => 25500, 'iron' => 33000, 'crop' => 14000, 'time' => 119040), array('wood' => 25000, 'clay' => 26500, 'iron' => 34000, 'crop' => 14500, 'time' => 122880), array('wood' => 26000, 'clay' => 27500, 'iron' => 35500, 'crop' => 15000, 'time' => 126720), array('wood' => 27000, 'clay' => 28500, 'iron' => 37000, 'crop' => 15500, 'time' => 130560), array('wood' => 28000, 'clay' => 30000, 'iron' => 38500, 'crop' => 16000, 'time' => 134400), array('wood' => 29000, 'clay' => 31000,
'iron' => 39500, 'crop' => 17000, 'time' => 138240), array('wood' => 30000, 'clay' => 32000, 'iron' => 41000, 'crop' => 17500, 'time' => 142080), array('wood' => 31000, 'clay' => 33000, 'iron' => 42500, 'crop' => 18000, 'time' => 145920), array('wood' => 32000, 'clay' => 34000, 'iron' => 44000, 'crop' => 18500, 'time' => 149760), array('wood' => 33000, 'clay' => 35000, 'iron' => 45500, 'crop' => 19000, 'time' => 153600), array('wood' => 34000, 'clay' => 36500, 'iron' => 46500, 'crop' => 19500, 'time' => 157440), array('wood' => 35500,
'clay' => 37500, 'iron' => 48000, 'crop' => 20500, 'time' => 161280), array('wood' => 36500, 'clay' => 38500, 'iron' => 49500, 'crop' => 21000, 'time' => 165120), array('wood' => 37500, 'clay' => 39500, 'iron' => 51000, 'crop' => 21500, 'time' => 168960), array('wood' => 38500, 'clay' => 41000, 'iron' => 52500, 'crop' => 22000, 'time' => 172800), array('wood' => 39500, 'clay' => 42000, 'iron' => 54000, 'crop' => 23000, 'time' => 176640), array('wood' => 40500, 'clay' => 43000, 'iron' => 55000, 'crop' => 23500, 'time' => 180480),
array('wood' => 41500, 'clay' => 44000, 'iron' => 57000, 'crop' => 24000, 'time' => 184320), array('wood' => 43000, 'clay' => 45500, 'iron' => 58500, 'crop' => 24500, 'time' => 188160), array('wood' => 44000, 'clay' => 46500, 'iron' => 60000, 'crop' => 25500, 'time' => 192000), array('wood' => 45000, 'clay' => 47500, 'iron' => 61500, 'crop' => 26000, 'time' => 195840), array('wood' => 46000, 'clay' => 49000, 'iron' => 63000, 'crop' => 26500, 'time' => 199680), array('wood' => 47000, 'clay' => 50000, 'iron' => 64500, 'crop' => 27000,
'time' => 203520), array('wood' => 48500, 'clay' => 51000, 'iron' => 66000, 'crop' => 28000, 'time' => 207360), array('wood' => 49500, 'clay' => 52500, 'iron' => 67500, 'crop' => 28500, 'time' => 211200), array('wood' => 50500, 'clay' => 53500, 'iron' => 69000, 'crop' => 29000, 'time' => 215040), array('wood' => 51500, 'clay' => 55000, 'iron' => 70500, 'crop' => 30000, 'time' => 218880), array('wood' => 53000, 'clay' => 56000, 'iron' => 72000, 'crop' => 30500, 'time' => 222720), array('wood' => 54000, 'clay' => 57000, 'iron' => 73500,
'crop' => 31000, 'time' => 226560), array('wood' => 55000, 'clay' => 58500, 'iron' => 75000, 'crop' => 31500, 'time' => 230400), array('wood' => 56500, 'clay' => 59500, 'iron' => 76500, 'crop' => 32500, 'time' => 234240));
$h5_full = array(array('wood' => 1100, 'clay' => 880, 'iron' => 640, 'crop' => 200, 'time' => 5280), array('wood' => 2700, 'clay' => 2200, 'iron' => 1600, 'crop' => 550, 'time' => 10560), array('wood' => 4500, 'clay' => 3600, 'iron' => 2600, 'crop' => 910, 'time' => 15840), array('wood' => 6400, 'clay' => 5100, 'iron' => 3800, 'crop' => 1300, 'time' => 21120), array('wood' => 8400, 'clay' => 6800, 'iron' => 5000, 'crop' => 1700, 'time' => 26400), array('wood' => 10500, 'clay' => 8500, 'iron' => 6300, 'crop' => 2200, 'time' => 31680),
array('wood' => 13000, 'clay' => 10500, 'iron' => 7600, 'crop' => 2600, 'time' => 36960), array('wood' => 15000, 'clay' => 12000, 'iron' => 9000, 'crop' => 3100, 'time' => 42240), array('wood' => 17500, 'clay' => 14000, 'iron' => 10500, 'crop' => 3600, 'time' => 47520), array('wood' => 20000, 'clay' => 16000, 'iron' => 12000, 'crop' => 4100, 'time' => 52800), array('wood' => 22500, 'clay' => 18000, 'iron' => 13500, 'crop' => 4600, 'time' => 58080), array('wood' => 25000, 'clay' => 20500, 'iron' => 15000, 'crop' => 5100, 'time' =>
63360), array('wood' => 28000, 'clay' => 22500, 'iron' => 16500, 'crop' => 5700, 'time' => 68640), array('wood' => 30500, 'clay' => 24500, 'iron' => 18000, 'crop' => 6200, 'time' => 73920), array('wood' => 33500, 'clay' => 27000, 'iron' => 20000, 'crop' => 6800, 'time' => 79200), array('wood' => 36000, 'clay' => 29000, 'iron' => 21500, 'crop' => 7400, 'time' => 84480), array('wood' => 39000, 'clay' => 31500, 'iron' => 23000, 'crop' => 7900, 'time' => 89760), array('wood' => 42000, 'clay' => 33500, 'iron' => 25000, 'crop' => 8500,
'time' => 95040), array('wood' => 45000, 'clay' => 36000, 'iron' => 26500, 'crop' => 9100, 'time' => 100320), array('wood' => 48000, 'clay' => 38500, 'iron' => 28500, 'crop' => 9700, 'time' => 105600), array('wood' => 51000, 'clay' => 41000, 'iron' => 30000, 'crop' => 10500, 'time' => 110880), array('wood' => 54000, 'clay' => 43500, 'iron' => 32000, 'crop' => 11000, 'time' => 116160), array('wood' => 57000, 'clay' => 46000, 'iron' => 33500, 'crop' => 11500, 'time' => 121440), array('wood' => 60000, 'clay' => 48500, 'iron' => 35500,
'crop' => 12000, 'time' => 126720), array('wood' => 63000, 'clay' => 51000, 'iron' => 37500, 'crop' => 13000, 'time' => 132000), array('wood' => 66500, 'clay' => 53500, 'iron' => 39500, 'crop' => 13500, 'time' => 137280), array('wood' => 69500, 'clay' => 56000, 'iron' => 41000, 'crop' => 14000, 'time' => 142560), array('wood' => 73000, 'clay' => 58500, 'iron' => 43000, 'crop' => 15000, 'time' => 147840), array('wood' => 76000, 'clay' => 61000, 'iron' => 45000, 'crop' => 15500, 'time' => 153120), array('wood' => 79500, 'clay' => 64000,
'iron' => 47000, 'crop' => 16000, 'time' => 158400), array('wood' => 82500, 'clay' => 66500, 'iron' => 49000, 'crop' => 17000, 'time' => 163680), array('wood' => 86000, 'clay' => 69500, 'iron' => 51000, 'crop' => 17500, 'time' => 168960), array('wood' => 89500, 'clay' => 72000, 'iron' => 53000, 'crop' => 18000, 'time' => 174240), array('wood' => 93000, 'clay' => 74500, 'iron' => 55000, 'crop' => 19000, 'time' => 179520), array('wood' => 96000, 'clay' => 77500, 'iron' => 57000, 'crop' => 19500, 'time' => 184800), array('wood' => 99500,
'clay' => 80000, 'iron' => 59000, 'crop' => 20500, 'time' => 190080), array('wood' => 103000, 'clay' => 83000, 'iron' => 61000, 'crop' => 21000, 'time' => 195360), array('wood' => 106500, 'clay' => 86000, 'iron' => 63000, 'crop' => 21500, 'time' => 200640), array('wood' => 110000, 'clay' => 88500, 'iron' => 65500, 'crop' => 22500, 'time' => 205920), array('wood' => 113500, 'clay' => 91500, 'iron' => 67500, 'crop' => 23000, 'time' => 211200), array('wood' => 117000, 'clay' => 94500, 'iron' => 69500, 'crop' => 24000, 'time' => 216480),
array('wood' => 121000, 'clay' => 97500, 'iron' => 75500, 'crop' => 24500, 'time' => 221760), array('wood' => 124500, 'clay' => 100000, 'iron' => 74000, 'crop' => 25500, 'time' => 227040), array('wood' => 128000, 'clay' => 103000, 'iron' => 76000, 'crop' => 26000, 'time' => 232320), array('wood' => 131500, 'clay' => 106000, 'iron' => 78000, 'crop' => 27000, 'time' => 237600), array('wood' => 135500, 'clay' => 109000, 'iron' => 80500, 'crop' => 27500, 'time' => 242800), array('wood' => 139000, 'clay' => 112000, 'iron' => 82500, 'crop' =>
28500, 'time' => 248160), array('wood' => 143000, 'clay' => 115000, 'iron' => 84500, 'crop' => 29000, 'time' => 253440), array('wood' => 146500, 'clay' => 118000, 'iron' => 87000, 'crop' => 30000, 'time' => 258720), array('wood' => 150000, 'clay' => 121000, 'iron' => 89000, 'crop' => 30500, 'time' => 264000), array('wood' => 154000, 'clay' => 124000, 'iron' => 91500, 'crop' => 31500, 'time' => 269280), array('wood' => 158000, 'clay' => 127000, 'iron' => 93500, 'crop' => 32000, 'time' => 274560), array('wood' => 161500, 'clay' => 130000,
'iron' => 96000, 'crop' => 33000, 'time' => 279840), array('wood' => 165500, 'clay' => 133000, 'iron' => 98000, 'crop' => 33500, 'time' => 285120), array('wood' => 169500, 'clay' => 136500, 'iron' => 100500, 'crop' => 34500, 'time' => 290400), array('wood' => 173000, 'clay' => 139500, 'iron' => 102500, 'crop' => 35000, 'time' => 295680), array('wood' => 177000, 'clay' => 142500, 'iron' => 105000, 'crop' => 36000, 'time' => 300960), array('wood' => 181000, 'clay' => 145500, 'iron' => 107000, 'crop' => 37000, 'time' => 306240), array('wood' =>
185000, 'clay' => 149000, 'iron' => 109500, 'crop' => 37500, 'time' => 311520), array('wood' => 188500, 'clay' => 152000, 'iron' => 112000, 'crop' => 38500, 'time' => 316800), array('wood' => 192500, 'clay' => 155000, 'iron' => 114000, 'crop' => 39000, 'time' => 322080));
$h6_full = array(array('wood' => 1100, 'clay' => 1300, 'iron' => 1600, 'crop' => 360, 'time' => 7040), array('wood' => 2700, 'clay' => 3100, 'iron' => 3900, 'crop' => 930, 'time' => 14080), array('wood' => 4500, 'clay' => 5200, 'iron' => 6400, 'crop' => 1500, 'time' => 21120), array('wood' => 6400, 'clay' => 7400, 'iron' => 9200, 'crop' => 2200, 'time' => 28160), array('wood' => 8400, 'clay' => 9800, 'iron' => 12000, 'crop' => 2900, 'time' => 35200), array('wood' => 10500, 'clay' => 12500, 'iron' => 15500, 'crop' => 3700, 'time' => 42240),
array('wood' => 13000, 'clay' => 15000, 'iron' => 18500, 'crop' => 4400, 'time' => 49280), array('wood' => 15000, 'clay' => 17500, 'iron' => 22000, 'crop' => 5200, 'time' => 56320), array('wood' => 17500, 'clay' => 20500, 'iron' => 25500, 'crop' => 6100, 'time' => 63360), array('wood' => 20000, 'clay' => 23500, 'iron' => 29000, 'crop' => 6900, 'time' => 70400), array('wood' => 22500, 'clay' => 26000, 'iron' => 32500, 'crop' => 7800, 'time' => 77440), array('wood' => 25000, 'clay' => 29500, 'iron' => 36500, 'crop' => 8700, 'time' => 84480),
array('wood' => 28000, 'clay' => 32500, 'iron' => 40000, 'crop' => 9600, 'time' => 91520), array('wood' => 30500, 'clay' => 35500, 'iron' => 44000, 'crop' => 10500, 'time' => 98560), array('wood' => 33500, 'clay' => 38500, 'iron' => 48000, 'crop' => 11500, 'time' => 105600), array('wood' => 36000, 'clay' => 42000, 'iron' => 52000, 'crop' => 12500, 'time' => 112640), array('wood' => 39000, 'clay' => 45000, 'iron' => 56500, 'crop' => 13500, 'time' => 119680), array('wood' => 42000, 'clay' => 48500, 'iron' => 60500, 'crop' => 14500, 'time' =>
126720), array('wood' => 45000, 'clay' => 52000, 'iron' => 64500, 'crop' => 15500, 'time' => 133760), array('wood' => 48000, 'clay' => 55500, 'iron' => 69000, 'crop' => 16500, 'time' => 140800), array('wood' => 51000, 'clay' => 59000, 'iron' => 73500, 'crop' => 17500, 'time' => 147840), array('wood' => 54000, 'clay' => 62500, 'iron' => 77500, 'crop' => 18500, 'time' => 154880), array('wood' => 57000, 'clay' => 66000, 'iron' => 82000, 'crop' => 19500, 'time' => 161920), array('wood' => 60000, 'clay' => 69500, 'iron' => 86500, 'crop' => 20500,
'time' => 168960), array('wood' => 63000, 'clay' => 73000, 'iron' => 91000, 'crop' => 22000, 'time' => 176000), array('wood' => 66500, 'clay' => 77000, 'iron' => 95500, 'crop' => 23000, 'time' => 183040), array('wood' => 69500, 'clay' => 80500, 'iron' => 100500, 'crop' => 24000, 'time' => 190080), array('wood' => 73000, 'clay' => 84500, 'iron' => 105000, 'crop' => 25000, 'time' => 197120), array('wood' => 76000, 'clay' => 88000, 'iron' => 109500, 'crop' => 26000, 'time' => 204160), array('wood' => 79500, 'clay' => 92000, 'iron' => 114500,
'crop' => 27500, 'time' => 211200), array('wood' => 82500, 'clay' => 96000, 'iron' => 119000, 'crop' => 28500, 'time' => 218240), array('wood' => 86000, 'clay' => 99500, 'iron' => 124000, 'crop' => 29500, 'time' => 255280), array('wood' => 89500, 'clay' => 103500, 'iron' => 129000, 'crop' => 31000, 'time' => 232320), array('wood' => 93000, 'clay' => 107500, 'iron' => 134000, 'crop' => 32000, 'time' => 239360), array('wood' => 96000, 'clay' => 111500, 'iron' => 139000, 'crop' => 33000, 'time' => 246400), array('wood' => 99500, 'clay' => 115500,
'iron' => 143500, 'crop' => 34500, 'time' => 253440), array('wood' => 103000, 'clay' => 119500, 'iron' => 148500, 'crop' => 35500, 'time' => 260480), array('wood' => 106500, 'clay' => 123500, 'iron' => 154000, 'crop' => 37000, 'time' => 267520), array('wood' => 110000, 'clay' => 127500, 'iron' => 159000, 'crop' => 38000, 'time' => 274560), array('wood' => 113500, 'clay' => 132000, 'iron' => 164000, 'crop' => 39000, 'time' => 281600), array('wood' => 117000, 'clay' => 136000, 'iron' => 169000, 'crop' => 40500, 'time' => 288640), array('wood' =>
121000, 'clay' => 140000, 'iron' => 174500, 'crop' => 41500, 'time' => 295680), array('wood' => 124500, 'clay' => 144000, 'iron' => 179500, 'crop' => 43000, 'time' => 302720), array('wood' => 128000, 'clay' => 148500, 'iron' => 184500, 'crop' => 44000, 'time' => 309760), array('wood' => 131500, 'clay' => 152500, 'iron' => 190000, 'crop' => 45500, 'time' => 316800), array('wood' => 135500, 'clay' => 157000, 'iron' => 195500, 'crop' => 46500, 'time' => 323840), array('wood' => 139000, 'clay' => 161000, 'iron' => 200500, 'crop' => 48000, 'time' =>
330880), array('wood' => 143000, 'clay' => 165500, 'iron' => 206000, 'crop' => 49500, 'time' => 337920), array('wood' => 146500, 'clay' => 170000, 'iron' => 211500, 'crop' => 50500, 'time' => 344960), array('wood' => 150000, 'clay' => 174000, 'iron' => 216500, 'crop' => 52000, 'time' => 352000), array('wood' => 154000, 'clay' => 178500, 'iron' => 222000, 'crop' => 53000, 'time' => 359040), array('wood' => 46000, 'clay' => 183000, 'iron' => 227500, 'crop' => 54500, 'time' => 366080), array('wood' => 46000, 'clay' => 187500, 'iron' => 233000, 'crop'
=> 56000, 'time' => 373120), array('wood' => 166500, 'clay' => 192000, 'iron' => 238500, 'crop' => 57000, 'time' => 380160), array('wood' => 169500, 'clay' => 196000, 'iron' => 240000, 'crop' => 58500, 'time' => 387200), array('wood' => 173000, 'clay' => 200500, 'iron' => 240000, 'crop' => 59500, 'time' => 394240), array('wood' => 177000, 'clay' => 205000, 'iron' => 240000, 'crop' => 61000, 'time' => 401280), array('wood' => 181000, 'clay' => 209500, 'iron' => 240000, 'crop' => 62500, 'time' => 406970), array('wood' => 185000, 'clay' => 214000,
'iron' => 240000, 'crop' => 64000, 'time' => 415360), array('wood' => 188500, 'clay' => 219000, 'iron' => 240000, 'crop' => 65000, 'time' => 422400), array('wood' => 192500, 'clay' => 223500, 'iron' => 240000, 'crop' => 66500, 'time' => 429440));
//TEUTON UNITS
$h11_full = array(array('wood' => 190, 'clay' => 150, 'iron' => 80, 'crop' => 80, 'time' => 1440), array('wood' => 520, 'clay' => 430, 'iron' => 260, 'crop' => 260, 'time' => 2880), array('wood' => 870, 'clay' => 710, 'iron' => 430, 'crop' => 430, 'time' => 4320), array('wood' => 1200, 'clay' => 1000, 'iron' => 620, 'crop' => 620, 'time' => 5760), array('wood' => 1600, 'clay' => 1300, 'iron' => 820, 'crop' => 820, 'time' => 7200), array('wood' => 2100, 'clay' => 1700, 'iron' => 1000, 'crop' => 1000, 'time' => 8640), array('wood' => 2500, 'clay' =>
2000, 'iron' => 1300, 'crop' => 1300, 'time' => 10080), array('wood' => 3000, 'clay' => 2400, 'iron' => 1500, 'crop' => 1500, 'time' => 11520), array('wood' => 3400, 'clay' => 2800, 'iron' => 1700, 'crop' => 1700, 'time' => 12960), array('wood' => 3900, 'clay' => 3200, 'iron' => 2000, 'crop' => 2000, 'time' => 14400), array('wood' => 4400, 'clay' => 3600, 'iron' => 2200, 'crop' => 2200, 'time' => 15840), array('wood' => 4900, 'clay' => 4000, 'iron' => 2500, 'crop' => 2500, 'time' => 17280), array('wood' => 5400, 'clay' => 4400, 'iron' => 2700,
'crop' => 2700, 'time' => 18720), array('wood' => 6000, 'clay' => 4900, 'iron' => 3000, 'crop' => 3000, 'time' => 20160), array('wood' => 6500, 'clay' => 5300, 'iron' => 3200, 'crop' => 3200, 'time' => 21600), array('wood' => 7000, 'clay' => 5800, 'iron' => 3500, 'crop' => 3500, 'time' => 23040), array('wood' => 7600, 'clay' => 6200, 'iron' => 3800, 'crop' => 3800, 'time' => 24480), array('wood' => 8200, 'clay' => 6700, 'iron' => 4100, 'crop' => 4100, 'time' => 25920), array('wood' => 8700, 'clay' => 7100, 'iron' => 4400, 'crop' => 4400,
'time' => 27360), array('wood' => 9300, 'clay' => 7600, 'iron' => 4700, 'crop' => 4700, 'time' => 28800), array('wood' => 9900, 'clay' => 8100, 'iron' => 4900, 'crop' => 4900, 'time' => 30240), array('wood' => 10500, 'clay' => 8600, 'iron' => 5200, 'crop' => 5200, 'time' => 31680), array('wood' => 11000, 'clay' => 9100, 'iron' => 5500, 'crop' => 5500, 'time' => 33120), array('wood' => 11500, 'clay' => 9600, 'iron' => 5800, 'crop' => 5800, 'time' => 34560), array('wood' => 12500, 'clay' => 10000, 'iron' => 6100, 'crop' => 6100, 'time' => 36000),
array('wood' => 13000, 'clay' => 10500, 'iron' => 6500, 'crop' => 6500, 'time' => 37440), array('wood' => 13500, 'clay' => 11000, 'iron' => 6800, 'crop' => 6800, 'time' => 38880), array('wood' => 14000, 'clay' => 11500, 'iron' => 7100, 'crop' => 7100, 'time' => 40320), array('wood' => 15000, 'clay' => 12000, 'iron' => 7400, 'crop' => 7400, 'time' => 41760), array('wood' => 15500, 'clay' => 12500, 'iron' => 7700, 'crop' => 7700, 'time' => 43200), array('wood' => 16000, 'clay' => 13000, 'iron' => 8000, 'crop' => 8000, 'time' => 44640), array('wood'
=> 16500, 'clay' => 13500, 'iron' => 8400, 'crop' => 8400, 'time' => 46080), array('wood' => 17500, 'clay' => 14000, 'iron' => 8700, 'crop' => 8700, 'time' => 47520), array('wood' => 18000, 'clay' => 15000, 'iron' => 9000, 'crop' => 9000, 'time' => 48960), array('wood' => 18500, 'clay' => 15500, 'iron' => 9400, 'crop' => 9400, 'time' => 50400), array('wood' => 19500, 'clay' => 16000, 'iron' => 9700, 'crop' => 9700, 'time' => 51840), array('wood' => 20000, 'clay' => 16500, 'iron' => 10000, 'crop' => 10000, 'time' => 53280), array('wood' =>
21000, 'clay' => 17000, 'iron' => 10500, 'crop' => 10500, 'time' => 54720), array('wood' => 21500, 'clay' => 17500, 'iron' => 10500, 'crop' => 10500, 'time' => 56160), array('wood' => 22000, 'clay' => 18000, 'iron' => 11000, 'crop' => 11000, 'time' => 57600), array('wood' => 23000, 'clay' => 18500, 'iron' => 11500, 'crop' => 11500, 'time' => 59040), array('wood' => 23500, 'clay' => 19000, 'iron' => 12000, 'crop' => 12000, 'time' => 60480), array('wood' => 24000, 'clay' => 20000, 'iron' => 12000, 'crop' => 12000, 'time' => 61920), array('wood' =>
25000, 'clay' => 20500, 'iron' => 12500, 'crop' => 12500, 'time' => 63360), array('wood' => 25500, 'clay' => 21000, 'iron' => 13000, 'crop' => 13000, 'time' => 64800), array('wood' => 26500, 'clay' => 21500, 'iron' => 13000, 'crop' => 13000, 'time' => 66240), array('wood' => 27000, 'clay' => 22000, 'iron' => 13500, 'crop' => 13500, 'time' => 67680), array('wood' => 28000, 'clay' => 22500, 'iron' => 14000, 'crop' => 14000, 'time' => 69120), array('wood' => 28500, 'clay' => 23500, 'iron' => 14500, 'crop' => 14500, 'time' => 70560), array('wood' =>
29500, 'clay' => 24000, 'iron' => 14500, 'crop' => 14500, 'time' => 72000), array('wood' => 30000, 'clay' => 24500, 'iron' => 15000, 'crop' => 15000, 'time' => 73440), array('wood' => 30500, 'clay' => 25000, 'iron' => 15500, 'crop' => 15500, 'time' => 74880), array('wood' => 31500, 'clay' => 25500, 'iron' => 15500, 'crop' => 15500, 'time' => 76320), array('wood' => 32000, 'clay' => 26500, 'iron' => 16000, 'crop' => 16000, 'time' => 77760), array('wood' => 33000, 'clay' => 27000, 'iron' => 16500, 'crop' => 16500, 'time' => 79200), array('wood' =>
33500, 'clay' => 27500, 'iron' => 17000, 'crop' => 17000, 'time' => 80640), array('wood' => 34500, 'clay' => 28000, 'iron' => 17000, 'crop' => 17000, 'time' => 82080), array('wood' => 35000, 'clay' => 29000, 'iron' => 17500, 'crop' => 17500, 'time' => 83520), array('wood' => 36000, 'clay' => 29500, 'iron' => 18000, 'crop' => 18000, 'time' => 84960), array('wood' => 36500, 'clay' => 30000, 'iron' => 18500, 'crop' => 18500, 'time' => 86400), array('wood' => 37500, 'clay' => 30500, 'iron' => 19000, 'crop' => 19000, 'time' => 87840));
$h12_full = array(array('wood' => 290, 'clay' => 140, 'iron' => 170, 'crop' => 80, 'time' => 2240), array('wood' => 760, 'clay' => 400, 'iron' => 480, 'crop' => 260, 'time' => 4480), array('wood' => 1300, 'clay' => 670, 'iron' => 790, 'crop' => 430, 'time' => 6720), array('wood' => 1800, 'clay' => 960, 'iron' => 1100, 'crop' => 620, 'time' => 8960), array('wood' => 2400, 'clay' => 1300, 'iron' => 1500, 'crop' => 820, 'time' => 11200), array('wood' => 3000, 'clay' => 1600, 'iron' => 1900, 'crop' => 1000, 'time' => 13440), array('wood' => 3600,
'clay' => 1900, 'iron' => 2300, 'crop' => 1300, 'time' => 15680), array('wood' => 4300, 'clay' => 2300, 'iron' => 2700, 'crop' => 1500, 'time' => 17920), array('wood' => 5000, 'clay' => 2700, 'iron' => 3100, 'crop' => 1700, 'time' => 20160), array('wood' => 5700, 'clay' => 3000, 'iron' => 3600, 'crop' => 2000, 'time' => 22400), array('wood' => 6400, 'clay' => 3400, 'iron' => 4000, 'crop' => 2200, 'time' => 24640), array('wood' => 7100, 'clay' => 3800, 'iron' => 4500, 'crop' => 2500, 'time' => 26880), array('wood' => 7900, 'clay' => 4200,
'iron' => 4900, 'crop' => 2700, 'time' => 29120), array('wood' => 8700, 'clay' => 4600, 'iron' => 5400, 'crop' => 3000, 'time' => 31360), array('wood' => 9400, 'clay' => 5000, 'iron' => 5900, 'crop' => 3200, 'time' => 33600), array('wood' => 10000, 'clay' => 5400, 'iron' => 6400, 'crop' => 3500, 'time' => 35840), array('wood' => 11000, 'clay' => 5900, 'iron' => 6900, 'crop' => 3800, 'time' => 38080), array('wood' => 12000, 'clay' => 6300, 'iron' => 7400, 'crop' => 4100, 'time' => 40320), array('wood' => 12500, 'clay' => 6700, 'iron' => 7900,
'crop' => 4400, 'time' => 42560), array('wood' => 13500, 'clay' => 7200, 'iron' => 8500, 'crop' => 4700, 'time' => 44800), array('wood' => 14500, 'clay' => 7600, 'iron' => 9000, 'crop' => 4900, 'time' => 47040), array('wood' => 15000, 'clay' => 8100, 'iron' => 9500, 'crop' => 5200, 'time' => 49280), array('wood' => 16000, 'clay' => 8600, 'iron' => 10000, 'crop' => 5500, 'time' => 51520), array('wood' => 17000, 'clay' => 9000, 'iron' => 10500, 'crop' => 5800, 'time' => 53760), array('wood' => 18000, 'clay' => 9500, 'iron' => 11000, 'crop' => 6100,
'time' => 56000), array('wood' => 19000, 'clay' => 10000, 'iron' => 11500, 'crop' => 6500, 'time' => 58240), array('wood' => 19500, 'clay' => 10500, 'iron' => 12500, 'crop' => 6800, 'time' => 60480), array('wood' => 20500, 'clay' => 11000, 'iron' => 13000, 'crop' => 7100, 'time' => 62720), array('wood' => 21500, 'clay' => 11500, 'iron' => 13500, 'crop' => 7400, 'time' => 64960), array('wood' => 22500, 'clay' => 12000, 'iron' => 14000, 'crop' => 7700, 'time' => 67200), array('wood' => 23500, 'clay' => 12500, 'iron' => 14500, 'crop' => 8000,
'time' => 69440), array('wood' => 24500, 'clay' => 13000, 'iron' => 15000, 'crop' => 8400, 'time' => 71680), array('wood' => 25500, 'clay' => 13500, 'iron' => 16000, 'crop' => 8700, 'time' => 73920), array('wood' => 26500, 'clay' => 14000, 'iron' => 16500, 'crop' => 9000, 'time' => 76160), array('wood' => 27000, 'clay' => 14500, 'iron' => 17000, 'crop' => 9400, 'time' => 78400), array('wood' => 28000, 'clay' => 15000, 'iron' => 17500, 'crop' => 9700, 'time' => 80640), array('wood' => 29000, 'clay' => 15500, 'iron' => 18000, 'crop' => 10000,
'time' => 82880), array('wood' => 30000, 'clay' => 16000, 'iron' => 18500, 'crop' => 10500, 'time' => 85120), array('wood' => 31000, 'clay' => 16500, 'iron' => 19500, 'crop' => 10500, 'time' => 87360), array('wood' => 32000, 'clay' => 17000, 'iron' => 20000, 'crop' => 11000, 'time' => 89600), array('wood' => 33000, 'clay' => 17500, 'iron' => 20500, 'crop' => 11500, 'time' => 91840), array('wood' => 34000, 'clay' => 18000, 'iron' => 21500, 'crop' => 12000, 'time' => 94080), array('wood' => 35000, 'clay' => 18500, 'iron' => 22000, 'crop' => 12000,
'time' => 96320), array('wood' => 36500, 'clay' => 19500, 'iron' => 22500, 'crop' => 12500, 'time' => 98560), array('wood' => 37500, 'clay' => 20000, 'iron' => 23500, 'crop' => 13000, 'time' => 100800), array('wood' => 38500, 'clay' => 20500, 'iron' => 24000, 'crop' => 13000, 'time' => 103040), array('wood' => 39500, 'clay' => 21000, 'iron' => 24500, 'crop' => 13500, 'time' => 105280), array('wood' => 40500, 'clay' => 21500, 'iron' => 25500, 'crop' => 14000, 'time' => 107520), array('wood' => 41500, 'clay' => 22000, 'iron' => 26000, 'crop' =>
14500, 'time' => 109760), array('wood' => 42500, 'clay' => 22500, 'iron' => 26500, 'crop' => 14500, 'time' => 112000), array('wood' => 43500, 'clay' => 23000, 'iron' => 27500, 'crop' => 15000, 'time' => 114240), array('wood' => 44500, 'clay' => 23500, 'iron' => 28000, 'crop' => 15500, 'time' => 116480), array('wood' => 46000, 'clay' => 24500, 'iron' => 28500, 'crop' => 15500, 'time' => 118720), array('wood' => 47000, 'clay' => 25000, 'iron' => 29500, 'crop' => 16000, 'time' => 120960), array('wood' => 48000, 'clay' => 25500, 'iron' => 30000,
'crop' => 16500, 'time' => 123200), array('wood' => 49000, 'clay' => 26000, 'iron' => 30500, 'crop' => 17000, 'time' => 125440), array('wood' => 50000, 'clay' => 26500, 'iron' => 31500, 'crop' => 17000, 'time' => 127680), array('wood' => 51000, 'clay' => 27000, 'iron' => 32000, 'crop' => 17500, 'time' => 129920), array('wood' => 52500, 'clay' => 28000, 'iron' => 32500, 'crop' => 18000, 'time' => 132160), array('wood' => 53500, 'clay' => 28500, 'iron' => 33500, 'crop' => 18500, 'time' => 134400), array('wood' => 54500, 'clay' => 29000, 'iron' =>
34000, 'crop' => 19000, 'time' => 136640));
$h13_full = array(array('wood' => 260, 'clay' => 240, 'iron' => 340, 'crop' => 140, 'time' => 2400), array('wood' => 690, 'clay' => 640, 'iron' => 880, 'crop' => 400, 'time' => 4800), array('wood' => 1100, 'clay' => 1100, 'iron' => 1500, 'crop' => 670, 'time' => 7200), array('wood' => 1600, 'clay' => 1500, 'iron' => 2100, 'crop' => 960, 'time' => 9600), array('wood' => 2200, 'clay' => 2000, 'iron' => 2800, 'crop' => 1300, 'time' => 12000), array('wood' => 2700, 'clay' => 2500, 'iron' => 3500, 'crop' => 1600, 'time' => 14400), array('wood' => 3300,
'clay' => 3100, 'iron' => 4200, 'crop' => 1900, 'time' => 16800), array('wood' => 3900, 'clay' => 3600, 'iron' => 5000, 'crop' => 2300, 'time' => 19200), array('wood' => 4500, 'clay' => 4200, 'iron' => 5800, 'crop' => 2700, 'time' => 21600), array('wood' => 5200, 'clay' => 4800, 'iron' => 6600, 'crop' => 3000, 'time' => 24000), array('wood' => 5800, 'clay' => 5400, 'iron' => 7400, 'crop' => 3400, 'time' => 26400), array('wood' => 6500, 'clay' => 6000, 'iron' => 8300, 'crop' => 3800, 'time' => 28800), array('wood' => 7200, 'clay' => 6700, 'iron'
=> 9100, 'crop' => 4200, 'time' => 31200), array('wood' => 7900, 'clay' => 7300, 'iron' => 10000, 'crop' => 4600, 'time' => 33600), array('wood' => 8600, 'clay' => 8000, 'iron' => 11000, 'crop' => 5000, 'time' => 36000), array('wood' => 9300, 'clay' => 8600, 'iron' => 12000, 'crop' => 5400, 'time' => 38400), array('wood' => 10000, 'clay' => 9300, 'iron' => 13000, 'crop' => 5900, 'time' => 40800), array('wood' => 11000, 'clay' => 10000, 'iron' => 13500, 'crop' => 6300, 'time' => 43200), array('wood' => 11500, 'clay' => 10500, 'iron' => 14500,
'crop' => 6700, 'time' => 45600), array('wood' => 12500, 'clay' => 11500, 'iron' => 15500, 'crop' => 7200, 'time' => 48000), array('wood' => 13000, 'clay' => 12000, 'iron' => 16500, 'crop' => 7600, 'time' => 50400), array('wood' => 14000, 'clay' => 13000, 'iron' => 17500, 'crop' => 8100, 'time' => 52800), array('wood' => 14500, 'clay' => 13500, 'iron' => 18500, 'crop' => 8600, 'time' => 55200), array('wood' => 15500, 'clay' => 14500, 'iron' => 19500, 'crop' => 9000, 'time' => 57600), array('wood' => 16000, 'clay' => 15000, 'iron' => 20500,
'crop' => 9500, 'time' => 60000), array('wood' => 17000, 'clay' => 16000, 'iron' => 21500, 'crop' => 10000, 'time' => 62400), array('wood' => 18000, 'clay' => 16500, 'iron' => 23000, 'crop' => 10500, 'time' => 64800), array('wood' => 18500, 'clay' => 17500, 'iron' => 24000, 'crop' => 11000, 'time' => 67200), array('wood' => 19500, 'clay' => 18000, 'iron' => 25000, 'crop' => 11500, 'time' => 69600), array('wood' => 20500, 'clay' => 19000, 'iron' => 26000, 'crop' => 12000, 'time' => 72000), array('wood' => 21000, 'clay' => 19500, 'iron' => 27000,
'crop' => 12500, 'time' => 74400), array('wood' => 22000, 'clay' => 20500, 'iron' => 28000, 'crop' => 13000, 'time' => 76800), array('wood' => 23000, 'clay' => 21500, 'iron' => 29500, 'crop' => 13500, 'time' => 79200), array('wood' => 24000, 'clay' => 22000, 'iron' => 30500, 'crop' => 14000, 'time' => 81600), array('wood' => 24500, 'clay' => 23000, 'iron' => 31500, 'crop' => 14500, 'time' => 84000), array('wood' => 25500, 'clay' => 24000, 'iron' => 32500, 'crop' => 15000, 'time' => 86400), array('wood' => 26500, 'clay' => 24500, 'iron' => 34000,
'crop' => 15500, 'time' => 88800), array('wood' => 27500, 'clay' => 25500, 'iron' => 35000, 'crop' => 16000, 'time' => 91200), array('wood' => 28500, 'clay' => 26500, 'iron' => 36000, 'crop' => 16500, 'time' => 93600), array('wood' => 29000, 'clay' => 27000, 'iron' => 37000, 'crop' => 17000, 'time' => 96000), array('wood' => 30000, 'clay' => 28000, 'iron' => 38500, 'crop' => 17500, 'time' => 98400), array('wood' => 31000, 'clay' => 29000, 'iron' => 39500, 'crop' => 18000, 'time' => 100800), array('wood' => 32000, 'clay' => 29500, 'iron' =>
40500, 'crop' => 18500, 'time' => 103200), array('wood' => 33000, 'clay' => 30500, 'iron' => 42000, 'crop' => 19500, 'time' => 105600), array('wood' => 34000, 'clay' => 31500, 'iron' => 43000, 'crop' => 20000, 'time' => 108000), array('wood' => 34500, 'clay' => 32500, 'iron' => 44500, 'crop' => 20500, 'time' => 110400), array('wood' => 35500, 'clay' => 33000, 'iron' => 45500, 'crop' => 21000, 'time' => 112800), array('wood' => 36500, 'clay' => 34000, 'iron' => 46500, 'crop' => 21500, 'time' => 115200), array('wood' => 37500, 'clay' => 35000,
'iron' => 48000, 'crop' => 22000, 'time' => 117600), array('wood' => 38500, 'clay' => 36000, 'iron' => 49000, 'crop' => 22500, 'time' => 120000), array('wood' => 39500, 'clay' => 37000, 'iron' => 50500, 'crop' => 23000, 'time' => 122400), array('wood' => 40500, 'clay' => 37500, 'iron' => 51500, 'crop' => 23500, 'time' => 124800), array('wood' => 41500, 'clay' => 38500, 'iron' => 53000, 'crop' => 24500, 'time' => 127200), array('wood' => 42500, 'clay' => 39500, 'iron' => 54000, 'crop' => 25000, 'time' => 129600), array('wood' => 43500, 'clay' =>
40500, 'iron' => 55500, 'crop' => 25500, 'time' => 132000), array('wood' => 44500, 'clay' => 41500, 'iron' => 56500, 'crop' => 26000, 'time' => 134400), array('wood' => 45500, 'clay' => 42500, 'iron' => 58000, 'crop' => 26500, 'time' => 136800), array('wood' => 46500, 'clay' => 43000, 'iron' => 59000, 'crop' => 27000, 'time' => 139200), array('wood' => 47500, 'clay' => 44000, 'iron' => 60500, 'crop' => 28000, 'time' => 141600), array('wood' => 48500, 'clay' => 45000, 'iron' => 62000, 'crop' => 28500, 'time' => 144000), array('wood' => 49500,
'clay' => 46000, 'iron' => 63000, 'crop' => 29000, 'time' => 146400));
$h15_full = array(array('wood' => 740, 'clay' => 540, 'iron' => 580, 'crop' => 150, 'time' => 4800), array('wood' => 1800, 'clay' => 1400, 'iron' => 1500, 'crop' => 430, 'time' => 9600), array('wood' => 3000, 'clay' => 2300, 'iron' => 2400, 'crop' => 710, 'time' => 14400), array('wood' => 4400, 'clay' => 3200, 'iron' => 3500, 'crop' => 1000, 'time' => 19200), array('wood' => 5800, 'clay' => 4300, 'iron' => 4600, 'crop' => 1300, 'time' => 24000), array('wood' => 7200, 'clay' => 5400, 'iron' => 5700, 'crop' => 1700, 'time' => 28800), array('wood' =>
8800, 'clay' => 6500, 'iron' => 6900, 'crop' => 2000, 'time' => 33600), array('wood' => 10500, 'clay' => 7700, 'iron' => 8200, 'crop' => 2400, 'time' => 38400), array('wood' => 12000, 'clay' => 8900, 'iron' => 9500, 'crop' => 2800, 'time' => 43200), array('wood' => 13500, 'clay' => 10000, 'iron' => 11000, 'crop' => 3200, 'time' => 48000), array('wood' => 15500, 'clay' => 11500, 'iron' => 12000, 'crop' => 3600, 'time' => 52800), array('wood' => 17000, 'clay' => 12500, 'iron' => 13500, 'crop' => 4000, 'time' => 57600), array('wood' => 19000,
'clay' => 14000, 'iron' => 15000, 'crop' => 4400, 'time' => 62400), array('wood' => 21000, 'clay' => 15500, 'iron' => 16500, 'crop' => 4900, 'time' => 67200), array('wood' => 22500, 'clay' => 17000, 'iron' => 18000, 'crop' => 5300, 'time' => 72000), array('wood' => 24500, 'clay' => 18000, 'iron' => 19500, 'crop' => 5800, 'time' => 76800), array('wood' => 26500, 'clay' => 19500, 'iron' => 21000, 'crop' => 6200, 'time' => 81600), array('wood' => 28500, 'clay' => 21000, 'iron' => 22500, 'crop' => 6700, 'time' => 86400), array('wood' => 30500,
'clay' => 22500, 'iron' => 24000, 'crop' => 7100, 'time' => 91200), array('wood' => 32500, 'clay' => 24000, 'iron' => 26000, 'crop' => 7600, 'time' => 96000), array('wood' => 34500, 'clay' => 25500, 'iron' => 27500, 'crop' => 8100, 'time' => 100800), array('wood' => 36500, 'clay' => 27000, 'iron' => 29000, 'crop' => 8600, 'time' => 105600), array('wood' => 39000, 'clay' => 28500, 'iron' => 30500, 'crop' => 9100, 'time' => 110400), array('wood' => 41000, 'clay' => 30500, 'iron' => 32500, 'crop' => 9600, 'time' => 115200), array('wood' => 43000,
'clay' => 32000, 'iron' => 34000, 'crop' => 10000, 'time' => 120000), array('wood' => 45000, 'clay' => 33500, 'iron' => 36000, 'crop' => 10500, 'time' => 124800), array('wood' => 47500, 'clay' => 35000, 'iron' => 37500, 'crop' => 11000, 'time' => 129600), array('wood' => 49500, 'clay' => 36500, 'iron' => 39500, 'crop' => 11500, 'time' => 134400), array('wood' => 52000, 'clay' => 38500, 'iron' => 41000, 'crop' => 12000, 'time' => 139200), array('wood' => 54000, 'clay' => 40000, 'iron' => 43000, 'crop' => 12500, 'time' => 144000), array('wood' =>
56500, 'clay' => 41500, 'iron' => 44500, 'crop' => 13000, 'time' => 148800), array('wood' => 58500, 'clay' => 43500, 'iron' => 46500, 'crop' => 13500, 'time' => 153600), array('wood' => 61000, 'clay' => 45000, 'iron' => 48000, 'crop' => 14000, 'time' => 158400), array('wood' => 63000, 'clay' => 47000, 'iron' => 50000, 'crop' => 15000, 'time' => 163200), array('wood' => 65500, 'clay' => 48500, 'iron' => 52000, 'crop' => 15500, 'time' => 168000), array('wood' => 68000, 'clay' => 50500, 'iron' => 54000, 'crop' => 16000, 'time' => 172800),
array('wood' => 70500, 'clay' => 52000, 'iron' => 55500, 'crop' => 16500, 'time' => 177600), array('wood' => 72500, 'clay' => 54000, 'iron' => 57500, 'crop' => 17000, 'time' => 182400), array('wood' => 75000, 'clay' => 55500, 'iron' => 59500, 'crop' => 17500, 'time' => 187200), array('wood' => 77500, 'clay' => 57500, 'iron' => 61500, 'crop' => 18000, 'time' => 192000), array('wood' => 80000, 'clay' => 59000, 'iron' => 63500, 'crop' => 18500, 'time' => 196800), array('wood' => 82500, 'clay' => 61000, 'iron' => 65000, 'crop' => 19000, 'time' =>
201600), array('wood' => 85000, 'clay' => 63000, 'iron' => 67000, 'crop' => 20000, 'time' => 206400), array('wood' => 87500, 'clay' => 64500, 'iron' => 69000, 'crop' => 20500, 'time' => 211200), array('wood' => 89500, 'clay' => 66500, 'iron' => 71000, 'crop' => 21000, 'time' => 216000), array('wood' => 92000, 'clay' => 68500, 'iron' => 73000, 'crop' => 21500, 'time' => 220800), array('wood' => 95000, 'clay' => 70000, 'iron' => 75000, 'crop' => 22000, 'time' => 225600), array('wood' => 97500, 'clay' => 72000, 'iron' => 77000, 'crop' => 22500,
'time' => 230400), array('wood' => 100000, 'clay' => 74000, 'iron' => 79000, 'crop' => 23500, 'time' => 235200), array('wood' => 102500, 'clay' => 76000, 'iron' => 81000, 'crop' => 24000, 'time' => 240000), array('wood' => 105000, 'clay' => 77500, 'iron' => 83000, 'crop' => 24500, 'time' => 244800), array('wood' => 107500, 'clay' => 79500, 'iron' => 85000, 'crop' => 25000, 'time' => 249600), array('wood' => 110000, 'clay' => 81500, 'iron' => 87000, 'crop' => 25500, 'time' => 254400), array('wood' => 112500, 'clay' => 83500, 'iron' => 89500,
'crop' => 26500, 'time' => 259200), array('wood' => 115500, 'clay' => 85500, 'iron' => 91500, 'crop' => 27000, 'time' => 264000), array('wood' => 118000, 'clay' => 87500, 'iron' => 93500, 'crop' => 27500, 'time' => 268800), array('wood' => 120500, 'clay' => 89500, 'iron' => 95500, 'crop' => 28000, 'time' => 273600), array('wood' => 123000, 'clay' => 91000, 'iron' => 97500, 'crop' => 29000, 'time' => 278400), array('wood' => 126000, 'clay' => 93000, 'iron' => 99500, 'crop' => 29500, 'time' => 283200), array('wood' => 128500, 'clay' => 95000,
'iron' => 102000, 'crop' => 30000, 'time' => 288000), array('wood' => 131500, 'clay' => 97000, 'iron' => 104000, 'crop' => 30500, 'time' => 292800));
$h16_full = array(array('wood' => 900, 'clay' => 1000, 'iron' => 960, 'crop' => 160, 'time' => 5920), array('wood' => 2200, 'clay' => 2500, 'iron' => 2400, 'crop' => 450, 'time' => 11840), array('wood' => 3700, 'clay' => 4200, 'iron' => 3900, 'crop' => 750, 'time' => 17760), array('wood' => 5300, 'clay' => 6000, 'iron' => 5600, 'crop' => 1100, 'time' => 23680), array('wood' => 7000, 'clay' => 7900, 'iron' => 7400, 'crop' => 1400, 'time' => 29600), array('wood' => 8700, 'clay' => 10000, 'iron' => 9300, 'crop' => 1800, 'time' => 35520), array('wood' =>
10500, 'clay' => 12000, 'iron' => 11500, 'crop' => 2200, 'time' => 41440), array('wood' => 12500, 'clay' => 14500, 'iron' => 13500, 'crop' => 2600, 'time' => 47360), array('wood' => 14500, 'clay' => 16500, 'iron' => 15500, 'crop' => 3000, 'time' => 53280), array('wood' => 16500, 'clay' => 19000, 'iron' => 17500, 'crop' => 3400, 'time' => 59200), array('wood' => 18500, 'clay' => 21000, 'iron' => 20000, 'crop' => 3800, 'time' => 65120), array('wood' => 21000, 'clay' => 23500, 'iron' => 22000, 'crop' => 4200, 'time' => 71040), array('wood' => 23000,
'clay' => 26000, 'iron' => 24500, 'crop' => 4700, 'time' => 76960), array('wood' => 25000, 'clay' => 28500, 'iron' => 27000, 'crop' => 5100, 'time' => 82880), array('wood' => 27500, 'clay' => 31500, 'iron' => 29000, 'crop' => 5600, 'time' => 88800), array('wood' => 30000, 'clay' => 34000, 'iron' => 31500, 'crop' => 6100, 'time' => 94720), array('wood' => 32000, 'clay' => 36500, 'iron' => 34000, 'crop' => 6600, 'time' => 100640), array('wood' => 34500, 'clay' => 39500, 'iron' => 36500, 'crop' => 7000, 'time' => 106560), array('wood' => 37000,
'clay' => 42000, 'iron' => 39500, 'crop' => 7500, 'time' => 112480), array('wood' => 39500, 'clay' => 45000, 'iron' => 42000, 'crop' => 8000, 'time' => 118400), array('wood' => 42000, 'clay' => 47500, 'iron' => 44500, 'crop' => 8500, 'time' => 124320), array('wood' => 44500, 'clay' => 50500, 'iron' => 47000, 'crop' => 9100, 'time' => 130240), array('wood' => 47000, 'clay' => 53500, 'iron' => 50000, 'crop' => 9600, 'time' => 136160), array('wood' => 49500, 'clay' => 56500, 'iron' => 52500, 'crop' => 10000, 'time' => 142080), array('wood' => 52000,
'clay' => 59500, 'iron' => 55500, 'crop' => 10500, 'time' => 148000), array('wood' => 54500, 'clay' => 62000, 'iron' => 58000, 'crop' => 11000, 'time' => 153920), array('wood' => 57000, 'clay' => 65000, 'iron' => 61000, 'crop' => 11500, 'time' => 159840), array('wood' => 60000, 'clay' => 68500, 'iron' => 64000, 'crop' => 12000, 'time' => 165760), array('wood' => 62500, 'clay' => 71500, 'iron' => 66500, 'crop' => 13000, 'time' => 171680), array('wood' => 65500, 'clay' => 74500, 'iron' => 69500, 'crop' => 13500, 'time' => 177600), array('wood' =>
68000, 'clay' => 77500, 'iron' => 72500, 'crop' => 14000, 'time' => 183520), array('wood' => 71000, 'clay' => 80500, 'iron' => 75500, 'crop' => 14500, 'time' => 189440), array('wood' => 73500, 'clay' => 84000, 'iron' => 78500, 'crop' => 15000, 'time' => 195360), array('wood' => 76500, 'clay' => 87000, 'iron' => 81500, 'crop' => 15500, 'time' => 201280), array('wood' => 79000, 'clay' => 90000, 'iron' => 84500, 'crop' => 16000, 'time' => 207200), array('wood' => 82000, 'clay' => 93500, 'iron' => 87500, 'crop' => 17000, 'time' => 213120),
array('wood' => 85000, 'clay' => 96500, 'iron' => 90500, 'crop' => 17500, 'time' => 219040), array('wood' => 87500, 'clay' => 100000, 'iron' => 93500, 'crop' => 18000, 'time' => 224960), array('wood' => 90500, 'clay' => 103500, 'iron' => 96500, 'crop' => 18500, 'time' => 230880), array('wood' => 93500, 'clay' => 106500, 'iron' => 99500, 'crop' => 19000, 'time' => 236800), array('wood' => 96500, 'clay' => 110000, 'iron' => 102500, 'crop' => 19500, 'time' => 242720), array('wood' => 99500, 'clay' => 113500, 'iron' => 106000, 'crop' => 20500,
'time' => 248640), array('wood' => 102500, 'clay' => 116500, 'iron' => 109000, 'crop' => 21000, 'time' => 244560), array('wood' => 105500, 'clay' => 120000, 'iron' => 112000, 'crop' => 21500, 'time' => 260480), array('wood' => 108500, 'clay' => 123500, 'iron' => 115500, 'crop' => 22000, 'time' => 266400), array('wood' => 111500, 'clay' => 127000, 'iron' => 118500, 'crop' => 23000, 'time' => 272320), array('wood' => 114500, 'clay' => 130500, 'iron' => 122000, 'crop' => 23500, 'time' => 278240), array('wood' => 117500, 'clay' => 134000, 'iron' =>
125000, 'crop' => 24000, 'time' => 284160), array('wood' => 120500, 'clay' => 137500, 'iron' => 128500, 'crop' => 24500, 'time' => 290080), array('wood' => 123500, 'clay' => 141000, 'iron' => 131500, 'crop' => 25500, 'time' => 296000), array('wood' => 126500, 'clay' => 144500, 'iron' => 135000, 'crop' => 26000, 'time' => 301920), array('wood' => 130000, 'clay' => 148000, 'iron' => 138000, 'crop' => 26500, 'time' => 307840), array('wood' => 133000, 'clay' => 151500, 'iron' => 141500, 'crop' => 27000, 'time' => 313760), array('wood' => 136000,
'clay' => 155000, 'iron' => 145000, 'crop' => 28000, 'time' => 319680), array('wood' => 139500, 'clay' => 159000, 'iron' => 148500, 'crop' => 28500, 'time' => 325600), array('wood' => 142500, 'clay' => 162500, 'iron' => 151500, 'crop' => 29000, 'time' => 331520), array('wood' => 145500, 'clay' => 166000, 'iron' => 155000, 'crop' => 30000, 'time' => 337440), array('wood' => 149000, 'clay' => 169500, 'iron' => 158500, 'crop' => 30500, 'time' => 343360), array('wood' => 152000, 'clay' => 173500, 'iron' => 162000, 'crop' => 31000, 'time' => 349280),
array('wood' => 155500, 'clay' => 177000, 'iron' => 165500, 'crop' => 31500, 'time' => 355200), array('wood' => 158500, 'clay' => 180500, 'iron' => 169000, 'crop' => 32500, 'time' => 361120));
//GAUL UNITS
$h21_full = array(array('wood' => 200, 'clay' => 260, 'iron' => 110, 'clay' => 60, 'time' => 2080), array('wood' => 550, 'clay' => 690, 'iron' => 330, 'clay' => 210, 'time' => 4160), array('wood' => 910, 'clay' => 1100, 'iron' => 550, 'clay' => 360, 'time' => 6240), array('wood' => 1300, 'clay' => 1600, 'iron' => 790, 'clay' => 510, 'time' => 8320), array('wood' => 1700, 'clay' => 2200, 'iron' => 1000, 'clay' => 670, 'time' => 10400), array('wood' => 2200, 'clay' => 2700, 'iron' => 1300, 'clay' =>
850, 'time' => 12480), array('wood' => 2600, 'clay' => 3300, 'iron' => 1600, 'clay' => 1000, 'time' => 14560), array('wood' => 3100, 'clay' => 3900, 'iron' => 1900, 'clay' => 1200, 'time' => 16640), array('wood' => 3600, 'clay' => 4500, 'iron' => 2200, 'clay' => 1400, 'time' => 18720), array('wood' => 4100, 'clay' => 5200, 'iron' => 2500, 'clay' => 1600, 'time' => 20800), array('wood' => 4600, 'clay' => 5800, 'iron' => 2800, 'clay' => 1800, 'time' => 22880), array('wood' => 5100, 'clay' => 6500,
'iron' => 3100, 'clay' => 2000, 'time' => 24960), array('wood' => 5700, 'clay' => 7200, 'iron' => 3500, 'clay' => 2200, 'time' => 27040), array('wood' => 6200, 'clay' => 7900, 'iron' => 3800, 'clay' => 2400, 'time' => 29120), array('wood' => 6800, 'clay' => 8600, 'iron' => 4100, 'clay' => 2700, 'time' => 31200), array('wood' => 7400, 'clay' => 9300, 'iron' => 4500, 'clay' => 2900, 'time' => 33280), array('wood' => 7900, 'clay' => 10000, 'iron' => 4800, 'clay' => 3100, 'time' => 35360), array('wood' =>
8500, 'clay' => 11000, 'iron' => 5200, 'clay' => 3300, 'time' => 37440), array('wood' => 9100, 'clay' => 11500, 'iron' => 5600, 'clay' => 3600, 'time' => 39520), array('wood' => 9700, 'clay' => 12500, 'iron' => 5900, 'clay' => 3800, 'time' => 41600), array('wood' => 10500, 'clay' => 13000, 'iron' => 6300, 'clay' => 4000, 'time' => 43680), array('wood' => 11000, 'clay' => 14000, 'iron' => 6700, 'clay' => 4300, 'time' => 45760), array('wood' => 11500, 'clay' => 14500, 'iron' => 7100, 'clay' =>
4500, 'time' => 47840), array('wood' => 12000, 'clay' => 15500, 'iron' => 7400, 'clay' => 4800, 'time' => 49920), array('wood' => 13000, 'clay' => 16000, 'iron' => 7800, 'clay' => 5000, 'time' => 52000), array('wood' => 13500, 'clay' => 17000, 'iron' => 8200, 'clay' => 5300, 'time' => 54080), array('wood' => 14000, 'clay' => 18000, 'iron' => 8600, 'clay' => 5500, 'time' => 56160), array('wood' => 15000, 'clay' => 18500, 'iron' => 9000, 'clay' => 5800, 'time' => 58240), array('wood' => 15500,
'clay' => 19500, 'iron' => 9400, 'clay' => 6100, 'time' => 60320), array('wood' => 16000, 'clay' => 20500, 'iron' => 9800, 'clay' => 6300, 'time' => 62400), array('wood' => 17000, 'clay' => 21000, 'iron' => 10000, 'clay' => 6600, 'time' => 64480), array('wood' => 17500, 'clay' => 22000, 'iron' => 10500, 'clay' => 6800, 'time' => 66560), array('wood' => 18000, 'clay' => 23000, 'iron' => 11000, 'clay' => 7100, 'time' => 68640), array('wood' => 19000, 'clay' => 24000, 'iron' => 11500, 'clay' =>
7400, 'time' => 70720), array('wood' => 19500, 'clay' => 24500, 'iron' => 12000, 'clay' => 7700, 'time' => 72800), array('wood' => 20500, 'clay' => 25500, 'iron' => 12500, 'clay' => 7900, 'time' => 74880), array('wood' => 21000, 'clay' => 26500, 'iron' => 13000, 'clay' => 8200, 'time' => 76960), array('wood' => 21500, 'clay' => 27500, 'iron' => 13000, 'clay' => 8500, 'time' => 79040), array('wood' => 22500, 'clay' => 28500, 'iron' => 13500, 'clay' => 8800, 'time' => 81120), array('wood' => 23000,
'clay' => 29000, 'iron' => 14000, 'clay' => 9100, 'time' => 83200), array('wood' => 24000, 'clay' => 30000, 'iron' => 14500, 'clay' => 9300, 'time' => 85280), array('wood' => 24500, 'clay' => 31000, 'iron' => 15000, 'clay' => 9600, 'time' => 87360), array('wood' => 25500, 'clay' => 32000, 'iron' => 15500, 'clay' => 9900, 'time' => 89440), array('wood' => 26000, 'clay' => 33000, 'iron' => 16000, 'clay' => 10000, 'time' => 91520), array('wood' => 27000, 'clay' => 34000, 'iron' => 16500, 'clay' =>
10500, 'time' => 93600), array('wood' => 27500, 'clay' => 34500, 'iron' => 17000, 'clay' => 11000, 'time' => 95680), array('wood' => 28500, 'clay' => 35500, 'iron' => 17000, 'clay' => 11000, 'time' => 97760), array('wood' => 29000, 'clay' => 36500, 'iron' => 17500, 'clay' => 11500, 'time' => 99840), array('wood' => 30000, 'clay' => 37500, 'iron' => 18000, 'clay' => 11500, 'time' => 101920), array('wood' => 30500, 'clay' => 38500, 'iron' => 18500, 'clay' => 12000, 'time' => 104000), array('wood' =>
31500, 'clay' => 39500, 'iron' => 19000, 'clay' => 12500, 'time' => 106080), array('wood' => 32000, 'clay' => 40500, 'iron' => 19500, 'clay' => 12500, 'time' => 108160), array('wood' => 33000, 'clay' => 41500, 'iron' => 20000, 'clay' => 13000, 'time' => 110240), array('wood' => 33500, 'clay' => 42500, 'iron' => 20500, 'clay' => 13000, 'time' => 112320), array('wood' => 34500, 'clay' => 43500, 'iron' => 21000, 'clay' => 13500, 'time' => 114400), array('wood' => 35000, 'clay' => 44500, 'iron' =>
21500, 'clay' => 14000, 'time' => 116480), array('wood' => 36000, 'clay' => 45500, 'iron' => 22000, 'clay' => 14000, 'time' => 118560), array('wood' => 37000, 'clay' => 46500, 'iron' => 22500, 'clay' => 14500, 'time' => 120640), array('wood' => 37500, 'clay' => 47500, 'iron' => 23000, 'clay' => 14500, 'time' => 122720), array('wood' => 38500, 'clay' => 48500, 'iron' => 23500, 'clay' => 15000, 'time' => 124800), array('wood' => 39000, 'clay' => 49500, 'iron' => 24000, 'clay' => 15500, 'time' =>
126880));
$h22_full = array(array('wood' => 280, 'clay' => 300, 'iron' => 370, 'crop' => 120, 'time' => 2880), array('wood' => 740, 'clay' => 780, 'iron' => 950, 'crop' => 360, 'time' => 5760), array('wood' => 1200, 'clay' => 1300, 'iron' => 1600, 'crop' => 590, 'time' => 8640), array('wood' => 1800, 'clay' => 1900, 'iron' => 2300, 'crop' => 850, 'time' => 11520), array('wood' => 2300, 'clay' => 2500, 'iron' => 3000, 'crop' => 1100, 'time' => 14400), array('wood' => 2900, 'clay' => 3100, 'iron' => 3800,
'crop' => 1400, 'time' => 17280), array('wood' => 3500, 'clay' => 3800, 'iron' => 4600, 'crop' => 1700, 'time' => 20160), array('wood' => 4200, 'clay' => 4400, 'iron' => 5400, 'crop' => 2000, 'time' => 23040), array('wood' => 4800, 'clay' => 5100, 'iron' => 6200, 'crop' => 2300, 'time' => 25920), array('wood' => 5500, 'clay' => 5900, 'iron' => 7100, 'crop' => 2700, 'time' => 28800), array('wood' => 6200, 'clay' => 6600, 'iron' => 8000, 'crop' => 3000, 'time' => 31680), array('wood' => 6900,
'clay' => 7400, 'iron' => 8900, 'crop' => 3400, 'time' => 34560), array('wood' => 7700, 'clay' => 8100, 'iron' => 9900, 'crop' => 3700, 'time' => 37440), array('wood' => 8400, 'clay' => 8900, 'iron' => 11000, 'crop' => 4100, 'time' => 40320), array('wood' => 9200, 'clay' => 9700, 'iron' => 12000, 'crop' => 4400, 'time' => 43200), array('wood' => 9900, 'clay' => 10500, 'iron' => 13000, 'crop' => 4800, 'time' => 46080), array('wood' => 10500, 'clay' => 11500, 'iron' => 14000, 'crop' => 5200,
'time' => 48960), array('wood' => 11500, 'clay' => 12000, 'iron' => 15000, 'crop' => 5600, 'time' => 51840), array('wood' => 12500, 'clay' => 13000, 'iron' => 16000, 'crop' => 6000, 'time' => 54720), array('wood' => 13000, 'clay' => 14000, 'iron' => 17000, 'crop' => 6300, 'time' => 57600), array('wood' => 14000, 'clay' => 15000, 'iron' => 18000, 'crop' => 6700, 'time' => 60480), array('wood' => 15000, 'clay' => 15500, 'iron' => 19000, 'crop' => 7100, 'time' => 63360), array('wood' => 15500,
'clay' => 16500, 'iron' => 20000, 'crop' => 7600, 'time' => 66240), array('wood' => 16500, 'clay' => 17500, 'iron' => 21000, 'crop' => 8000, 'time' => 69120), array('wood' => 17500, 'clay' => 18500, 'iron' => 22500, 'crop' => 8400, 'time' => 72000), array('wood' => 18000, 'clay' => 19500, 'iron' => 23500, 'crop' => 8800, 'time' => 74880), array('wood' => 19000, 'clay' => 20500, 'iron' => 24500, 'crop' => 9200, 'time' => 77760), array('wood' => 20000, 'clay' => 21500, 'iron' => 26000, 'crop' =>
9700, 'time' => 80640), array('wood' => 21000, 'clay' => 22000, 'iron' => 27000, 'crop' => 10000, 'time' => 83520), array('wood' => 22000, 'clay' => 23000, 'iron' => 28000, 'crop' => 10500, 'time' => 86400), array('wood' => 22500, 'clay' => 24000, 'iron' => 29500, 'crop' => 11000, 'time' => 89280), array('wood' => 23500, 'clay' => 25000, 'iron' => 30500, 'crop' => 11500, 'time' => 92160), array('wood' => 24500, 'clay' => 26000, 'iron' => 31500, 'crop' => 12000, 'time' => 95040), array('wood' =>
25500, 'clay' => 27000, 'iron' => 33000, 'crop' => 12500, 'time' => 97920), array('wood' => 26500, 'clay' => 28000, 'iron' => 34000, 'crop' => 13000, 'time' => 100800), array('wood' => 27500, 'clay' => 29000, 'iron' => 35500, 'crop' => 13000, 'time' => 103680), array('wood' => 28500, 'clay' => 30000, 'iron' => 36500, 'crop' => 13500, 'time' => 106560), array('wood' => 29000, 'clay' => 31000, 'iron' => 37500, 'crop' => 14000, 'time' => 109440), array('wood' => 30000, 'clay' => 32000, 'iron' =>
39000, 'crop' => 14500, 'time' => 112320), array('wood' => 31000, 'clay' => 33000, 'iron' => 40000, 'crop' => 15000, 'time' => 115200), array('wood' => 32000, 'clay' => 34000, 'iron' => 41500, 'crop' => 15500, 'time' => 118080), array('wood' => 33000, 'clay' => 35500, 'iron' => 43000, 'crop' => 16000, 'time' => 120960), array('wood' => 34000, 'clay' => 36500, 'iron' => 44000, 'crop' => 16500, 'time' => 123840), array('wood' => 35000, 'clay' => 37500, 'iron' => 45500, 'crop' => 17000, 'time' =>
126720), array('wood' => 36000, 'clay' => 38500, 'iron' => 46500, 'crop' => 17500, 'time' => 129600), array('wood' => 37000, 'clay' => 39500, 'iron' => 48000, 'crop' => 18000, 'time' => 132480), array('wood' => 38000, 'clay' => 40500, 'iron' => 49000, 'crop' => 18500, 'time' => 135360), array('wood' => 39000, 'clay' => 41500, 'iron' => 50500, 'crop' => 19000, 'time' => 138240), array('wood' => 40000, 'clay' => 43000, 'iron' => 52000, 'crop' => 19500, 'time' => 141120), array('wood' => 41000,
'clay' => 44000, 'iron' => 53000, 'crop' => 20000, 'time' => 144000), array('wood' => 42000, 'clay' => 45000, 'iron' => 54500, 'crop' => 20500, 'time' => 146880), array('wood' => 43500, 'clay' => 46000, 'iron' => 56000, 'crop' => 21000, 'time' => 149760), array('wood' => 44500, 'clay' => 47000, 'iron' => 57000, 'crop' => 21500, 'time' => 152640), array('wood' => 45500, 'clay' => 48500, 'iron' => 58500, 'crop' => 22000, 'time' => 155520), array('wood' => 46500, 'clay' => 49500, 'iron' => 60000,
'crop' => 22500, 'time' => 158400), array('wood' => 47500, 'clay' => 50500, 'iron' => 61500, 'crop' => 23000, 'time' => 161280), array('wood' => 48500, 'clay' => 51500, 'iron' => 62500, 'crop' => 23500, 'time' => 164160), array('wood' => 49500, 'clay' => 53000, 'iron' => 64000, 'crop' => 24000, 'time' => 167040), array('wood' => 50500, 'clay' => 54000, 'iron' => 65500, 'crop' => 24500, 'time' => 169920), array('wood' => 52000, 'clay' => 55000, 'iron' => 67000, 'crop' => 25000, 'time' => 172800),
array('wood' => 53000, 'clay' => 56500, 'iron' => 68000, 'crop' => 25500, 'time' => 175680));
$h24_full = array(array('wood' => 700, 'clay' => 900, 'iron' => 460, 'crop' => 120, 'time' => 4960), array('wood' => 1700, 'clay' => 2200, 'iron' => 1200, 'crop' => 360, 'time' => 9920), array('wood' => 2900, 'clay' => 3700, 'iron' => 1900, 'crop' => 590, 'time' => 14880), array('wood' => 4100, 'clay' => 5300, 'iron' => 2800, 'crop' => 850, 'time' => 19840), array('wood' => 5500, 'clay' => 7000, 'iron' => 3700, 'crop' => 1100, 'time' => 24800), array('wood' => 6900, 'clay' => 8700, 'iron' =>
4600, 'crop' => 1400, 'time' => 29760), array('wood' => 8300, 'clay' => 10500, 'iron' => 5600, 'crop' => 1700, 'time' => 34720), array('wood' => 9800, 'clay' => 12500, 'iron' => 6600, 'crop' => 2000, 'time' => 39680), array('wood' => 11500, 'clay' => 14500, 'iron' => 7600, 'crop' => 2300, 'time' => 44640), array('wood' => 13000, 'clay' => 16500, 'iron' => 8700, 'crop' => 2700, 'time' => 49600), array('wood' => 14500, 'clay' => 18500, 'iron' => 9800, 'crop' => 3000, 'time' => 54560), array('wood' =>
16500, 'clay' => 21000, 'iron' => 11000, 'crop' => 3400, 'time' => 59520), array('wood' => 18000, 'clay' => 23000, 'iron' => 12000, 'crop' => 3700, 'time' => 64480), array('wood' => 20000, 'clay' => 25000, 'iron' => 13500, 'crop' => 4100, 'time' => 69440), array('wood' => 21500, 'clay' => 27500, 'iron' => 14500, 'crop' => 4400, 'time' => 74400), array('wood' => 23500, 'clay' => 30000, 'iron' => 15500, 'crop' => 4800, 'time' => 79360), array('wood' => 25000, 'clay' => 32000, 'iron' => 17000,
'crop' => 5200, 'time' => 84320), array('wood' => 27000, 'clay' => 34500, 'iron' => 18000, 'crop' => 5600, 'time' => 89280), array('wood' => 29000, 'clay' => 37000, 'iron' => 19500, 'crop' => 6000, 'time' => 94240), array('wood' => 31000, 'clay' => 39500, 'iron' => 20500, 'crop' => 6300, 'time' => 99200), array('wood' => 33000, 'clay' => 42000, 'iron' => 22000, 'crop' => 6700, 'time' => 104160), array('wood' => 35000, 'clay' => 44500, 'iron' => 23500, 'crop' => 7100, 'time' => 109120), array('wood' =>
37000, 'clay' => 47000, 'iron' => 24500, 'crop' => 7600, 'time' => 114080), array('wood' => 39000, 'clay' => 49500, 'iron' => 26000, 'crop' => 8000, 'time' => 119040), array('wood' => 41000, 'clay' => 52000, 'iron' => 27500, 'crop' => 8400, 'time' => 124000), array('wood' => 43000, 'clay' => 54500, 'iron' => 29000, 'crop' => 8800, 'time' => 128960), array('wood' => 45000, 'clay' => 57000, 'iron' => 30000, 'crop' => 9200, 'time' => 133920), array('wood' => 47000, 'clay' => 60000, 'iron' => 31500,
'crop' => 9700, 'time' => 138880), array('wood' => 49000, 'clay' => 62500, 'iron' => 33000, 'crop' => 10000, 'time' => 143840), array('wood' => 51500, 'clay' => 65500, 'iron' => 34500, 'crop' => 10500, 'time' => 148800), array('wood' => 53500, 'clay' => 68000, 'iron' => 36000, 'crop' => 11000, 'time' => 153760), array('wood' => 55500, 'clay' => 71000, 'iron' => 37500, 'crop' => 11500, 'time' => 158720), array('wood' => 57500, 'clay' => 73500, 'iron' => 39000, 'crop' => 12000, 'time' => 163680),
array('wood' => 60000, 'clay' => 76500, 'iron' => 40000, 'crop' => 12500, 'time' => 168640), array('wood' => 62000, 'clay' => 79000, 'iron' => 41500, 'crop' => 13000, 'time' => 173600), array('wood' => 64500, 'clay' => 82000, 'iron' => 43000, 'crop' => 13000, 'time' => 178560), array('wood' => 66500, 'clay' => 85000, 'iron' => 44500, 'crop' => 13500, 'time' => 183520), array('wood' => 69000, 'clay' => 87500, 'iron' => 46000, 'crop' => 14000, 'time' => 188480), array('wood' => 71000, 'clay' =>
90500, 'iron' => 48000, 'crop' => 14500, 'time' => 193440), array('wood' => 73500, 'clay' => 93500, 'iron' => 49500, 'crop' => 15000, 'time' => 198400), array('wood' => 75500, 'clay' => 96500, 'iron' => 51000, 'crop' => 15500, 'time' => 203360), array('wood' => 78000, 'clay' => 99500, 'iron' => 52500, 'crop' => 16000, 'time' => 208320), array('wood' => 80500, 'clay' => 102500, 'iron' => 54000, 'crop' => 16500, 'time' => 213280), array('wood' => 82500, 'clay' => 105500, 'iron' => 55500, 'crop' =>
17000, 'time' => 218240), array('wood' => 85000, 'clay' => 108500, 'iron' => 57000, 'crop' => 17500, 'time' => 223200), array('wood' => 87500, 'clay' => 111500, 'iron' => 58500, 'crop' => 18000, 'time' => 228160), array('wood' => 90000, 'clay' => 114500, 'iron' => 60500, 'crop' => 18500, 'time' => 233120), array('wood' => 92000, 'clay' => 117500, 'iron' => 62000, 'crop' => 19000, 'time' => 238080), array('wood' => 94500, 'clay' => 120500, 'iron' => 63500, 'crop' => 19500, 'time' => 243040),
array('wood' => 97000, 'clay' => 123500, 'iron' => 65000, 'crop' => 20000, 'time' => 248000), array('wood' => 99500, 'clay' => 126500, 'iron' => 67000, 'crop' => 20500, 'time' => 252960), array('wood' => 102000, 'clay' => 130000, 'iron' => 68500, 'crop' => 21000, 'time' => 257920), array('wood' => 104500, 'clay' => 133000, 'iron' => 70000, 'crop' => 21500, 'time' => 262880), array('wood' => 107000, 'clay' => 136000, 'iron' => 71500, 'crop' => 22000, 'time' => 267840), array('wood' => 109500,
'clay' => 139500, 'iron' => 73500, 'crop' => 22500, 'time' => 272800), array('wood' => 112000, 'clay' => 142500, 'iron' => 75000, 'crop' => 23000, 'time' => 277760), array('wood' => 114500, 'clay' => 145500, 'iron' => 76500, 'crop' => 23500, 'time' => 282720), array('wood' => 117000, 'clay' => 149000, 'iron' => 78500, 'crop' => 24000, 'time' => 287680), array('wood' => 119500, 'clay' => 152000, 'iron' => 80000, 'crop' => 24500, 'time' => 292640), array('wood' => 122000, 'clay' => 155500, 'iron' =>
82000, 'crop' => 25000, 'time' => 297600), array('wood' => 124500, 'clay' => 158500, 'iron' => 83500, 'crop' => 25500, 'time' => 302560));
$h25_full = array(array('wood' => 720, 'clay' => 660, 'iron' => 560, 'crop' => 240, 'time' => 5120), array('wood' => 1800, 'clay' => 1600, 'iron' => 1400, 'crop' => 640, 'time' => 10240), array('wood' => 3000, 'clay' => 2700, 'iron' => 2300, 'crop' => 1100, 'time' => 15360), array('wood' => 4200, 'clay' => 3900, 'iron' => 3300, 'crop' => 1500, 'time' => 20480), array('wood' => 5600, 'clay' => 5200, 'iron' => 4400, 'crop' => 2000, 'time' => 25600), array('wood' => 7000, 'clay' => 6500, 'iron' =>
5500, 'crop' => 2500, 'time' => 30720), array('wood' => 8500, 'clay' => 7900, 'iron' => 6700, 'crop' => 3100, 'time' => 35840), array('wood' => 10000, 'clay' => 9300, 'iron' => 7900, 'crop' => 3600, 'time' => 40960), array('wood' => 11500, 'clay' => 11000, 'iron' => 9200, 'crop' => 4200, 'time' => 46080), array('wood' => 13500, 'clay' => 12500, 'iron' => 10500, 'crop' => 4800, 'time' => 51200), array('wood' => 15000, 'clay' => 14000, 'iron' => 12000, 'crop' => 5400, 'time' => 56320), array('wood' =>
17000, 'clay' => 15500, 'iron' => 13000, 'crop' => 6000, 'time' => 61440), array('wood' => 18500, 'clay' => 17000, 'iron' => 14500, 'crop' => 6700, 'time' => 66560), array('wood' => 20500, 'clay' => 18500, 'iron' => 16000, 'crop' => 7300, 'time' => 71680), array('wood' => 22000, 'clay' => 20500, 'iron' => 17500, 'crop' => 8000, 'time' => 76800), array('wood' => 24000, 'clay' => 22000, 'iron' => 19000, 'crop' => 8600, 'time' => 81920), array('wood' => 26000, 'clay' => 24000, 'iron' => 20500,
'crop' => 9300, 'time' => 87040), array('wood' => 28000, 'clay' => 25500, 'iron' => 22000, 'crop' => 10000, 'time' => 92160), array('wood' => 30000, 'clay' => 27500, 'iron' => 23500, 'crop' => 10500, 'time' => 97280), array('wood' => 31500, 'clay' => 29000, 'iron' => 25000, 'crop' => 11500, 'time' => 102400), array('wood' => 33500, 'clay' => 31000, 'iron' => 26500, 'crop' => 12000, 'time' => 107520), array('wood' => 35500, 'clay' => 33000, 'iron' => 28000, 'crop' => 13000, 'time' => 112640),
array('wood' => 38000, 'clay' => 35000, 'iron' => 29500, 'crop' => 13500, 'time' => 117760), array('wood' => 40000, 'clay' => 36500, 'iron' => 31500, 'crop' => 14500, 'time' => 122880), array('wood' => 42000, 'clay' => 38500, 'iron' => 33000, 'crop' => 15000, 'time' => 128000), array('wood' => 44000, 'clay' => 40500, 'iron' => 34500, 'crop' => 16000, 'time' => 133120), array('wood' => 46000, 'clay' => 42500, 'iron' => 36500, 'crop' => 16500, 'time' => 138240), array('wood' => 48500, 'clay' =>
44500, 'iron' => 38000, 'crop' => 17500, 'time' => 143360), array('wood' => 50500, 'clay' => 46500, 'iron' => 39500, 'crop' => 18000, 'time' => 148480), array('wood' => 52500, 'clay' => 48500, 'iron' => 41500, 'crop' => 19000, 'time' => 153600), array('wood' => 55000, 'clay' => 50500, 'iron' => 43000, 'crop' => 19500, 'time' => 158720), array('wood' => 57000, 'clay' => 52500, 'iron' => 45000, 'crop' => 20500, 'time' => 163840), array('wood' => 59500, 'clay' => 54500, 'iron' => 46500, 'crop' =>
21500, 'time' => 168960), array('wood' => 61500, 'clay' => 56500, 'iron' => 48500, 'crop' => 22000, 'time' => 174080), array('wood' => 64000, 'clay' => 58500, 'iron' => 50000, 'crop' => 23000, 'time' => 179200), array('wood' => 66000, 'clay' => 61000, 'iron' => 52000, 'crop' => 24000, 'time' => 184320), array('wood' => 68500, 'clay' => 63000, 'iron' => 54000, 'crop' => 24500, 'time' => 189440), array('wood' => 71000, 'clay' => 65000, 'iron' => 55500, 'crop' => 25500, 'time' => 194560), array('wood' =>
73000, 'clay' => 67000, 'iron' => 57500, 'crop' => 26500, 'time' => 199680), array('wood' => 75500, 'clay' => 69500, 'iron' => 59500, 'crop' => 27000, 'time' => 204800), array('wood' => 78000, 'clay' => 71500, 'iron' => 61000, 'crop' => 28000, 'time' => 209920), array('wood' => 80000, 'clay' => 74000, 'iron' => 63000, 'crop' => 29000, 'time' => 215040), array('wood' => 82500, 'clay' => 76000, 'iron' => 65000, 'crop' => 29500, 'time' => 220160), array('wood' => 85000, 'clay' => 78000, 'iron' =>
67000, 'crop' => 30500, 'time' => 225280), array('wood' => 87500, 'clay' => 80500, 'iron' => 69000, 'crop' => 31500, 'time' => 230400), array('wood' => 90000, 'clay' => 82500, 'iron' => 70500, 'crop' => 32500, 'time' => 235520), array('wood' => 92500, 'clay' => 85000, 'iron' => 72500, 'crop' => 33000, 'time' => 240640), array('wood' => 95000, 'clay' => 87000, 'iron' => 74500, 'crop' => 34000, 'time' => 245760), array('wood' => 97000, 'clay' => 89500, 'iron' => 76500, 'crop' => 35000, 'time' =>
250880), array('wood' => 99500, 'clay' => 91500, 'iron' => 78500, 'crop' => 36000, 'time' => 256000), array('wood' => 102000, 'clay' => 94000, 'iron' => 80500, 'crop' => 37000, 'time' => 261120), array('wood' => 104500, 'clay' => 96500, 'iron' => 82500, 'crop' => 37500, 'time' => 266240), array('wood' => 107500, 'clay' => 98500, 'iron' => 84500, 'crop' => 38500, 'time' => 271360), array('wood' => 110000, 'clay' => 101000, 'iron' => 86500, 'crop' => 39500, 'time' => 276480), array('wood' =>
112500, 'clay' => 103500, 'iron' => 88500, 'crop' => 40500, 'time' => 281600), array('wood' => 115000, 'clay' => 105500, 'iron' => 90500, 'crop' => 41500, 'time' => 286720), array('wood' => 117500, 'clay' => 108000, 'iron' => 92500, 'crop' => 42500, 'time' => 291840), array('wood' => 120000, 'clay' => 110500, 'iron' => 94500, 'crop' => 43000, 'time' => 296960), array('wood' => 122500, 'clay' => 113000, 'iron' => 96500, 'crop' => 44000, 'time' => 302080), array('wood' => 125000, 'clay' => 115000,
'iron' => 98500, 'crop' => 45000, 'time' => 307200), array('wood' => 128000, 'clay' => 117500, 'iron' => 100500, 'crop' => 46000, 'time' => 312320));
$h26_full = array(array('wood' => 1000, 'clay' => 1200, 'iron' => 1400, 'crop' => 340, 'time' => 6240), array('wood' => 2400, 'clay' => 3000, 'iron' => 3300, 'crop' => 880, 'time' => 12480), array('wood' => 4100, 'clay' => 5000, 'iron' => 5400, 'crop' => 1500, 'time' => 18720), array('wood' => 5800, 'clay' => 7200, 'iron' => 7800, 'crop' => 2100, 'time' => 24960), array('wood' => 7700, 'clay' => 9500, 'iron' => 10500, 'crop' => 2800, 'time' => 31200), array('wood' => 9700, 'clay' => 12000,
'iron' => 13000, 'crop' => 3500, 'time' => 37440), array('wood' => 11500, 'clay' => 14500, 'iron' => 15500, 'crop' => 4200, 'time' => 43680), array('wood' => 14000, 'clay' => 17000, 'iron' => 18500, 'crop' => 5000, 'time' => 49920), array('wood' => 16000, 'clay' => 20000, 'iron' => 21500, 'crop' => 5800, 'time' => 56160), array('wood' => 18500, 'clay' => 22500, 'iron' => 24500, 'crop' => 6600, 'time' => 62400), array('wood' => 20500, 'clay' => 25500, 'iron' => 27500, 'crop' => 7400, 'time' =>
68640), array('wood' => 23000, 'clay' => 28500, 'iron' => 31000, 'crop' => 8300, 'time' => 74880), array('wood' => 25500, 'clay' => 31500, 'iron' => 34000, 'crop' => 9100, 'time' => 81120), array('wood' => 28000, 'clay' => 34500, 'iron' => 37500, 'crop' => 10000, 'time' => 87360), array('wood' => 30500, 'clay' => 37500, 'iron' => 40500, 'crop' => 11000, 'time' => 93600), array('wood' => 33000, 'clay' => 40500, 'iron' => 44000, 'crop' => 12000, 'time' => 99840), array('wood' => 35500, 'clay' =>
44000, 'iron' => 47500, 'crop' => 13000, 'time' => 106080), array('wood' => 38000, 'clay' => 47000, 'iron' => 51000, 'crop' => 13500, 'time' => 112320), array('wood' => 41000, 'clay' => 50500, 'iron' => 54500, 'crop' => 14500, 'time' => 118560), array('wood' => 43500, 'clay' => 53500, 'iron' => 58500, 'crop' => 15500, 'time' => 124800), array('wood' => 46500, 'clay' => 57000, 'iron' => 62000, 'crop' => 16500, 'time' => 131040), array('wood' => 49000, 'clay' => 60500, 'iron' => 66000, 'crop' =>
17500, 'time' => 137280), array('wood' => 52000, 'clay' => 64000, 'iron' => 69500, 'crop' => 18500, 'time' => 143520), array('wood' => 54500, 'clay' => 67500, 'iron' => 73500, 'crop' => 19500, 'time' => 149760), array('wood' => 57500, 'clay' => 71000, 'iron' => 77000, 'crop' => 20500, 'time' => 156000), array('wood' => 60500, 'clay' => 74500, 'iron' => 81000, 'crop' => 21500, 'time' => 162240), array('wood' => 63500, 'clay' => 78000, 'iron' => 85000, 'crop' => 23000, 'time' => 168480), array('wood' =>
66500, 'clay' => 82000, 'iron' => 89000, 'crop' => 24000, 'time' => 174720), array('wood' => 69500, 'clay' => 85500, 'iron' => 93000, 'crop' => 25000, 'time' => 180960), array('wood' => 72500, 'clay' => 89000, 'iron' => 97000, 'crop' => 26000, 'time' => 187200), array('wood' => 75500, 'clay' => 93000, 'iron' => 101000, 'crop' => 27000, 'time' => 193440), array('wood' => 78500, 'clay' => 96500, 'iron' => 105000, 'crop' => 28000, 'time' => 199680), array('wood' => 81500, 'clay' => 100500, 'iron' =>
109000, 'crop' => 29500, 'time' => 205920), array('wood' => 84500, 'clay' => 104500, 'iron' => 113500, 'crop' => 30500, 'time' => 212160), array('wood' => 87500, 'clay' => 108000, 'iron' => 117500, 'crop' => 31500, 'time' => 218400), array('wood' => 91000, 'clay' => 112000, 'iron' => 121500, 'crop' => 32500, 'time' => 224640), array('wood' => 94000, 'clay' => 116000, 'iron' => 126000, 'crop' => 34000, 'time' => 230880), array('wood' => 97000, 'clay' => 120000, 'iron' => 130000, 'crop' => 35000,
'time' => 237120), array('wood' => 100500, 'clay' => 124000, 'iron' => 134500, 'crop' => 36000, 'time' => 243360), array('wood' => 103500, 'clay' => 128000, 'iron' => 139000, 'crop' => 37000, 'time' => 249600), array('wood' => 107000, 'clay' => 132000, 'iron' => 143000, 'crop' => 38500, 'time' => 255840), array('wood' => 110000, 'clay' => 136000, 'iron' => 147500, 'crop' => 39500, 'time' => 262080), array('wood' => 113500, 'clay' => 140000, 'iron' => 152000, 'crop' => 40500, 'time' => 268320),
array('wood' => 116500, 'clay' => 144000, 'iron' => 156500, 'crop' => 42000, 'time' => 274560), array('wood' => 120000, 'clay' => 148000, 'iron' => 161000, 'crop' => 43000, 'time' => 280800), array('wood' => 123500, 'clay' => 152000, 'iron' => 165500, 'crop' => 44500, 'time' => 287040), array('wood' => 127000, 'clay' => 156500, 'iron' => 170000, 'crop' => 45500, 'time' => 293280), array('wood' => 130000, 'clay' => 160500, 'iron' => 174500, 'crop' => 46500, 'time' => 299520), array('wood' =>
133500, 'clay' => 164500, 'iron' => 179000, 'crop' => 48000, 'time' => 305760), array('wood' => 137000, 'clay' => 169000, 'iron' => 183500, 'crop' => 49000, 'time' => 312000), array('wood' => 140500, 'clay' => 173000, 'iron' => 188000, 'crop' => 50500, 'time' => 318240), array('wood' => 144000, 'clay' => 177500, 'iron' => 192500, 'crop' => 51500, 'time' => 324480), array('wood' => 147500, 'clay' => 181500, 'iron' => 197500, 'crop' => 53000, 'time' => 330720), array('wood' => 151000, 'clay' =>
186000, 'iron' => 202000, 'crop' => 54000, 'time' => 336960), array('wood' => 154500, 'clay' => 190000, 'iron' => 206500, 'crop' => 55500, 'time' => 343200), array('wood' => 158000, 'clay' => 194500, 'iron' => 211500, 'crop' => 56500, 'time' => 349440), array('wood' => 161500, 'clay' => 199000, 'iron' => 216000, 'crop' => 58000, 'time' => 355680), array('wood' => 165000, 'clay' => 203500, 'iron' => 221000, 'crop' => 59000, 'time' => 361920), array('wood' => 168500, 'clay' => 207500, 'iron' =>
225500, 'crop' => 60500, 'time' => 368160), array('wood' => 172000, 'clay' => 212000, 'iron' => 230500, 'crop' => 62000, 'time' => 374400), array('wood' => 175500, 'clay' => 216500, 'iron' => 235500, 'crop' => 63000, 'time' => 380640));
?>
+16
View File
@@ -0,0 +1,16 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename unitdata.php ##
## Developed by: Akakori ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
$getheroinfo = mysql_query("SELECT * FROM ".TB_PREFIX."hero WHERE `uid`='".$session->uid."'") or die(mysql_error());
$heroinfo = mysql_fetch_array($getheroinfo);
echo $heroinfo['attackpower'];
$hero=array('atk'=>40*$heroinfo['attackpower'],'di'=>35,'dc'=>50,'wood'=>120,'clay'=>100,'iron'=>150,'crop'=>30,'pop'=>6,'speed'=>6,'time'=>1600,'cap'=>0);
?>
+97
View File
@@ -0,0 +1,97 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename resdata.php ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
//Academy
$r2=array('wood'=>700,'clay'=>620,'iron'=>1480,'crop'=>580,'time'=>7080);
$r3=array('wood'=>1000,'clay'=>740,'iron'=>1880,'crop'=>640,'time'=>7560);
$r4=array('wood'=>940,'clay'=>740,'iron'=>360,'crop'=>400,'time'=>5880);
$r5=array('wood'=>3400,'clay'=>1860,'iron'=>2760,'crop'=>760,'time'=>9720);
$r6=array('wood'=>3400,'clay'=>2660,'iron'=>6600,'crop'=>1240,'time'=>12360);
$r7=array('wood'=>5500,'clay'=>1540,'iron'=>4200,'crop'=>580,'time'=>15600);
$r8=array('wood'=>5800,'clay'=>5500,'iron'=>5000,'crop'=>700,'time'=>28800);
$r9=array('wood'=>15880,'clay'=>13800,'iron'=>36400,'crop'=>22660,'time'=>24475);
$r12=array('wood'=>970,'clay'=>380,'iron'=>880,'crop'=>400,'time'=>5160);
$r13=array('wood'=>880,'clay'=>580,'iron'=>1560,'crop'=>580,'time'=>5400);
$r14=array('wood'=>1060,'clay'=>500,'iron'=>600,'crop'=>460,'time'=>5160);
$r15=array('wood'=>2320,'clay'=>1180,'iron'=>2520,'crop'=>610,'time'=>9000);
$r16=array('wood'=>2800,'clay'=>2160,'iron'=>4040,'crop'=>640,'time'=>10680);
$r17=array('wood'=>6100,'clay'=>1300,'iron'=>3000,'crop'=>580,'time'=>14400);
$r18=array('wood'=>5500,'clay'=>4900,'iron'=>5000,'crop'=>520,'time'=>28800);
$r19=array('wood'=>18250,'clay'=>13500,'iron'=>20400,'crop'=>16480,'time'=>19425);
$r22=array('wood'=>940,'clay'=>700,'iron'=>1680,'crop'=>520,'time'=>6120);
$r23=array('wood'=>1120,'clay'=>700,'iron'=>360,'crop'=>400,'time'=>5880);
$r24=array('wood'=>2200,'clay'=>1900,'iron'=>2040,'crop'=>520,'time'=>9240);
$r25=array('wood'=>2260,'clay'=>1420,'iron'=>2440,'crop'=>880,'time'=>9480);
$r26=array('wood'=>3100,'clay'=>2580,'iron'=>5600,'crop'=>1180,'time'=>11160);
$r27=array('wood'=>5800,'clay'=>2320,'iron'=>2840,'crop'=>610,'time'=>16800);
$r28=array('wood'=>5860,'clay'=>5900,'iron'=>5240,'crop'=>700,'time'=>28800);
$r29=array('wood'=>15880,'clay'=>22900,'iron'=>25200,'crop'=>22660,'time'=>24475);
$r32=array('wood'=>970,'clay'=>380,'iron'=>880,'crop'=>400,'time'=>5160);
$r33=array('wood'=>880,'clay'=>580,'iron'=>1560,'crop'=>580,'time'=>5400);
$r34=array('wood'=>1060,'clay'=>500,'iron'=>600,'crop'=>460,'time'=>5160);
$r35=array('wood'=>2320,'clay'=>1180,'iron'=>2520,'crop'=>610,'time'=>9000);
$r36=array('wood'=>2800,'clay'=>2160,'iron'=>4040,'crop'=>640,'time'=>10680);
$r37=array('wood'=>6100,'clay'=>1300,'iron'=>3000,'crop'=>580,'time'=>14400);
$r38=array('wood'=>5500,'clay'=>4900,'iron'=>5000,'crop'=>520,'time'=>28800);
$r39=array('wood'=>18250,'clay'=>13500,'iron'=>20400,'crop'=>16480,'time'=>19425);
$r42=array('wood'=>970,'clay'=>380,'iron'=>880,'crop'=>400,'time'=>5160);
$r43=array('wood'=>880,'clay'=>580,'iron'=>1560,'crop'=>580,'time'=>5400);
$r44=array('wood'=>1060,'clay'=>500,'iron'=>600,'crop'=>460,'time'=>5160);
$r45=array('wood'=>2320,'clay'=>1180,'iron'=>2520,'crop'=>610,'time'=>9000);
$r46=array('wood'=>2800,'clay'=>2160,'iron'=>4040,'crop'=>640,'time'=>10680);
$r47=array('wood'=>6100,'clay'=>1300,'iron'=>3000,'crop'=>580,'time'=>14400);
$r48=array('wood'=>5500,'clay'=>4900,'iron'=>5000,'crop'=>520,'time'=>28800);
$r49=array('wood'=>18250,'clay'=>13500,'iron'=>20400,'crop'=>16480,'time'=>19425);
//Armoury
//Blacksmith
$ab1=array(1=>array('wood'=>940,'clay'=>800,'iron'=>1250,'crop'=>370,'time'=>6600),array('wood'=>1635,'clay'=>1395,'iron'=>2175,'crop'=>645,'time'=>11491),array('wood'=>2265,'clay'=>1925,'iron'=>3010,'crop'=>890,'time'=>15894),array('wood'=>2850,'clay'=>2425,'iron'=>3790,'crop'=>1120,'time'=>20007),array('wood'=>3405,'clay'=>2900,'iron'=>4530,'crop'=>1340,'time'=>23918),array('wood'=>3940,'clay'=>3355,'iron'=>5240,'crop'=>1550,'time'=>27674),array('wood'=>4460,'clay'=>3795,'iron'=>5930,'crop'=>1755,'time'=>31306),array('wood'=>4960,'clay'=>4220,'iron'=>6600,'crop'=>1955,'time'=>34835),array('wood'=>5450,'clay'=>4640,'iron'=>7250,'crop'=>2145,'time'=>38277),array('wood'=>5930,'clay'=>5050,'iron'=>7885,'crop'=>2335,'time'=>41643),array('wood'=>6400,'clay'=>5450,'iron'=>8510,'crop'=>2520,'time'=>44943),array('wood'=>6860,'clay'=>5840,'iron'=>9125,'crop'=>2700,'time'=>48182),array('wood'=>7315,'clay'=>6225,'iron'=>9730,'crop'=>2880,'time'=>51369),array('wood'=>7765,'clay'=>6605,'iron'=>10325,'crop'=>3055,'time'=>54506),array('wood'=>8205,'clay'=>6980,'iron'=>10910,'crop'=>3230,'time'=>57599),array('wood'=>8640,'clay'=>7350,'iron'=>11485,'crop'=>3400,'time'=>60651),array('wood'=>9065,'clay'=>7715,'iron'=>12060,'crop'=>3570,'time'=>63665),array('wood'=>9490,'clay'=>8080,'iron'=>12620,'crop'=>3735,'time'=>66644),array('wood'=>9910,'clay'=>8435,'iron'=>13180,'crop'=>3900,'time'=>69590),array('wood'=>10325,'clay'=>8790,'iron'=>13730,'crop'=>4065,'time'=>72505));
$ab2=array(1=>array('wood'=>800,'clay'=>1010,'iron'=>1320,'crop'=>650,'time'=>7080),array('wood'=>1395,'clay'=>1760,'iron'=>2300,'crop'=>1130,'time'=>12327),array('wood'=>1925,'clay'=>2430,'iron'=>3180,'crop'=>1565,'time'=>17050),array('wood'=>2425,'clay'=>3060,'iron'=>4000,'crop'=>1970,'time'=>21463),array('wood'=>2900,'clay'=>3660,'iron'=>4785,'crop'=>2355,'time'=>25657),array('wood'=>3355,'clay'=>4235,'iron'=>5535,'crop'=>2725,'time'=>29686),array('wood'=>3795,'clay'=>4790,'iron'=>6260,'crop'=>3085,'time'=>33582),array('wood'=>4220,'clay'=>5330,'iron'=>6965,'crop'=>3430,'time'=>37368),array('wood'=>4640,'clay'=>5860,'iron'=>7655,'crop'=>3770,'time'=>41061),array('wood'=>5050,'clay'=>6375,'iron'=>8330,'crop'=>4100,'time'=>44672),array('wood'=>5450,'clay'=>6880,'iron'=>8990,'crop'=>4425,'time'=>48211),array('wood'=>5840,'clay'=>7375,'iron'=>9635,'crop'=>4745,'time'=>51687),array('wood'=>6225,'clay'=>7860,'iron'=>10275,'crop'=>5060,'time'=>55105),array('wood'=>6605,'clay'=>8340,'iron'=>10900,'crop'=>5370,'time'=>58470),array('wood'=>6980,'clay'=>8815,'iron'=>11520,'crop'=>5675,'time'=>61788),array('wood'=>7350,'clay'=>9280,'iron'=>12130,'crop'=>5975,'time'=>65062),array('wood'=>7715,'clay'=>9745,'iron'=>12735,'crop'=>6270,'time'=>68296),array('wood'=>8080,'clay'=>10200,'iron'=>13330,'crop'=>6565,'time'=>71491),array('wood'=>8435,'clay'=>10650,'iron'=>13920,'crop'=>6855,'time'=>74651),array('wood'=>8790,'clay'=>11095,'iron'=>14500,'crop'=>7140,'time'=>77778));
$ab3=array(1=>array('wood'=>1150,'clay'=>1220,'iron'=>1670,'crop'=>720,'time'=>7560),array('wood'=>2000,'clay'=>2125,'iron'=>2910,'crop'=>1255,'time'=>13163),array('wood'=>2770,'clay'=>2940,'iron'=>4020,'crop'=>1735,'time'=>18206),array('wood'=>3485,'clay'=>3700,'iron'=>5060,'crop'=>2185,'time'=>22918),array('wood'=>4165,'clay'=>4420,'iron'=>6050,'crop'=>2610,'time'=>27397),array('wood'=>4820,'clay'=>5115,'iron'=>7000,'crop'=>3020,'time'=>31699),array('wood'=>5455,'clay'=>5785,'iron'=>7920,'crop'=>3415,'time'=>35859),array('wood'=>6070,'clay'=>6440,'iron'=>8815,'crop'=>3800,'time'=>39902),array('wood'=>6670,'clay'=>7075,'iron'=>9685,'crop'=>4175,'time'=>43845),array('wood'=>7255,'clay'=>7700,'iron'=>10535,'crop'=>4545,'time'=>47700),array('wood'=>7830,'clay'=>8310,'iron'=>11370,'crop'=>4905,'time'=>51480),array('wood'=>8395,'clay'=>8905,'iron'=>12190,'crop'=>5255,'time'=>55191),array('wood'=>8950,'clay'=>9495,'iron'=>13000,'crop'=>5605,'time'=>58841),array('wood'=>9495,'clay'=>10075,'iron'=>13790,'crop'=>5945,'time'=>62434),array('wood'=>10035,'clay'=>10645,'iron'=>14575,'crop'=>6285,'time'=>65977),array('wood'=>10570,'clay'=>11210,'iron'=>15345,'crop'=>6615,'time'=>69473),array('wood'=>11095,'clay'=>11770,'iron'=>16110,'crop'=>6945,'time'=>72926),array('wood'=>11610,'clay'=>12320,'iron'=>16865,'crop'=>7270,'time'=>76338),array('wood'=>12125,'clay'=>12865,'iron'=>17610,'crop'=>7590,'time'=>79712),array('wood'=>12635,'clay'=>13400,'iron'=>18345,'crop'=>7910,'time'=>83051));
$ab4=array(1=>array('wood'=>540,'clay'=>610,'iron'=>170,'crop'=>220,'time'=>5880),array('wood'=>940,'clay'=>1060,'iron'=>295,'crop'=>385,'time'=>10238),array('wood'=>1300,'clay'=>1470,'iron'=>410,'crop'=>530,'time'=>14160),array('wood'=>1635,'clay'=>1850,'iron'=>515,'crop'=>665,'time'=>17825),array('wood'=>1955,'clay'=>2210,'iron'=>615,'crop'=>795,'time'=>21309),array('wood'=>2265,'clay'=>2560,'iron'=>715,'crop'=>920,'time'=>24655),array('wood'=>2560,'clay'=>2895,'iron'=>805,'crop'=>1045,'time'=>27890),array('wood'=>2850,'clay'=>3220,'iron'=>895,'crop'=>1160,'time'=>31035),array('wood'=>3130,'clay'=>3540,'iron'=>985,'crop'=>1275,'time'=>34101),array('wood'=>3405,'clay'=>3850,'iron'=>1075,'crop'=>1390,'time'=>37100),array('wood'=>3675,'clay'=>4155,'iron'=>1160,'crop'=>1500,'time'=>40040),array('wood'=>3940,'clay'=>4455,'iron'=>1240,'crop'=>1605,'time'=>42926),array('wood'=>4205,'clay'=>4750,'iron'=>1325,'crop'=>1710,'time'=>45765),array('wood'=>4460,'clay'=>5040,'iron'=>1405,'crop'=>1815,'time'=>48560),array('wood'=>4715,'clay'=>5325,'iron'=>1485,'crop'=>1920,'time'=>51316),array('wood'=>4960,'clay'=>5605,'iron'=>1560,'crop'=>2020,'time'=>54035),array('wood'=>5210,'clay'=>5885,'iron'=>1640,'crop'=>2120,'time'=>56720),array('wood'=>5455,'clay'=>6160,'iron'=>1715,'crop'=>2220,'time'=>59374),array('wood'=>5695,'clay'=>6430,'iron'=>1790,'crop'=>2320,'time'=>61998),array('wood'=>5930,'clay'=>6700,'iron'=>1870,'crop'=>2415,'time'=>64595));
$ab5=array(1=>array('wood'=>1315,'clay'=>1060,'iron'=>815,'crop'=>285,'time'=>9720),array('wood'=>2290,'clay'=>1845,'iron'=>1415,'crop'=>500,'time'=>16924),array('wood'=>3170,'clay'=>2555,'iron'=>1960,'crop'=>690,'time'=>23408),array('wood'=>3990,'clay'=>3215,'iron'=>2465,'crop'=>870,'time'=>29466),array('wood'=>4770,'clay'=>3840,'iron'=>2945,'crop'=>1040,'time'=>35224),array('wood'=>5520,'clay'=>4445,'iron'=>3410,'crop'=>1200,'time'=>40756),array('wood'=>6245,'clay'=>5030,'iron'=>3860,'crop'=>1360,'time'=>46105),array('wood'=>6950,'clay'=>5595,'iron'=>4295,'crop'=>1515,'time'=>51302),array('wood'=>7635,'clay'=>6150,'iron'=>4715,'crop'=>1665,'time'=>56372),array('wood'=>8310,'clay'=>6690,'iron'=>5130,'crop'=>1810,'time'=>61329),array('wood'=>8965,'clay'=>7220,'iron'=>5540,'crop'=>1950,'time'=>66188),array('wood'=>9610,'clay'=>7740,'iron'=>5940,'crop'=>2095,'time'=>70960),array('wood'=>10250,'clay'=>8250,'iron'=>6330,'crop'=>2230,'time'=>75652),array('wood'=>10875,'clay'=>8755,'iron'=>6715,'crop'=>2365,'time'=>80273),array('wood'=>11490,'clay'=>9250,'iron'=>7100,'crop'=>2500,'time'=>84828),array('wood'=>12100,'clay'=>9740,'iron'=>7475,'crop'=>2635,'time'=>89323),array('wood'=>12700,'clay'=>10225,'iron'=>7845,'crop'=>2765,'time'=>93762),array('wood'=>13295,'clay'=>10705,'iron'=>8215,'crop'=>2895,'time'=>98149),array('wood'=>13885,'clay'=>11175,'iron'=>8575,'crop'=>3025,'time'=>102487),array('wood'=>14465,'clay'=>11645,'iron'=>8935,'crop'=>3150,'time'=>106780));
$ab6=array(1=>array('wood'=>990,'clay'=>1145,'iron'=>1450,'crop'=>355,'time'=>12360),array('wood'=>1720,'clay'=>1995,'iron'=>2525,'crop'=>620,'time'=>21520),array('wood'=>2380,'clay'=>2755,'iron'=>3490,'crop'=>855,'time'=>29766),array('wood'=>2995,'clay'=>3470,'iron'=>4395,'crop'=>1075,'time'=>37469),array('wood'=>3580,'clay'=>4150,'iron'=>5255,'crop'=>1285,'time'=>44791),array('wood'=>4140,'clay'=>4800,'iron'=>6080,'crop'=>1490,'time'=>51825),array('wood'=>4685,'clay'=>5430,'iron'=>6880,'crop'=>1685,'time'=>58627),array('wood'=>5210,'clay'=>6045,'iron'=>7655,'crop'=>1875,'time'=>65236),array('wood'=>5725,'clay'=>6640,'iron'=>8410,'crop'=>2060,'time'=>71682),array('wood'=>6230,'clay'=>7225,'iron'=>9150,'crop'=>2240,'time'=>77986),array('wood'=>6725,'clay'=>7795,'iron'=>9875,'crop'=>2415,'time'=>84165),array('wood'=>7210,'clay'=>8360,'iron'=>10585,'crop'=>2590,'time'=>90233),array('wood'=>7685,'clay'=>8910,'iron'=>11285,'crop'=>2765,'time'=>96200),array('wood'=>8155,'clay'=>9455,'iron'=>11975,'crop'=>2930,'time'=>102075),array('wood'=>8620,'clay'=>9995,'iron'=>12655,'crop'=>3100,'time'=>107868),array('wood'=>9075,'clay'=>10520,'iron'=>13325,'crop'=>3260,'time'=>113583),array('wood'=>9525,'clay'=>11045,'iron'=>13985,'crop'=>3425,'time'=>119228),array('wood'=>9970,'clay'=>11560,'iron'=>14640,'crop'=>3585,'time'=>124806),array('wood'=>10410,'clay'=>12075,'iron'=>15290,'crop'=>3745,'time'=>130323),array('wood'=>10850,'clay'=>12580,'iron'=>15930,'crop'=>3900,'time'=>135782));
$ab7=array(1=>array('wood'=>2135,'clay'=>875,'iron'=>1235,'crop'=>215,'time'=>15600),array('wood'=>3715,'clay'=>1520,'iron'=>2145,'crop'=>375,'time'=>27161),array('wood'=>5140,'clay'=>2105,'iron'=>2970,'crop'=>520,'time'=>37568),array('wood'=>6465,'clay'=>2645,'iron'=>3740,'crop'=>655,'time'=>47290),array('wood'=>7730,'clay'=>3165,'iron'=>4470,'crop'=>785,'time'=>56533),array('wood'=>8945,'clay'=>3660,'iron'=>5170,'crop'=>910,'time'=>65410),array('wood'=>10120,'clay'=>4140,'iron'=>5850,'crop'=>1030,'time'=>73995),array('wood'=>11260,'clay'=>4610,'iron'=>6510,'crop'=>1145,'time'=>82337),array('wood'=>12370,'clay'=>5065,'iron'=>7155,'crop'=>1255,'time'=>90473),array('wood'=>13460,'clay'=>5510,'iron'=>7780,'crop'=>1365,'time'=>98429),array('wood'=>14525,'clay'=>5945,'iron'=>8400,'crop'=>1475,'time'=>106228),array('wood'=>15575,'clay'=>6375,'iron'=>9005,'crop'=>1580,'time'=>113886),array('wood'=>16605,'clay'=>6795,'iron'=>9600,'crop'=>1685,'time'=>121417),array('wood'=>17620,'clay'=>7210,'iron'=>10185,'crop'=>1790,'time'=>128833),array('wood'=>18620,'clay'=>7620,'iron'=>10765,'crop'=>1890,'time'=>136144),array('wood'=>19605,'clay'=>8025,'iron'=>11335,'crop'=>1990,'time'=>143358),array('wood'=>20580,'clay'=>8425,'iron'=>11895,'crop'=>2090,'time'=>150482),array('wood'=>21540,'clay'=>8820,'iron'=>12455,'crop'=>2190,'time'=>157523),array('wood'=>22495,'clay'=>9210,'iron'=>13005,'crop'=>2285,'time'=>164485),array('wood'=>23435,'clay'=>9595,'iron'=>13550,'crop'=>2380,'time'=>171375));
$ab8=array(1=>array('wood'=>1125,'clay'=>1590,'iron'=>735,'crop'=>130,'time'=>28800),array('wood'=>1960,'clay'=>2770,'iron'=>1275,'crop'=>230,'time'=>50144),array('wood'=>2710,'clay'=>3835,'iron'=>1765,'crop'=>315,'time'=>69357),array('wood'=>3410,'clay'=>4825,'iron'=>2225,'crop'=>400,'time'=>87305),array('wood'=>4075,'clay'=>5770,'iron'=>2660,'crop'=>475,'time'=>104368),array('wood'=>4715,'clay'=>6675,'iron'=>3075,'crop'=>550,'time'=>120757),array('wood'=>5335,'clay'=>7550,'iron'=>3480,'crop'=>625,'time'=>136606),array('wood'=>5940,'clay'=>8400,'iron'=>3870,'crop'=>695,'time'=>152007),array('wood'=>6525,'clay'=>9230,'iron'=>4255,'crop'=>765,'time'=>167027),array('wood'=>7100,'clay'=>10045,'iron'=>4625,'crop'=>830,'time'=>181716),array('wood'=>7660,'clay'=>10840,'iron'=>4995,'crop'=>895,'time'=>196113),array('wood'=>8215,'clay'=>11620,'iron'=>5355,'crop'=>960,'time'=>210251),array('wood'=>8755,'clay'=>12390,'iron'=>5710,'crop'=>1025,'time'=>224154),array('wood'=>9290,'clay'=>13145,'iron'=>6055,'crop'=>1085,'time'=>237845),array('wood'=>9820,'clay'=>13890,'iron'=>6400,'crop'=>1150,'time'=>251342),array('wood'=>10340,'clay'=>14625,'iron'=>6740,'crop'=>1210,'time'=>264660),array('wood'=>10850,'clay'=>15355,'iron'=>7075,'crop'=>1270,'time'=>277812),array('wood'=>11360,'clay'=>16070,'iron'=>7405,'crop'=>1330,'time'=>290811),array('wood'=>11860,'clay'=>16780,'iron'=>7730,'crop'=>1390,'time'=>303665),array('wood'=>12360,'clay'=>17485,'iron'=>8055,'crop'=>1445,'time'=>316385));
$ab11=array(1=>array('wood'=>765,'clay'=>625,'iron'=>480,'crop'=>440,'time'=>3960),array('wood'=>1330,'clay'=>1090,'iron'=>835,'crop'=>765,'time'=>6895),array('wood'=>1840,'clay'=>1505,'iron'=>1155,'crop'=>1060,'time'=>9537),array('wood'=>2320,'clay'=>1895,'iron'=>1455,'crop'=>1335,'time'=>12004),array('wood'=>2770,'clay'=>2265,'iron'=>1740,'crop'=>1595,'time'=>14351),array('wood'=>3210,'clay'=>2620,'iron'=>2015,'crop'=>1845,'time'=>16604),array('wood'=>3630,'clay'=>2965,'iron'=>2275,'crop'=>2085,'time'=>18783),array('wood'=>4040,'clay'=>3300,'iron'=>2535,'crop'=>2320,'time'=>20901),array('wood'=>4435,'clay'=>3625,'iron'=>2785,'crop'=>2550,'time'=>22966),array('wood'=>4825,'clay'=>3945,'iron'=>3030,'crop'=>2775,'time'=>24986),array('wood'=>5210,'clay'=>4255,'iron'=>3270,'crop'=>2995,'time'=>26966),array('wood'=>5585,'clay'=>4565,'iron'=>3505,'crop'=>3210,'time'=>28909),array('wood'=>5955,'clay'=>4865,'iron'=>3735,'crop'=>3425,'time'=>30821),array('wood'=>6320,'clay'=>5160,'iron'=>3965,'crop'=>3635,'time'=>32704),array('wood'=>6675,'clay'=>5455,'iron'=>4190,'crop'=>3840,'time'=>34560),array('wood'=>7030,'clay'=>5745,'iron'=>4410,'crop'=>4045,'time'=>36391),array('wood'=>7380,'clay'=>6030,'iron'=>4630,'crop'=>4245,'time'=>38199),array('wood'=>7725,'clay'=>6310,'iron'=>4845,'crop'=>4445,'time'=>39986),array('wood'=>8065,'clay'=>6590,'iron'=>5060,'crop'=>4640,'time'=>41754),array('wood'=>8405,'clay'=>6865,'iron'=>5275,'crop'=>4835,'time'=>43503));
$ab12=array(1=>array('wood'=>1115,'clay'=>590,'iron'=>795,'crop'=>440,'time'=>5160),array('wood'=>1940,'clay'=>1025,'iron'=>1385,'crop'=>765,'time'=>8984),array('wood'=>2685,'clay'=>1420,'iron'=>1915,'crop'=>1060,'time'=>12426),array('wood'=>3380,'clay'=>1790,'iron'=>2410,'crop'=>1335,'time'=>15642),array('wood'=>4040,'clay'=>2140,'iron'=>2880,'crop'=>1595,'time'=>18699),array('wood'=>4675,'clay'=>2475,'iron'=>3335,'crop'=>1845,'time'=>21636),array('wood'=>5290,'clay'=>2800,'iron'=>3770,'crop'=>2085,'time'=>24475),array('wood'=>5885,'clay'=>3115,'iron'=>4195,'crop'=>2320,'time'=>27235),array('wood'=>6465,'clay'=>3420,'iron'=>4610,'crop'=>2550,'time'=>29926),array('wood'=>7035,'clay'=>3725,'iron'=>5015,'crop'=>2775,'time'=>32557),array('wood'=>7595,'clay'=>4020,'iron'=>5415,'crop'=>2995,'time'=>35137),array('wood'=>8140,'clay'=>4305,'iron'=>5805,'crop'=>3210,'time'=>37670),array('wood'=>8680,'clay'=>4590,'iron'=>6190,'crop'=>3425,'time'=>40161),array('wood'=>9210,'clay'=>4875,'iron'=>6565,'crop'=>3635,'time'=>42614),array('wood'=>9730,'clay'=>5150,'iron'=>6940,'crop'=>3840,'time'=>45032),array('wood'=>10245,'clay'=>5420,'iron'=>7305,'crop'=>4045,'time'=>47418),array('wood'=>10755,'clay'=>5690,'iron'=>7670,'crop'=>4245,'time'=>49775),array('wood'=>11260,'clay'=>5960,'iron'=>8030,'crop'=>4445,'time'=>52104),array('wood'=>11755,'clay'=>6220,'iron'=>8380,'crop'=>4640,'time'=>54407),array('wood'=>12250,'clay'=>6480,'iron'=>8735,'crop'=>4835,'time'=>56686));
$ab13=array(1=>array('wood'=>1010,'clay'=>940,'iron'=>1390,'crop'=>650,'time'=>5400),array('wood'=>1760,'clay'=>1635,'iron'=>2420,'crop'=>1130,'time'=>9402),array('wood'=>2430,'clay'=>2265,'iron'=>3345,'crop'=>1565,'time'=>13004),array('wood'=>3060,'clay'=>2850,'iron'=>4215,'crop'=>1970,'time'=>16370),array('wood'=>3660,'clay'=>3405,'iron'=>5035,'crop'=>2355,'time'=>19569),array('wood'=>4235,'clay'=>3940,'iron'=>5830,'crop'=>2725,'time'=>22642),array('wood'=>4790,'clay'=>4460,'iron'=>6595,'crop'=>3085,'time'=>25614),array('wood'=>5330,'clay'=>4960,'iron'=>7335,'crop'=>3430,'time'=>28501),array('wood'=>5860,'clay'=>5450,'iron'=>8060,'crop'=>3770,'time'=>31318),array('wood'=>6375,'clay'=>5930,'iron'=>8770,'crop'=>4100,'time'=>34072),array('wood'=>6880,'clay'=>6400,'iron'=>9465,'crop'=>4425,'time'=>36771),array('wood'=>7375,'clay'=>6860,'iron'=>10150,'crop'=>4745,'time'=>39422),array('wood'=>7860,'clay'=>7315,'iron'=>10820,'crop'=>5060,'time'=>42029),array('wood'=>8340,'clay'=>7765,'iron'=>11480,'crop'=>5370,'time'=>44596),array('wood'=>8815,'clay'=>8205,'iron'=>12130,'crop'=>5675,'time'=>47127),array('wood'=>9280,'clay'=>8640,'iron'=>12775,'crop'=>5975,'time'=>49624),array('wood'=>9745,'clay'=>9065,'iron'=>13410,'crop'=>6270,'time'=>52090),array('wood'=>10200,'clay'=>9490,'iron'=>14035,'crop'=>6565,'time'=>54527),array('wood'=>10650,'clay'=>9910,'iron'=>14655,'crop'=>6855,'time'=>56937),array('wood'=>11095,'clay'=>10325,'iron'=>15270,'crop'=>7140,'time'=>59322));
$ab14=array(1=>array('wood'=>1220,'clay'=>800,'iron'=>550,'crop'=>510,'time'=>5160),array('wood'=>2125,'clay'=>1395,'iron'=>960,'crop'=>890,'time'=>8984),array('wood'=>2940,'clay'=>1925,'iron'=>1325,'crop'=>1230,'time'=>12426),array('wood'=>3700,'clay'=>2425,'iron'=>1665,'crop'=>1545,'time'=>15642),array('wood'=>4420,'clay'=>2900,'iron'=>1995,'crop'=>1850,'time'=>18699),array('wood'=>5115,'clay'=>3355,'iron'=>2305,'crop'=>2140,'time'=>21636),array('wood'=>5785,'clay'=>3795,'iron'=>2610,'crop'=>2420,'time'=>24475),array('wood'=>6440,'clay'=>4220,'iron'=>2905,'crop'=>2690,'time'=>27235),array('wood'=>7075,'clay'=>4640,'iron'=>3190,'crop'=>2960,'time'=>29926),array('wood'=>7700,'clay'=>5050,'iron'=>3470,'crop'=>3220,'time'=>32557),array('wood'=>8310,'clay'=>5450,'iron'=>3745,'crop'=>3475,'time'=>35137),array('wood'=>8905,'clay'=>5840,'iron'=>4015,'crop'=>3725,'time'=>37670),array('wood'=>9495,'clay'=>6225,'iron'=>4280,'crop'=>3970,'time'=>40161),array('wood'=>10075,'clay'=>6605,'iron'=>4540,'crop'=>4210,'time'=>42614),array('wood'=>10645,'clay'=>6980,'iron'=>4800,'crop'=>4450,'time'=>45032),array('wood'=>11210,'clay'=>7350,'iron'=>5055,'crop'=>4685,'time'=>47418),array('wood'=>11770,'clay'=>7715,'iron'=>5305,'crop'=>4920,'time'=>49775),array('wood'=>12320,'clay'=>8080,'iron'=>5555,'crop'=>5150,'time'=>52104),array('wood'=>12865,'clay'=>8435,'iron'=>5800,'crop'=>5375,'time'=>54407),array('wood'=>13400,'clay'=>8790,'iron'=>6040,'crop'=>5605,'time'=>56686));
$ab15=array(1=>array('wood'=>1345,'clay'=>995,'iron'=>1115,'crop'=>345,'time'=>9000),array('wood'=>2340,'clay'=>1730,'iron'=>1940,'crop'=>595,'time'=>15670),array('wood'=>3240,'clay'=>2395,'iron'=>2685,'crop'=>825,'time'=>21674),array('wood'=>4075,'clay'=>3015,'iron'=>3380,'crop'=>1040,'time'=>27283),array('wood'=>4875,'clay'=>3605,'iron'=>4040,'crop'=>1240,'time'=>32615),array('wood'=>5640,'clay'=>4170,'iron'=>4675,'crop'=>1435,'time'=>37737),array('wood'=>6380,'clay'=>4720,'iron'=>5290,'crop'=>1625,'time'=>42689),array('wood'=>7100,'clay'=>5250,'iron'=>5885,'crop'=>1810,'time'=>47502),array('wood'=>7800,'clay'=>5770,'iron'=>6465,'crop'=>1985,'time'=>52196),array('wood'=>8485,'clay'=>6280,'iron'=>7035,'crop'=>2160,'time'=>56786),array('wood'=>9160,'clay'=>6775,'iron'=>7595,'crop'=>2330,'time'=>61285),array('wood'=>9820,'clay'=>7265,'iron'=>8140,'crop'=>2500,'time'=>65703),array('wood'=>10470,'clay'=>7745,'iron'=>8680,'crop'=>2665,'time'=>70048),array('wood'=>11110,'clay'=>8215,'iron'=>9210,'crop'=>2830,'time'=>74327),array('wood'=>11740,'clay'=>8685,'iron'=>9730,'crop'=>2990,'time'=>78544),array('wood'=>12360,'clay'=>9145,'iron'=>10245,'crop'=>3145,'time'=>82706),array('wood'=>12975,'clay'=>9600,'iron'=>10755,'crop'=>3305,'time'=>86816),array('wood'=>13580,'clay'=>10045,'iron'=>11260,'crop'=>3460,'time'=>90878),array('wood'=>14180,'clay'=>10490,'iron'=>11755,'crop'=>3610,'time'=>94895),array('wood'=>14775,'clay'=>10930,'iron'=>12250,'crop'=>3765,'time'=>98870));
$ab16=array(1=>array('wood'=>1085,'clay'=>1235,'iron'=>1185,'crop'=>240,'time'=>10680),array('wood'=>1885,'clay'=>2150,'iron'=>2065,'crop'=>420,'time'=>18595),array('wood'=>2610,'clay'=>2975,'iron'=>2860,'crop'=>580,'time'=>25720),array('wood'=>3285,'clay'=>3745,'iron'=>3595,'crop'=>730,'time'=>32376),array('wood'=>3925,'clay'=>4475,'iron'=>4300,'crop'=>870,'time'=>38703),array('wood'=>4540,'clay'=>5180,'iron'=>4975,'crop'=>1005,'time'=>44781),array('wood'=>5140,'clay'=>5860,'iron'=>5630,'crop'=>1140,'time'=>50658),array('wood'=>5720,'clay'=>6520,'iron'=>6265,'crop'=>1265,'time'=>56369),array('wood'=>6285,'clay'=>7160,'iron'=>6880,'crop'=>1390,'time'=>61939),array('wood'=>6835,'clay'=>7790,'iron'=>7485,'crop'=>1515,'time'=>67386),array('wood'=>7375,'clay'=>8410,'iron'=>8080,'crop'=>1635,'time'=>72725),array('wood'=>7910,'clay'=>9015,'iron'=>8665,'crop'=>1750,'time'=>77968),array('wood'=>8430,'clay'=>9610,'iron'=>9235,'crop'=>1870,'time'=>83124),array('wood'=>8945,'clay'=>10200,'iron'=>9800,'crop'=>1980,'time'=>88201),array('wood'=>9455,'clay'=>10780,'iron'=>10355,'crop'=>2095,'time'=>93206),array('wood'=>9955,'clay'=>11350,'iron'=>10905,'crop'=>2205,'time'=>98145),array('wood'=>10450,'clay'=>11915,'iron'=>11445,'crop'=>2315,'time'=>103022),array('wood'=>10940,'clay'=>12470,'iron'=>11980,'crop'=>2425,'time'=>107842),array('wood'=>11425,'clay'=>13020,'iron'=>12510,'crop'=>2530,'time'=>112609),array('wood'=>11900,'clay'=>13565,'iron'=>13035,'crop'=>2635,'time'=>117326));
$ab17=array(1=>array('wood'=>2365,'clay'=>735,'iron'=>885,'crop'=>215,'time'=>14400),array('wood'=>4120,'clay'=>1275,'iron'=>1540,'crop'=>375,'time'=>25072),array('wood'=>5700,'clay'=>1765,'iron'=>2125,'crop'=>520,'time'=>34678),array('wood'=>7175,'clay'=>2225,'iron'=>2680,'crop'=>655,'time'=>43653),array('wood'=>8575,'clay'=>2660,'iron'=>3200,'crop'=>785,'time'=>52184),array('wood'=>9925,'clay'=>3075,'iron'=>3705,'crop'=>910,'time'=>60379),array('wood'=>11225,'clay'=>3480,'iron'=>4190,'crop'=>1030,'time'=>68303),array('wood'=>12490,'clay'=>3870,'iron'=>4660,'crop'=>1145,'time'=>76004),array('wood'=>13725,'clay'=>4255,'iron'=>5125,'crop'=>1255,'time'=>83513),array('wood'=>14935,'clay'=>4625,'iron'=>5575,'crop'=>1365,'time'=>90858),array('wood'=>16115,'clay'=>4995,'iron'=>6015,'crop'=>1475,'time'=>98057),array('wood'=>17280,'clay'=>5355,'iron'=>6450,'crop'=>1580,'time'=>105125),array('wood'=>18420,'clay'=>5710,'iron'=>6875,'crop'=>1685,'time'=>112077),array('wood'=>19545,'clay'=>6055,'iron'=>7295,'crop'=>1790,'time'=>118923),array('wood'=>20655,'clay'=>6400,'iron'=>7710,'crop'=>1890,'time'=>125671),array('wood'=>21750,'clay'=>6740,'iron'=>8115,'crop'=>1990,'time'=>132330),array('wood'=>22830,'clay'=>7075,'iron'=>8520,'crop'=>2090,'time'=>138906),array('wood'=>23900,'clay'=>7405,'iron'=>8920,'crop'=>2190,'time'=>145405),array('wood'=>24955,'clay'=>7730,'iron'=>9315,'crop'=>2285,'time'=>151833),array('wood'=>26000,'clay'=>8055,'iron'=>9705,'crop'=>2380,'time'=>158193));
$ab18=array(1=>array('wood'=>1065,'clay'=>1415,'iron'=>735,'crop'=>95,'time'=>28800),array('wood'=>1855,'clay'=>2465,'iron'=>1275,'crop'=>170,'time'=>50144),array('wood'=>2570,'clay'=>3410,'iron'=>1765,'crop'=>235,'time'=>69357),array('wood'=>3235,'clay'=>4295,'iron'=>2225,'crop'=>295,'time'=>87305),array('wood'=>3865,'clay'=>5135,'iron'=>2660,'crop'=>350,'time'=>104368),array('wood'=>4470,'clay'=>5940,'iron'=>3075,'crop'=>405,'time'=>120757),array('wood'=>5060,'clay'=>6720,'iron'=>3480,'crop'=>460,'time'=>136606),array('wood'=>5630,'clay'=>7475,'iron'=>3870,'crop'=>510,'time'=>152007),array('wood'=>6185,'clay'=>8215,'iron'=>4255,'crop'=>560,'time'=>167027),array('wood'=>6730,'clay'=>8940,'iron'=>4625,'crop'=>610,'time'=>181716),array('wood'=>7265,'clay'=>9645,'iron'=>4995,'crop'=>660,'time'=>196113),array('wood'=>7785,'clay'=>10340,'iron'=>5355,'crop'=>705,'time'=>210251),array('wood'=>8300,'clay'=>11025,'iron'=>5710,'crop'=>750,'time'=>224154),array('wood'=>8810,'clay'=>11700,'iron'=>6055,'crop'=>800,'time'=>237845),array('wood'=>9310,'clay'=>12365,'iron'=>6400,'crop'=>845,'time'=>251342),array('wood'=>9800,'clay'=>13020,'iron'=>6740,'crop'=>890,'time'=>264660),array('wood'=>10290,'clay'=>13665,'iron'=>7075,'crop'=>930,'time'=>277812),array('wood'=>10770,'clay'=>14305,'iron'=>7405,'crop'=>975,'time'=>290811),array('wood'=>11245,'clay'=>14935,'iron'=>7730,'crop'=>1020,'time'=>303665),array('wood'=>11720,'clay'=>15565,'iron'=>8055,'crop'=>1060,'time'=>316385));
$ab21=array(1=>array('wood'=>800,'clay'=>1010,'iron'=>585,'crop'=>370,'time'=>4920),array('wood'=>1395,'clay'=>1760,'iron'=>1020,'crop'=>645,'time'=>8566),array('wood'=>1925,'clay'=>2430,'iron'=>1410,'crop'=>890,'time'=>11848),array('wood'=>2425,'clay'=>3060,'iron'=>1775,'crop'=>1120,'time'=>14915),array('wood'=>2900,'clay'=>3660,'iron'=>2120,'crop'=>1340,'time'=>17830),array('wood'=>3355,'clay'=>4235,'iron'=>2455,'crop'=>1550,'time'=>20629),array('wood'=>3795,'clay'=>4790,'iron'=>2775,'crop'=>1755,'time'=>23337),array('wood'=>4220,'clay'=>5330,'iron'=>3090,'crop'=>1955,'time'=>25968),array('wood'=>4640,'clay'=>5860,'iron'=>3395,'crop'=>2145,'time'=>28534),array('wood'=>5050,'clay'=>6375,'iron'=>3690,'crop'=>2335,'time'=>31043),array('wood'=>5450,'clay'=>6880,'iron'=>3985,'crop'=>2520,'time'=>33503),array('wood'=>5840,'clay'=>7375,'iron'=>4270,'crop'=>2700,'time'=>35918),array('wood'=>6225,'clay'=>7860,'iron'=>4555,'crop'=>2880,'time'=>38293),array('wood'=>6605,'clay'=>8340,'iron'=>4830,'crop'=>3055,'time'=>40632),array('wood'=>6980,'clay'=>8815,'iron'=>5105,'crop'=>3230,'time'=>42938),array('wood'=>7350,'clay'=>9280,'iron'=>5375,'crop'=>3400,'time'=>45213),array('wood'=>7715,'clay'=>9745,'iron'=>5645,'crop'=>3570,'time'=>47460),array('wood'=>8080,'clay'=>10200,'iron'=>5905,'crop'=>3735,'time'=>49680),array('wood'=>8435,'clay'=>10650,'iron'=>6170,'crop'=>3900,'time'=>51876),array('wood'=>8790,'clay'=>11095,'iron'=>6425,'crop'=>4065,'time'=>54049));
$ab22=array(1=>array('wood'=>1080,'clay'=>1150,'iron'=>1495,'crop'=>580,'time'=>6120),array('wood'=>1880,'clay'=>2000,'iron'=>2605,'crop'=>1010,'time'=>10656),array('wood'=>2600,'clay'=>2770,'iron'=>3600,'crop'=>1395,'time'=>14738),array('wood'=>3275,'clay'=>3485,'iron'=>4530,'crop'=>1760,'time'=>18552),array('wood'=>3915,'clay'=>4165,'iron'=>5420,'crop'=>2100,'time'=>22178),array('wood'=>4530,'clay'=>4820,'iron'=>6270,'crop'=>2430,'time'=>25661),array('wood'=>5125,'clay'=>5455,'iron'=>7090,'crop'=>2750,'time'=>29029),array('wood'=>5700,'clay'=>6070,'iron'=>7890,'crop'=>3060,'time'=>32302),array('wood'=>6265,'clay'=>6670,'iron'=>8670,'crop'=>3365,'time'=>35493),array('wood'=>6815,'clay'=>7255,'iron'=>9435,'crop'=>3660,'time'=>38615),array('wood'=>7355,'clay'=>7830,'iron'=>10180,'crop'=>3950,'time'=>41674),array('wood'=>7885,'clay'=>8395,'iron'=>10915,'crop'=>4235,'time'=>44678),array('wood'=>8405,'clay'=>8950,'iron'=>11635,'crop'=>4515,'time'=>47633),array('wood'=>8920,'clay'=>9495,'iron'=>12345,'crop'=>4790,'time'=>50542),array('wood'=>9425,'clay'=>10035,'iron'=>13045,'crop'=>5060,'time'=>53410),array('wood'=>9925,'clay'=>10570,'iron'=>13740,'crop'=>5330,'time'=>56240),array('wood'=>10420,'clay'=>11095,'iron'=>14420,'crop'=>5595,'time'=>59035),array('wood'=>10905,'clay'=>11610,'iron'=>15095,'crop'=>5855,'time'=>61797),array('wood'=>11385,'clay'=>12125,'iron'=>15765,'crop'=>6115,'time'=>64529),array('wood'=>11865,'clay'=>12635,'iron'=>16425,'crop'=>6370,'time'=>67232));
$ab23=array(1=>array('wood'=>645,'clay'=>575,'iron'=>170,'crop'=>220,'time'=>5880),array('wood'=>1125,'clay'=>1000,'iron'=>295,'crop'=>385,'time'=>10238),array('wood'=>1555,'clay'=>1385,'iron'=>410,'crop'=>530,'time'=>14160),array('wood'=>1955,'clay'=>1745,'iron'=>515,'crop'=>665,'time'=>17825),array('wood'=>2335,'clay'=>2085,'iron'=>615,'crop'=>795,'time'=>21309),array('wood'=>2705,'clay'=>2410,'iron'=>715,'crop'=>920,'time'=>24655),array('wood'=>3060,'clay'=>2725,'iron'=>805,'crop'=>1045,'time'=>27890),array('wood'=>3405,'clay'=>3035,'iron'=>895,'crop'=>1160,'time'=>31035),array('wood'=>3740,'clay'=>3335,'iron'=>985,'crop'=>1275,'time'=>34101),array('wood'=>4070,'clay'=>3630,'iron'=>1075,'crop'=>1390,'time'=>37100),array('wood'=>4390,'clay'=>3915,'iron'=>1160,'crop'=>1500,'time'=>40040),array('wood'=>4710,'clay'=>4200,'iron'=>1240,'crop'=>1605,'time'=>42926),array('wood'=>5020,'clay'=>4475,'iron'=>1325,'crop'=>1710,'time'=>45765),array('wood'=>5325,'clay'=>4750,'iron'=>1405,'crop'=>1815,'time'=>48560),array('wood'=>5630,'clay'=>5020,'iron'=>1485,'crop'=>1920,'time'=>51316),array('wood'=>5925,'clay'=>5285,'iron'=>1560,'crop'=>2020,'time'=>54035),array('wood'=>6220,'clay'=>5545,'iron'=>1640,'crop'=>2120,'time'=>56720),array('wood'=>6515,'clay'=>5805,'iron'=>1715,'crop'=>2220,'time'=>59374),array('wood'=>6800,'clay'=>6065,'iron'=>1790,'crop'=>2320,'time'=>61998),array('wood'=>7085,'clay'=>6315,'iron'=>1870,'crop'=>2415,'time'=>64595));
$ab24=array(1=>array('wood'=>1275,'clay'=>1625,'iron'=>905,'crop'=>290,'time'=>9240),array('wood'=>2220,'clay'=>2830,'iron'=>1575,'crop'=>505,'time'=>16088),array('wood'=>3070,'clay'=>3915,'iron'=>2180,'crop'=>700,'time'=>22252),array('wood'=>3865,'clay'=>4925,'iron'=>2745,'crop'=>880,'time'=>28010),array('wood'=>4620,'clay'=>5890,'iron'=>3280,'crop'=>1050,'time'=>33485),array('wood'=>5345,'clay'=>6815,'iron'=>3795,'crop'=>1215,'time'=>38743),array('wood'=>6050,'clay'=>7710,'iron'=>4295,'crop'=>1375,'time'=>43828),array('wood'=>6730,'clay'=>8575,'iron'=>4775,'crop'=>1530,'time'=>48769),array('wood'=>7395,'clay'=>9425,'iron'=>5250,'crop'=>1680,'time'=>53588),array('wood'=>8045,'clay'=>10255,'iron'=>5710,'crop'=>1830,'time'=>58300),array('wood'=>8680,'clay'=>11065,'iron'=>6165,'crop'=>1975,'time'=>62920),array('wood'=>9310,'clay'=>11865,'iron'=>6605,'crop'=>2115,'time'=>67455),array('wood'=>9925,'clay'=>12650,'iron'=>7045,'crop'=>2255,'time'=>71916),array('wood'=>10530,'clay'=>13420,'iron'=>7475,'crop'=>2395,'time'=>76309),array('wood'=>11125,'clay'=>14180,'iron'=>7900,'crop'=>2530,'time'=>80639),array('wood'=>11715,'clay'=>14935,'iron'=>8315,'crop'=>2665,'time'=>84912),array('wood'=>12300,'clay'=>15675,'iron'=>8730,'crop'=>2795,'time'=>89131),array('wood'=>12875,'clay'=>16410,'iron'=>9140,'crop'=>2930,'time'=>93302),array('wood'=>13445,'clay'=>17135,'iron'=>9540,'crop'=>3060,'time'=>97426),array('wood'=>14005,'clay'=>17850,'iron'=>9940,'crop'=>3185,'time'=>101507));
$ab25=array(1=>array('wood'=>1310,'clay'=>1205,'iron'=>1080,'crop'=>500,'time'=>9480),array('wood'=>2280,'clay'=>2100,'iron'=>1880,'crop'=>870,'time'=>16506),array('wood'=>3155,'clay'=>2900,'iron'=>2600,'crop'=>1205,'time'=>22830),array('wood'=>3970,'clay'=>3655,'iron'=>3275,'crop'=>1515,'time'=>28738),array('wood'=>4745,'clay'=>4365,'iron'=>3915,'crop'=>1810,'time'=>34355),array('wood'=>5495,'clay'=>5055,'iron'=>4530,'crop'=>2095,'time'=>39749),array('wood'=>6215,'clay'=>5715,'iron'=>5125,'crop'=>2370,'time'=>44966),array('wood'=>6915,'clay'=>6360,'iron'=>5700,'crop'=>2640,'time'=>50036),array('wood'=>7595,'clay'=>6990,'iron'=>6265,'crop'=>2900,'time'=>54980),array('wood'=>8265,'clay'=>7605,'iron'=>6815,'crop'=>3155,'time'=>59815),array('wood'=>8920,'clay'=>8205,'iron'=>7355,'crop'=>3405,'time'=>64554),array('wood'=>9565,'clay'=>8795,'iron'=>7885,'crop'=>3650,'time'=>69208),array('wood'=>10195,'clay'=>9380,'iron'=>8405,'crop'=>3890,'time'=>73784),array('wood'=>10820,'clay'=>9950,'iron'=>8920,'crop'=>4130,'time'=>78291),array('wood'=>11435,'clay'=>10515,'iron'=>9425,'crop'=>4365,'time'=>82733),array('wood'=>12040,'clay'=>11075,'iron'=>9925,'crop'=>4595,'time'=>87117),array('wood'=>12635,'clay'=>11625,'iron'=>10420,'crop'=>4825,'time'=>91447),array('wood'=>13230,'clay'=>12170,'iron'=>10905,'crop'=>5050,'time'=>95725),array('wood'=>13815,'clay'=>12705,'iron'=>11385,'crop'=>5270,'time'=>99957),array('wood'=>14390,'clay'=>13240,'iron'=>11865,'crop'=>5495,'time'=>104144));
$ab26=array(1=>array('wood'=>1200,'clay'=>1480,'iron'=>1640,'crop'=>450,'time'=>11160),array('wood'=>2090,'clay'=>2575,'iron'=>2860,'crop'=>785,'time'=>19431),array('wood'=>2890,'clay'=>3565,'iron'=>3955,'crop'=>1085,'time'=>26876),array('wood'=>3640,'clay'=>4485,'iron'=>4975,'crop'=>1365,'time'=>33831),array('wood'=>4350,'clay'=>5365,'iron'=>5950,'crop'=>1630,'time'=>40443),array('wood'=>5030,'clay'=>6205,'iron'=>6885,'crop'=>1885,'time'=>46793),array('wood'=>5690,'clay'=>7020,'iron'=>7785,'crop'=>2135,'time'=>52935),array('wood'=>6335,'clay'=>7810,'iron'=>8665,'crop'=>2375,'time'=>58903),array('wood'=>6960,'clay'=>8585,'iron'=>9520,'crop'=>2610,'time'=>64723),array('wood'=>7570,'clay'=>9340,'iron'=>10360,'crop'=>2840,'time'=>70415),array('wood'=>8170,'clay'=>10080,'iron'=>11180,'crop'=>3065,'time'=>75994),array('wood'=>8760,'clay'=>10805,'iron'=>11985,'crop'=>3285,'time'=>81472),array('wood'=>9340,'clay'=>11520,'iron'=>12775,'crop'=>3500,'time'=>86860),array('wood'=>9910,'clay'=>12225,'iron'=>13560,'crop'=>3715,'time'=>92165),array('wood'=>10475,'clay'=>12915,'iron'=>14325,'crop'=>3925,'time'=>97395),array('wood'=>11030,'clay'=>13600,'iron'=>15085,'crop'=>4135,'time'=>102556),array('wood'=>11575,'clay'=>14275,'iron'=>15835,'crop'=>4340,'time'=>107652),array('wood'=>12115,'clay'=>14945,'iron'=>16575,'crop'=>4545,'time'=>112689),array('wood'=>12655,'clay'=>15605,'iron'=>17310,'crop'=>4745,'time'=>117670),array('wood'=>13185,'clay'=>16260,'iron'=>18035,'crop'=>4945,'time'=>122599));
$ab27=array(1=>array('wood'=>2250,'clay'=>1330,'iron'=>835,'crop'=>230,'time'=>16800),array('wood'=>3915,'clay'=>2315,'iron'=>1455,'crop'=>400,'time'=>29250),array('wood'=>5420,'clay'=>3200,'iron'=>2015,'crop'=>550,'time'=>40458),array('wood'=>6820,'clay'=>4025,'iron'=>2535,'crop'=>690,'time'=>50928),array('wood'=>8155,'clay'=>4815,'iron'=>3030,'crop'=>825,'time'=>60881),array('wood'=>9435,'clay'=>5570,'iron'=>3510,'crop'=>955,'time'=>70442),array('wood'=>10670,'clay'=>6300,'iron'=>3970,'crop'=>1085,'time'=>79687),array('wood'=>11875,'clay'=>7010,'iron'=>4415,'crop'=>1205,'time'=>88671),array('wood'=>13050,'clay'=>7705,'iron'=>4850,'crop'=>1325,'time'=>97432),array('wood'=>14195,'clay'=>8380,'iron'=>5280,'crop'=>1440,'time'=>106001),array('wood'=>15320,'clay'=>9045,'iron'=>5695,'crop'=>1555,'time'=>114399),array('wood'=>16425,'clay'=>9695,'iron'=>6110,'crop'=>1665,'time'=>122646),array('wood'=>17510,'clay'=>10340,'iron'=>6510,'crop'=>1775,'time'=>130757),array('wood'=>18580,'clay'=>10970,'iron'=>6910,'crop'=>1885,'time'=>138743),array('wood'=>19635,'clay'=>11595,'iron'=>7300,'crop'=>1995,'time'=>146616),array('wood'=>20675,'clay'=>12205,'iron'=>7690,'crop'=>2100,'time'=>154385),array('wood'=>21705,'clay'=>12815,'iron'=>8070,'crop'=>2205,'time'=>162057),array('wood'=>22720,'clay'=>13415,'iron'=>8450,'crop'=>2305,'time'=>169640),array('wood'=>23725,'clay'=>14005,'iron'=>8820,'crop'=>2410,'time'=>177138),array('wood'=>24720,'clay'=>14595,'iron'=>9190,'crop'=>2510,'time'=>184558));
$ab28=array(1=>array('wood'=>1135,'clay'=>1710,'iron'=>770,'crop'=>130,'time'=>28800),array('wood'=>1980,'clay'=>2975,'iron'=>1340,'crop'=>230,'time'=>50144),array('wood'=>2735,'clay'=>4115,'iron'=>1850,'crop'=>315,'time'=>69357),array('wood'=>3445,'clay'=>5180,'iron'=>2330,'crop'=>400,'time'=>87305),array('wood'=>4120,'clay'=>6190,'iron'=>2785,'crop'=>475,'time'=>104368),array('wood'=>4765,'clay'=>7165,'iron'=>3220,'crop'=>550,'time'=>120757),array('wood'=>5390,'clay'=>8105,'iron'=>3645,'crop'=>625,'time'=>136606),array('wood'=>6000,'clay'=>9015,'iron'=>4055,'crop'=>695,'time'=>152007),array('wood'=>6590,'clay'=>9910,'iron'=>4455,'crop'=>765,'time'=>167027),array('wood'=>7170,'clay'=>10780,'iron'=>4850,'crop'=>830,'time'=>181716),array('wood'=>7740,'clay'=>11635,'iron'=>5230,'crop'=>895,'time'=>196113),array('wood'=>8300,'clay'=>12470,'iron'=>5610,'crop'=>960,'time'=>210251),array('wood'=>8845,'clay'=>13295,'iron'=>5980,'crop'=>1025,'time'=>224154),array('wood'=>9385,'clay'=>14110,'iron'=>6345,'crop'=>1085,'time'=>237845),array('wood'=>9920,'clay'=>14910,'iron'=>6705,'crop'=>1150,'time'=>251342),array('wood'=>10445,'clay'=>15700,'iron'=>7060,'crop'=>1210,'time'=>264660),array('wood'=>10965,'clay'=>16480,'iron'=>7410,'crop'=>1270,'time'=>277812),array('wood'=>11480,'clay'=>17250,'iron'=>7760,'crop'=>1330,'time'=>290811),array('wood'=>11985,'clay'=>18015,'iron'=>8100,'crop'=>1390,'time'=>303665),array('wood'=>12485,'clay'=>18765,'iron'=>8440,'crop'=>1445,'time'=>316385));
$ab31=array(1=>array('wood'=>765,'clay'=>625,'iron'=>480,'crop'=>440,'time'=>3960),array('wood'=>1330,'clay'=>1090,'iron'=>835,'crop'=>765,'time'=>6895),array('wood'=>1840,'clay'=>1505,'iron'=>1155,'crop'=>1060,'time'=>9537),array('wood'=>2320,'clay'=>1895,'iron'=>1455,'crop'=>1335,'time'=>12004),array('wood'=>2770,'clay'=>2265,'iron'=>1740,'crop'=>1595,'time'=>14351),array('wood'=>3210,'clay'=>2620,'iron'=>2015,'crop'=>1845,'time'=>16604),array('wood'=>3630,'clay'=>2965,'iron'=>2275,'crop'=>2085,'time'=>18783),array('wood'=>4040,'clay'=>3300,'iron'=>2535,'crop'=>2320,'time'=>20901),array('wood'=>4435,'clay'=>3625,'iron'=>2785,'crop'=>2550,'time'=>22966),array('wood'=>4825,'clay'=>3945,'iron'=>3030,'crop'=>2775,'time'=>24986),array('wood'=>5210,'clay'=>4255,'iron'=>3270,'crop'=>2995,'time'=>26966),array('wood'=>5585,'clay'=>4565,'iron'=>3505,'crop'=>3210,'time'=>28909),array('wood'=>5955,'clay'=>4865,'iron'=>3735,'crop'=>3425,'time'=>30821),array('wood'=>6320,'clay'=>5160,'iron'=>3965,'crop'=>3635,'time'=>32704),array('wood'=>6675,'clay'=>5455,'iron'=>4190,'crop'=>3840,'time'=>34560),array('wood'=>7030,'clay'=>5745,'iron'=>4410,'crop'=>4045,'time'=>36391),array('wood'=>7380,'clay'=>6030,'iron'=>4630,'crop'=>4245,'time'=>38199),array('wood'=>7725,'clay'=>6310,'iron'=>4845,'crop'=>4445,'time'=>39986),array('wood'=>8065,'clay'=>6590,'iron'=>5060,'crop'=>4640,'time'=>41754),array('wood'=>8405,'clay'=>6865,'iron'=>5275,'crop'=>4835,'time'=>43503));
$ab32=array(1=>array('wood'=>1115,'clay'=>590,'iron'=>795,'crop'=>440,'time'=>5160),array('wood'=>1940,'clay'=>1025,'iron'=>1385,'crop'=>765,'time'=>8984),array('wood'=>2685,'clay'=>1420,'iron'=>1915,'crop'=>1060,'time'=>12426),array('wood'=>3380,'clay'=>1790,'iron'=>2410,'crop'=>1335,'time'=>15642),array('wood'=>4040,'clay'=>2140,'iron'=>2880,'crop'=>1595,'time'=>18699),array('wood'=>4675,'clay'=>2475,'iron'=>3335,'crop'=>1845,'time'=>21636),array('wood'=>5290,'clay'=>2800,'iron'=>3770,'crop'=>2085,'time'=>24475),array('wood'=>5885,'clay'=>3115,'iron'=>4195,'crop'=>2320,'time'=>27235),array('wood'=>6465,'clay'=>3420,'iron'=>4610,'crop'=>2550,'time'=>29926),array('wood'=>7035,'clay'=>3725,'iron'=>5015,'crop'=>2775,'time'=>32557),array('wood'=>7595,'clay'=>4020,'iron'=>5415,'crop'=>2995,'time'=>35137),array('wood'=>8140,'clay'=>4305,'iron'=>5805,'crop'=>3210,'time'=>37670),array('wood'=>8680,'clay'=>4590,'iron'=>6190,'crop'=>3425,'time'=>40161),array('wood'=>9210,'clay'=>4875,'iron'=>6565,'crop'=>3635,'time'=>42614),array('wood'=>9730,'clay'=>5150,'iron'=>6940,'crop'=>3840,'time'=>45032),array('wood'=>10245,'clay'=>5420,'iron'=>7305,'crop'=>4045,'time'=>47418),array('wood'=>10755,'clay'=>5690,'iron'=>7670,'crop'=>4245,'time'=>49775),array('wood'=>11260,'clay'=>5960,'iron'=>8030,'crop'=>4445,'time'=>52104),array('wood'=>11755,'clay'=>6220,'iron'=>8380,'crop'=>4640,'time'=>54407),array('wood'=>12250,'clay'=>6480,'iron'=>8735,'crop'=>4835,'time'=>56686));
$ab33=array(1=>array('wood'=>1010,'clay'=>940,'iron'=>1390,'crop'=>650,'time'=>5400),array('wood'=>1760,'clay'=>1635,'iron'=>2420,'crop'=>1130,'time'=>9402),array('wood'=>2430,'clay'=>2265,'iron'=>3345,'crop'=>1565,'time'=>13004),array('wood'=>3060,'clay'=>2850,'iron'=>4215,'crop'=>1970,'time'=>16370),array('wood'=>3660,'clay'=>3405,'iron'=>5035,'crop'=>2355,'time'=>19569),array('wood'=>4235,'clay'=>3940,'iron'=>5830,'crop'=>2725,'time'=>22642),array('wood'=>4790,'clay'=>4460,'iron'=>6595,'crop'=>3085,'time'=>25614),array('wood'=>5330,'clay'=>4960,'iron'=>7335,'crop'=>3430,'time'=>28501),array('wood'=>5860,'clay'=>5450,'iron'=>8060,'crop'=>3770,'time'=>31318),array('wood'=>6375,'clay'=>5930,'iron'=>8770,'crop'=>4100,'time'=>34072),array('wood'=>6880,'clay'=>6400,'iron'=>9465,'crop'=>4425,'time'=>36771),array('wood'=>7375,'clay'=>6860,'iron'=>10150,'crop'=>4745,'time'=>39422),array('wood'=>7860,'clay'=>7315,'iron'=>10820,'crop'=>5060,'time'=>42029),array('wood'=>8340,'clay'=>7765,'iron'=>11480,'crop'=>5370,'time'=>44596),array('wood'=>8815,'clay'=>8205,'iron'=>12130,'crop'=>5675,'time'=>47127),array('wood'=>9280,'clay'=>8640,'iron'=>12775,'crop'=>5975,'time'=>49624),array('wood'=>9745,'clay'=>9065,'iron'=>13410,'crop'=>6270,'time'=>52090),array('wood'=>10200,'clay'=>9490,'iron'=>14035,'crop'=>6565,'time'=>54527),array('wood'=>10650,'clay'=>9910,'iron'=>14655,'crop'=>6855,'time'=>56937),array('wood'=>11095,'clay'=>10325,'iron'=>15270,'crop'=>7140,'time'=>59322));
$ab34=array(1=>array('wood'=>1220,'clay'=>800,'iron'=>550,'crop'=>510,'time'=>5160),array('wood'=>2125,'clay'=>1395,'iron'=>960,'crop'=>890,'time'=>8984),array('wood'=>2940,'clay'=>1925,'iron'=>1325,'crop'=>1230,'time'=>12426),array('wood'=>3700,'clay'=>2425,'iron'=>1665,'crop'=>1545,'time'=>15642),array('wood'=>4420,'clay'=>2900,'iron'=>1995,'crop'=>1850,'time'=>18699),array('wood'=>5115,'clay'=>3355,'iron'=>2305,'crop'=>2140,'time'=>21636),array('wood'=>5785,'clay'=>3795,'iron'=>2610,'crop'=>2420,'time'=>24475),array('wood'=>6440,'clay'=>4220,'iron'=>2905,'crop'=>2690,'time'=>27235),array('wood'=>7075,'clay'=>4640,'iron'=>3190,'crop'=>2960,'time'=>29926),array('wood'=>7700,'clay'=>5050,'iron'=>3470,'crop'=>3220,'time'=>32557),array('wood'=>8310,'clay'=>5450,'iron'=>3745,'crop'=>3475,'time'=>35137),array('wood'=>8905,'clay'=>5840,'iron'=>4015,'crop'=>3725,'time'=>37670),array('wood'=>9495,'clay'=>6225,'iron'=>4280,'crop'=>3970,'time'=>40161),array('wood'=>10075,'clay'=>6605,'iron'=>4540,'crop'=>4210,'time'=>42614),array('wood'=>10645,'clay'=>6980,'iron'=>4800,'crop'=>4450,'time'=>45032),array('wood'=>11210,'clay'=>7350,'iron'=>5055,'crop'=>4685,'time'=>47418),array('wood'=>11770,'clay'=>7715,'iron'=>5305,'crop'=>4920,'time'=>49775),array('wood'=>12320,'clay'=>8080,'iron'=>5555,'crop'=>5150,'time'=>52104),array('wood'=>12865,'clay'=>8435,'iron'=>5800,'crop'=>5375,'time'=>54407),array('wood'=>13400,'clay'=>8790,'iron'=>6040,'crop'=>5605,'time'=>56686));
$ab35=array(1=>array('wood'=>1345,'clay'=>995,'iron'=>1115,'crop'=>345,'time'=>9000),array('wood'=>2340,'clay'=>1730,'iron'=>1940,'crop'=>595,'time'=>15670),array('wood'=>3240,'clay'=>2395,'iron'=>2685,'crop'=>825,'time'=>21674),array('wood'=>4075,'clay'=>3015,'iron'=>3380,'crop'=>1040,'time'=>27283),array('wood'=>4875,'clay'=>3605,'iron'=>4040,'crop'=>1240,'time'=>32615),array('wood'=>5640,'clay'=>4170,'iron'=>4675,'crop'=>1435,'time'=>37737),array('wood'=>6380,'clay'=>4720,'iron'=>5290,'crop'=>1625,'time'=>42689),array('wood'=>7100,'clay'=>5250,'iron'=>5885,'crop'=>1810,'time'=>47502),array('wood'=>7800,'clay'=>5770,'iron'=>6465,'crop'=>1985,'time'=>52196),array('wood'=>8485,'clay'=>6280,'iron'=>7035,'crop'=>2160,'time'=>56786),array('wood'=>9160,'clay'=>6775,'iron'=>7595,'crop'=>2330,'time'=>61285),array('wood'=>9820,'clay'=>7265,'iron'=>8140,'crop'=>2500,'time'=>65703),array('wood'=>10470,'clay'=>7745,'iron'=>8680,'crop'=>2665,'time'=>70048),array('wood'=>11110,'clay'=>8215,'iron'=>9210,'crop'=>2830,'time'=>74327),array('wood'=>11740,'clay'=>8685,'iron'=>9730,'crop'=>2990,'time'=>78544),array('wood'=>12360,'clay'=>9145,'iron'=>10245,'crop'=>3145,'time'=>82706),array('wood'=>12975,'clay'=>9600,'iron'=>10755,'crop'=>3305,'time'=>86816),array('wood'=>13580,'clay'=>10045,'iron'=>11260,'crop'=>3460,'time'=>90878),array('wood'=>14180,'clay'=>10490,'iron'=>11755,'crop'=>3610,'time'=>94895),array('wood'=>14775,'clay'=>10930,'iron'=>12250,'crop'=>3765,'time'=>98870));
$ab36=array(1=>array('wood'=>1085,'clay'=>1235,'iron'=>1185,'crop'=>240,'time'=>10680),array('wood'=>1885,'clay'=>2150,'iron'=>2065,'crop'=>420,'time'=>18595),array('wood'=>2610,'clay'=>2975,'iron'=>2860,'crop'=>580,'time'=>25720),array('wood'=>3285,'clay'=>3745,'iron'=>3595,'crop'=>730,'time'=>32376),array('wood'=>3925,'clay'=>4475,'iron'=>4300,'crop'=>870,'time'=>38703),array('wood'=>4540,'clay'=>5180,'iron'=>4975,'crop'=>1005,'time'=>44781),array('wood'=>5140,'clay'=>5860,'iron'=>5630,'crop'=>1140,'time'=>50658),array('wood'=>5720,'clay'=>6520,'iron'=>6265,'crop'=>1265,'time'=>56369),array('wood'=>6285,'clay'=>7160,'iron'=>6880,'crop'=>1390,'time'=>61939),array('wood'=>6835,'clay'=>7790,'iron'=>7485,'crop'=>1515,'time'=>67386),array('wood'=>7375,'clay'=>8410,'iron'=>8080,'crop'=>1635,'time'=>72725),array('wood'=>7910,'clay'=>9015,'iron'=>8665,'crop'=>1750,'time'=>77968),array('wood'=>8430,'clay'=>9610,'iron'=>9235,'crop'=>1870,'time'=>83124),array('wood'=>8945,'clay'=>10200,'iron'=>9800,'crop'=>1980,'time'=>88201),array('wood'=>9455,'clay'=>10780,'iron'=>10355,'crop'=>2095,'time'=>93206),array('wood'=>9955,'clay'=>11350,'iron'=>10905,'crop'=>2205,'time'=>98145),array('wood'=>10450,'clay'=>11915,'iron'=>11445,'crop'=>2315,'time'=>103022),array('wood'=>10940,'clay'=>12470,'iron'=>11980,'crop'=>2425,'time'=>107842),array('wood'=>11425,'clay'=>13020,'iron'=>12510,'crop'=>2530,'time'=>112609),array('wood'=>11900,'clay'=>13565,'iron'=>13035,'crop'=>2635,'time'=>117326));
$ab37=array(1=>array('wood'=>2365,'clay'=>735,'iron'=>885,'crop'=>215,'time'=>14400),array('wood'=>4120,'clay'=>1275,'iron'=>1540,'crop'=>375,'time'=>25072),array('wood'=>5700,'clay'=>1765,'iron'=>2125,'crop'=>520,'time'=>34678),array('wood'=>7175,'clay'=>2225,'iron'=>2680,'crop'=>655,'time'=>43653),array('wood'=>8575,'clay'=>2660,'iron'=>3200,'crop'=>785,'time'=>52184),array('wood'=>9925,'clay'=>3075,'iron'=>3705,'crop'=>910,'time'=>60379),array('wood'=>11225,'clay'=>3480,'iron'=>4190,'crop'=>1030,'time'=>68303),array('wood'=>12490,'clay'=>3870,'iron'=>4660,'crop'=>1145,'time'=>76004),array('wood'=>13725,'clay'=>4255,'iron'=>5125,'crop'=>1255,'time'=>83513),array('wood'=>14935,'clay'=>4625,'iron'=>5575,'crop'=>1365,'time'=>90858),array('wood'=>16115,'clay'=>4995,'iron'=>6015,'crop'=>1475,'time'=>98057),array('wood'=>17280,'clay'=>5355,'iron'=>6450,'crop'=>1580,'time'=>105125),array('wood'=>18420,'clay'=>5710,'iron'=>6875,'crop'=>1685,'time'=>112077),array('wood'=>19545,'clay'=>6055,'iron'=>7295,'crop'=>1790,'time'=>118923),array('wood'=>20655,'clay'=>6400,'iron'=>7710,'crop'=>1890,'time'=>125671),array('wood'=>21750,'clay'=>6740,'iron'=>8115,'crop'=>1990,'time'=>132330),array('wood'=>22830,'clay'=>7075,'iron'=>8520,'crop'=>2090,'time'=>138906),array('wood'=>23900,'clay'=>7405,'iron'=>8920,'crop'=>2190,'time'=>145405),array('wood'=>24955,'clay'=>7730,'iron'=>9315,'crop'=>2285,'time'=>151833),array('wood'=>26000,'clay'=>8055,'iron'=>9705,'crop'=>2380,'time'=>158193));
$ab38=array(1=>array('wood'=>1065,'clay'=>1415,'iron'=>735,'crop'=>95,'time'=>28800),array('wood'=>1855,'clay'=>2465,'iron'=>1275,'crop'=>170,'time'=>50144),array('wood'=>2570,'clay'=>3410,'iron'=>1765,'crop'=>235,'time'=>69357),array('wood'=>3235,'clay'=>4295,'iron'=>2225,'crop'=>295,'time'=>87305),array('wood'=>3865,'clay'=>5135,'iron'=>2660,'crop'=>350,'time'=>104368),array('wood'=>4470,'clay'=>5940,'iron'=>3075,'crop'=>405,'time'=>120757),array('wood'=>5060,'clay'=>6720,'iron'=>3480,'crop'=>460,'time'=>136606),array('wood'=>5630,'clay'=>7475,'iron'=>3870,'crop'=>510,'time'=>152007),array('wood'=>6185,'clay'=>8215,'iron'=>4255,'crop'=>560,'time'=>167027),array('wood'=>6730,'clay'=>8940,'iron'=>4625,'crop'=>610,'time'=>181716),array('wood'=>7265,'clay'=>9645,'iron'=>4995,'crop'=>660,'time'=>196113),array('wood'=>7785,'clay'=>10340,'iron'=>5355,'crop'=>705,'time'=>210251),array('wood'=>8300,'clay'=>11025,'iron'=>5710,'crop'=>750,'time'=>224154),array('wood'=>8810,'clay'=>11700,'iron'=>6055,'crop'=>800,'time'=>237845),array('wood'=>9310,'clay'=>12365,'iron'=>6400,'crop'=>845,'time'=>251342),array('wood'=>9800,'clay'=>13020,'iron'=>6740,'crop'=>890,'time'=>264660),array('wood'=>10290,'clay'=>13665,'iron'=>7075,'crop'=>930,'time'=>277812),array('wood'=>10770,'clay'=>14305,'iron'=>7405,'crop'=>975,'time'=>290811),array('wood'=>11245,'clay'=>14935,'iron'=>7730,'crop'=>1020,'time'=>303665),array('wood'=>11720,'clay'=>15565,'iron'=>8055,'crop'=>1060,'time'=>316385));
$ab41=array(1=>array('wood'=>765,'clay'=>625,'iron'=>480,'crop'=>440,'time'=>3960),array('wood'=>1330,'clay'=>1090,'iron'=>835,'crop'=>765,'time'=>6895),array('wood'=>1840,'clay'=>1505,'iron'=>1155,'crop'=>1060,'time'=>9537),array('wood'=>2320,'clay'=>1895,'iron'=>1455,'crop'=>1335,'time'=>12004),array('wood'=>2770,'clay'=>2265,'iron'=>1740,'crop'=>1595,'time'=>14351),array('wood'=>3210,'clay'=>2620,'iron'=>2015,'crop'=>1845,'time'=>16604),array('wood'=>3630,'clay'=>2965,'iron'=>2275,'crop'=>2085,'time'=>18783),array('wood'=>4040,'clay'=>3300,'iron'=>2535,'crop'=>2320,'time'=>20901),array('wood'=>4435,'clay'=>3625,'iron'=>2785,'crop'=>2550,'time'=>22966),array('wood'=>4825,'clay'=>3945,'iron'=>3030,'crop'=>2775,'time'=>24986),array('wood'=>5210,'clay'=>4255,'iron'=>3270,'crop'=>2995,'time'=>26966),array('wood'=>5585,'clay'=>4565,'iron'=>3505,'crop'=>3210,'time'=>28909),array('wood'=>5955,'clay'=>4865,'iron'=>3735,'crop'=>3425,'time'=>30821),array('wood'=>6320,'clay'=>5160,'iron'=>3965,'crop'=>3635,'time'=>32704),array('wood'=>6675,'clay'=>5455,'iron'=>4190,'crop'=>3840,'time'=>34560),array('wood'=>7030,'clay'=>5745,'iron'=>4410,'crop'=>4045,'time'=>36391),array('wood'=>7380,'clay'=>6030,'iron'=>4630,'crop'=>4245,'time'=>38199),array('wood'=>7725,'clay'=>6310,'iron'=>4845,'crop'=>4445,'time'=>39986),array('wood'=>8065,'clay'=>6590,'iron'=>5060,'crop'=>4640,'time'=>41754),array('wood'=>8405,'clay'=>6865,'iron'=>5275,'crop'=>4835,'time'=>43503));
$ab42=array(1=>array('wood'=>1115,'clay'=>590,'iron'=>795,'crop'=>440,'time'=>5160),array('wood'=>1940,'clay'=>1025,'iron'=>1385,'crop'=>765,'time'=>8984),array('wood'=>2685,'clay'=>1420,'iron'=>1915,'crop'=>1060,'time'=>12426),array('wood'=>3380,'clay'=>1790,'iron'=>2410,'crop'=>1335,'time'=>15642),array('wood'=>4040,'clay'=>2140,'iron'=>2880,'crop'=>1595,'time'=>18699),array('wood'=>4675,'clay'=>2475,'iron'=>3335,'crop'=>1845,'time'=>21636),array('wood'=>5290,'clay'=>2800,'iron'=>3770,'crop'=>2085,'time'=>24475),array('wood'=>5885,'clay'=>3115,'iron'=>4195,'crop'=>2320,'time'=>27235),array('wood'=>6465,'clay'=>3420,'iron'=>4610,'crop'=>2550,'time'=>29926),array('wood'=>7035,'clay'=>3725,'iron'=>5015,'crop'=>2775,'time'=>32557),array('wood'=>7595,'clay'=>4020,'iron'=>5415,'crop'=>2995,'time'=>35137),array('wood'=>8140,'clay'=>4305,'iron'=>5805,'crop'=>3210,'time'=>37670),array('wood'=>8680,'clay'=>4590,'iron'=>6190,'crop'=>3425,'time'=>40161),array('wood'=>9210,'clay'=>4875,'iron'=>6565,'crop'=>3635,'time'=>42614),array('wood'=>9730,'clay'=>5150,'iron'=>6940,'crop'=>3840,'time'=>45032),array('wood'=>10245,'clay'=>5420,'iron'=>7305,'crop'=>4045,'time'=>47418),array('wood'=>10755,'clay'=>5690,'iron'=>7670,'crop'=>4245,'time'=>49775),array('wood'=>11260,'clay'=>5960,'iron'=>8030,'crop'=>4445,'time'=>52104),array('wood'=>11755,'clay'=>6220,'iron'=>8380,'crop'=>4640,'time'=>54407),array('wood'=>12250,'clay'=>6480,'iron'=>8735,'crop'=>4835,'time'=>56686));
$ab43=array(1=>array('wood'=>1010,'clay'=>940,'iron'=>1390,'crop'=>650,'time'=>5400),array('wood'=>1760,'clay'=>1635,'iron'=>2420,'crop'=>1130,'time'=>9402),array('wood'=>2430,'clay'=>2265,'iron'=>3345,'crop'=>1565,'time'=>13004),array('wood'=>3060,'clay'=>2850,'iron'=>4215,'crop'=>1970,'time'=>16370),array('wood'=>3660,'clay'=>3405,'iron'=>5035,'crop'=>2355,'time'=>19569),array('wood'=>4235,'clay'=>3940,'iron'=>5830,'crop'=>2725,'time'=>22642),array('wood'=>4790,'clay'=>4460,'iron'=>6595,'crop'=>3085,'time'=>25614),array('wood'=>5330,'clay'=>4960,'iron'=>7335,'crop'=>3430,'time'=>28501),array('wood'=>5860,'clay'=>5450,'iron'=>8060,'crop'=>3770,'time'=>31318),array('wood'=>6375,'clay'=>5930,'iron'=>8770,'crop'=>4100,'time'=>34072),array('wood'=>6880,'clay'=>6400,'iron'=>9465,'crop'=>4425,'time'=>36771),array('wood'=>7375,'clay'=>6860,'iron'=>10150,'crop'=>4745,'time'=>39422),array('wood'=>7860,'clay'=>7315,'iron'=>10820,'crop'=>5060,'time'=>42029),array('wood'=>8340,'clay'=>7765,'iron'=>11480,'crop'=>5370,'time'=>44596),array('wood'=>8815,'clay'=>8205,'iron'=>12130,'crop'=>5675,'time'=>47127),array('wood'=>9280,'clay'=>8640,'iron'=>12775,'crop'=>5975,'time'=>49624),array('wood'=>9745,'clay'=>9065,'iron'=>13410,'crop'=>6270,'time'=>52090),array('wood'=>10200,'clay'=>9490,'iron'=>14035,'crop'=>6565,'time'=>54527),array('wood'=>10650,'clay'=>9910,'iron'=>14655,'crop'=>6855,'time'=>56937),array('wood'=>11095,'clay'=>10325,'iron'=>15270,'crop'=>7140,'time'=>59322));
$ab44=array(1=>array('wood'=>1220,'clay'=>800,'iron'=>550,'crop'=>510,'time'=>5160),array('wood'=>2125,'clay'=>1395,'iron'=>960,'crop'=>890,'time'=>8984),array('wood'=>2940,'clay'=>1925,'iron'=>1325,'crop'=>1230,'time'=>12426),array('wood'=>3700,'clay'=>2425,'iron'=>1665,'crop'=>1545,'time'=>15642),array('wood'=>4420,'clay'=>2900,'iron'=>1995,'crop'=>1850,'time'=>18699),array('wood'=>5115,'clay'=>3355,'iron'=>2305,'crop'=>2140,'time'=>21636),array('wood'=>5785,'clay'=>3795,'iron'=>2610,'crop'=>2420,'time'=>24475),array('wood'=>6440,'clay'=>4220,'iron'=>2905,'crop'=>2690,'time'=>27235),array('wood'=>7075,'clay'=>4640,'iron'=>3190,'crop'=>2960,'time'=>29926),array('wood'=>7700,'clay'=>5050,'iron'=>3470,'crop'=>3220,'time'=>32557),array('wood'=>8310,'clay'=>5450,'iron'=>3745,'crop'=>3475,'time'=>35137),array('wood'=>8905,'clay'=>5840,'iron'=>4015,'crop'=>3725,'time'=>37670),array('wood'=>9495,'clay'=>6225,'iron'=>4280,'crop'=>3970,'time'=>40161),array('wood'=>10075,'clay'=>6605,'iron'=>4540,'crop'=>4210,'time'=>42614),array('wood'=>10645,'clay'=>6980,'iron'=>4800,'crop'=>4450,'time'=>45032),array('wood'=>11210,'clay'=>7350,'iron'=>5055,'crop'=>4685,'time'=>47418),array('wood'=>11770,'clay'=>7715,'iron'=>5305,'crop'=>4920,'time'=>49775),array('wood'=>12320,'clay'=>8080,'iron'=>5555,'crop'=>5150,'time'=>52104),array('wood'=>12865,'clay'=>8435,'iron'=>5800,'crop'=>5375,'time'=>54407),array('wood'=>13400,'clay'=>8790,'iron'=>6040,'crop'=>5605,'time'=>56686));
$ab45=array(1=>array('wood'=>1345,'clay'=>995,'iron'=>1115,'crop'=>345,'time'=>9000),array('wood'=>2340,'clay'=>1730,'iron'=>1940,'crop'=>595,'time'=>15670),array('wood'=>3240,'clay'=>2395,'iron'=>2685,'crop'=>825,'time'=>21674),array('wood'=>4075,'clay'=>3015,'iron'=>3380,'crop'=>1040,'time'=>27283),array('wood'=>4875,'clay'=>3605,'iron'=>4040,'crop'=>1240,'time'=>32615),array('wood'=>5640,'clay'=>4170,'iron'=>4675,'crop'=>1435,'time'=>37737),array('wood'=>6380,'clay'=>4720,'iron'=>5290,'crop'=>1625,'time'=>42689),array('wood'=>7100,'clay'=>5250,'iron'=>5885,'crop'=>1810,'time'=>47502),array('wood'=>7800,'clay'=>5770,'iron'=>6465,'crop'=>1985,'time'=>52196),array('wood'=>8485,'clay'=>6280,'iron'=>7035,'crop'=>2160,'time'=>56786),array('wood'=>9160,'clay'=>6775,'iron'=>7595,'crop'=>2330,'time'=>61285),array('wood'=>9820,'clay'=>7265,'iron'=>8140,'crop'=>2500,'time'=>65703),array('wood'=>10470,'clay'=>7745,'iron'=>8680,'crop'=>2665,'time'=>70048),array('wood'=>11110,'clay'=>8215,'iron'=>9210,'crop'=>2830,'time'=>74327),array('wood'=>11740,'clay'=>8685,'iron'=>9730,'crop'=>2990,'time'=>78544),array('wood'=>12360,'clay'=>9145,'iron'=>10245,'crop'=>3145,'time'=>82706),array('wood'=>12975,'clay'=>9600,'iron'=>10755,'crop'=>3305,'time'=>86816),array('wood'=>13580,'clay'=>10045,'iron'=>11260,'crop'=>3460,'time'=>90878),array('wood'=>14180,'clay'=>10490,'iron'=>11755,'crop'=>3610,'time'=>94895),array('wood'=>14775,'clay'=>10930,'iron'=>12250,'crop'=>3765,'time'=>98870));
$ab46=array(1=>array('wood'=>1085,'clay'=>1235,'iron'=>1185,'crop'=>240,'time'=>10680),array('wood'=>1885,'clay'=>2150,'iron'=>2065,'crop'=>420,'time'=>18595),array('wood'=>2610,'clay'=>2975,'iron'=>2860,'crop'=>580,'time'=>25720),array('wood'=>3285,'clay'=>3745,'iron'=>3595,'crop'=>730,'time'=>32376),array('wood'=>3925,'clay'=>4475,'iron'=>4300,'crop'=>870,'time'=>38703),array('wood'=>4540,'clay'=>5180,'iron'=>4975,'crop'=>1005,'time'=>44781),array('wood'=>5140,'clay'=>5860,'iron'=>5630,'crop'=>1140,'time'=>50658),array('wood'=>5720,'clay'=>6520,'iron'=>6265,'crop'=>1265,'time'=>56369),array('wood'=>6285,'clay'=>7160,'iron'=>6880,'crop'=>1390,'time'=>61939),array('wood'=>6835,'clay'=>7790,'iron'=>7485,'crop'=>1515,'time'=>67386),array('wood'=>7375,'clay'=>8410,'iron'=>8080,'crop'=>1635,'time'=>72725),array('wood'=>7910,'clay'=>9015,'iron'=>8665,'crop'=>1750,'time'=>77968),array('wood'=>8430,'clay'=>9610,'iron'=>9235,'crop'=>1870,'time'=>83124),array('wood'=>8945,'clay'=>10200,'iron'=>9800,'crop'=>1980,'time'=>88201),array('wood'=>9455,'clay'=>10780,'iron'=>10355,'crop'=>2095,'time'=>93206),array('wood'=>9955,'clay'=>11350,'iron'=>10905,'crop'=>2205,'time'=>98145),array('wood'=>10450,'clay'=>11915,'iron'=>11445,'crop'=>2315,'time'=>103022),array('wood'=>10940,'clay'=>12470,'iron'=>11980,'crop'=>2425,'time'=>107842),array('wood'=>11425,'clay'=>13020,'iron'=>12510,'crop'=>2530,'time'=>112609),array('wood'=>11900,'clay'=>13565,'iron'=>13035,'crop'=>2635,'time'=>117326));
$ab47=array(1=>array('wood'=>2365,'clay'=>735,'iron'=>885,'crop'=>215,'time'=>14400),array('wood'=>4120,'clay'=>1275,'iron'=>1540,'crop'=>375,'time'=>25072),array('wood'=>5700,'clay'=>1765,'iron'=>2125,'crop'=>520,'time'=>34678),array('wood'=>7175,'clay'=>2225,'iron'=>2680,'crop'=>655,'time'=>43653),array('wood'=>8575,'clay'=>2660,'iron'=>3200,'crop'=>785,'time'=>52184),array('wood'=>9925,'clay'=>3075,'iron'=>3705,'crop'=>910,'time'=>60379),array('wood'=>11225,'clay'=>3480,'iron'=>4190,'crop'=>1030,'time'=>68303),array('wood'=>12490,'clay'=>3870,'iron'=>4660,'crop'=>1145,'time'=>76004),array('wood'=>13725,'clay'=>4255,'iron'=>5125,'crop'=>1255,'time'=>83513),array('wood'=>14935,'clay'=>4625,'iron'=>5575,'crop'=>1365,'time'=>90858),array('wood'=>16115,'clay'=>4995,'iron'=>6015,'crop'=>1475,'time'=>98057),array('wood'=>17280,'clay'=>5355,'iron'=>6450,'crop'=>1580,'time'=>105125),array('wood'=>18420,'clay'=>5710,'iron'=>6875,'crop'=>1685,'time'=>112077),array('wood'=>19545,'clay'=>6055,'iron'=>7295,'crop'=>1790,'time'=>118923),array('wood'=>20655,'clay'=>6400,'iron'=>7710,'crop'=>1890,'time'=>125671),array('wood'=>21750,'clay'=>6740,'iron'=>8115,'crop'=>1990,'time'=>132330),array('wood'=>22830,'clay'=>7075,'iron'=>8520,'crop'=>2090,'time'=>138906),array('wood'=>23900,'clay'=>7405,'iron'=>8920,'crop'=>2190,'time'=>145405),array('wood'=>24955,'clay'=>7730,'iron'=>9315,'crop'=>2285,'time'=>151833),array('wood'=>26000,'clay'=>8055,'iron'=>9705,'crop'=>2380,'time'=>158193));
$ab48=array(1=>array('wood'=>1065,'clay'=>1415,'iron'=>735,'crop'=>95,'time'=>28800),array('wood'=>1855,'clay'=>2465,'iron'=>1275,'crop'=>170,'time'=>50144),array('wood'=>2570,'clay'=>3410,'iron'=>1765,'crop'=>235,'time'=>69357),array('wood'=>3235,'clay'=>4295,'iron'=>2225,'crop'=>295,'time'=>87305),array('wood'=>3865,'clay'=>5135,'iron'=>2660,'crop'=>350,'time'=>104368),array('wood'=>4470,'clay'=>5940,'iron'=>3075,'crop'=>405,'time'=>120757),array('wood'=>5060,'clay'=>6720,'iron'=>3480,'crop'=>460,'time'=>136606),array('wood'=>5630,'clay'=>7475,'iron'=>3870,'crop'=>510,'time'=>152007),array('wood'=>6185,'clay'=>8215,'iron'=>4255,'crop'=>560,'time'=>167027),array('wood'=>6730,'clay'=>8940,'iron'=>4625,'crop'=>610,'time'=>181716),array('wood'=>7265,'clay'=>9645,'iron'=>4995,'crop'=>660,'time'=>196113),array('wood'=>7785,'clay'=>10340,'iron'=>5355,'crop'=>705,'time'=>210251),array('wood'=>8300,'clay'=>11025,'iron'=>5710,'crop'=>750,'time'=>224154),array('wood'=>8810,'clay'=>11700,'iron'=>6055,'crop'=>800,'time'=>237845),array('wood'=>9310,'clay'=>12365,'iron'=>6400,'crop'=>845,'time'=>251342),array('wood'=>9800,'clay'=>13020,'iron'=>6740,'crop'=>890,'time'=>264660),array('wood'=>10290,'clay'=>13665,'iron'=>7075,'crop'=>930,'time'=>277812),array('wood'=>10770,'clay'=>14305,'iron'=>7405,'crop'=>975,'time'=>290811),array('wood'=>11245,'clay'=>14935,'iron'=>7730,'crop'=>1020,'time'=>303665),array('wood'=>11720,'clay'=>15565,'iron'=>8055,'crop'=>1060,'time'=>316385));
?>
+91
View File
@@ -0,0 +1,91 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename unitdata.php ##
## Developed by: Akakori ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
$unitsbytype=array('infantry'=>array(1,2,3,11,12,13,14,21,22,31,32,33,34,41,42,43,44),'cavalry'=>array(4,5,6,15,16,23,24,25,26,35,36,45,46),'siege'=>array(7,8,17,18,27,28,37,38,47,48),'ram'=>array(7,17,27,47),'catapult'=>array(8,18,28,48),'expansion'=>array(9,10,19,20,29,30,39,40,49,50),'scout'=>array(4,14,23,44),'chief'=>array(9,19,29,49));
$u1=array('atk'=>40,'di'=>35,'dc'=>50,'wood'=>120,'clay'=>100,'iron'=>150,'crop'=>30,'pop'=>1,'speed'=>6,'time'=>1600,'cap'=>50);
$u2=array('atk'=>30,'di'=>65,'dc'=>35,'wood'=>100,'clay'=>130,'iron'=>160,'crop'=>70,'pop'=>1,'speed'=>5,'time'=>1760,'cap'=>20);
$u3=array('atk'=>70,'di'=>40,'dc'=>25,'wood'=>150,'clay'=>160,'iron'=>210,'crop'=>80,'pop'=>1,'speed'=>7,'time'=>1920,'cap'=>50);
$u4=array('atk'=>0,'di'=>20,'dc'=>10,'wood'=>140,'clay'=>160,'iron'=>20,'crop'=>40,'pop'=>2,'speed'=>16,'time'=>1360,'cap'=>0);
$u5=array('atk'=>120,'di'=>65,'dc'=>50,'wood'=>550,'clay'=>440,'iron'=>320,'crop'=>100,'pop'=>3,'speed'=>14,'time'=>2640,'cap'=>100);
$u6=array('atk'=>180,'di'=>80,'dc'=>105,'wood'=>550,'clay'=>640,'iron'=>800,'crop'=>180,'pop'=>4,'speed'=>10,'time'=>3520,'cap'=>70);
$u7=array('atk'=>60,'di'=>30,'dc'=>75,'wood'=>900,'clay'=>360,'iron'=>500,'crop'=>70,'pop'=>3,'speed'=>4,'time'=>4600,'cap'=>0);
$u8=array('atk'=>75,'di'=>60,'dc'=>10,'wood'=>950,'clay'=>1350,'iron'=>600,'crop'=>90,'pop'=>6,'speed'=>3,'time'=>9000,'cap'=>0);
$u9=array('atk'=>50,'di'=>40,'dc'=>30,'wood'=>30750,'clay'=>27200,'iron'=>45000,'crop'=>37500,'pop'=>5,'speed'=>5,'time'=>90700,'cap'=>0);
$u10=array('atk'=>0,'di'=>80,'dc'=>80,'wood'=>5800,'clay'=>5300,'iron'=>7200,'crop'=>5500,'pop'=>1,'speed'=>5,'time'=>26900,'cap'=>3000);
$u11=array('atk'=>40,'di'=>20,'dc'=>5,'wood'=>95,'clay'=>75,'iron'=>40,'crop'=>40,'pop'=>1,'speed'=>7,'time'=>720,'cap'=>60);
$u12=array('atk'=>10,'di'=>35,'dc'=>60,'wood'=>145,'clay'=>70,'iron'=>85,'crop'=>40,'pop'=>1,'speed'=>7,'time'=>1120,'cap'=>40);
$u13=array('atk'=>60,'di'=>30,'dc'=>30,'wood'=>130,'clay'=>120,'iron'=>170,'crop'=>70,'pop'=>1,'speed'=>6,'time'=>1200,'cap'=>50);
$u14=array('atk'=>0,'di'=>10,'dc'=>5,'wood'=>160,'clay'=>100,'iron'=>50,'crop'=>50,'pop'=>1,'speed'=>9,'time'=>1120,'cap'=>0);
$u15=array('atk'=>55,'di'=>100,'dc'=>40,'wood'=>370,'clay'=>270,'iron'=>290,'crop'=>75,'pop'=>2,'speed'=>10,'time'=>2400,'cap'=>110);
$u16=array('atk'=>150,'di'=>50,'dc'=>75,'wood'=>450,'clay'=>515,'iron'=>480,'crop'=>80,'pop'=>3,'speed'=>9,'time'=>2960,'cap'=>80);
$u17=array('atk'=>65,'di'=>30,'dc'=>80,'wood'=>1000,'clay'=>300,'iron'=>350,'crop'=>70,'pop'=>3,'speed'=>4,'time'=>4200,'cap'=>0);
$u18=array('atk'=>50,'di'=>60,'dc'=>10,'wood'=>900,'clay'=>1200,'iron'=>600,'crop'=>60,'pop'=>6,'speed'=>3,'time'=>9000,'cap'=>0);
$u19=array('atk'=>40,'di'=>60,'dc'=>40,'wood'=>35500,'clay'=>26600,'iron'=>25000,'crop'=>27200,'pop'=>4,'speed'=>5,'time'=>70500,'cap'=>0);
$u20=array('atk'=>10,'di'=>80,'dc'=>80,'wood'=>7200,'clay'=>5500,'iron'=>5800,'crop'=>6500,'pop'=>1,'speed'=>5,'time'=>31000,'cap'=>3000);
$u21=array('atk'=>15,'di'=>40,'dc'=>50,'wood'=>100,'clay'=>130,'iron'=>55,'crop'=>30,'pop'=>1,'speed'=>7,'time'=>1040,'cap'=>35);
$u22=array('atk'=>65,'di'=>35,'dc'=>20,'wood'=>140,'clay'=>150,'iron'=>185,'crop'=>60,'pop'=>1,'speed'=>6,'time'=>1440,'cap'=>45);
$u23=array('atk'=>0,'di'=>20,'dc'=>10,'wood'=>170,'clay'=>150,'iron'=>20,'crop'=>40,'pop'=>2,'speed'=>17,'time'=>1360,'cap'=>0);
$u24=array('atk'=>90,'di'=>25,'dc'=>40,'wood'=>350,'clay'=>450,'iron'=>230,'crop'=>60,'pop'=>2,'speed'=>19,'time'=>2480,'cap'=>75);
$u25=array('atk'=>45,'di'=>115,'dc'=>55,'wood'=>360,'clay'=>330,'iron'=>280,'crop'=>120,'pop'=>2,'speed'=>16,'time'=>2560,'cap'=>35);
$u26=array('atk'=>140,'di'=>50,'dc'=>165,'wood'=>500,'clay'=>620,'iron'=>675,'crop'=>170,'pop'=>3,'speed'=>13,'time'=>3120,'cap'=>65);
$u27=array('atk'=>50,'di'=>30,'dc'=>105,'wood'=>950,'clay'=>555,'iron'=>330,'crop'=>75,'pop'=>3,'speed'=>4,'time'=>5000,'cap'=>0);
$u28=array('atk'=>70,'di'=>45,'dc'=>10,'wood'=>960,'clay'=>1450,'iron'=>630,'crop'=>90,'pop'=>6,'speed'=>3,'time'=>9000,'cap'=>0);
$u29=array('atk'=>40,'di'=>50,'dc'=>50,'wood'=>30750,'clay'=>45400,'iron'=>31000,'crop'=>37500,'pop'=>4,'speed'=>4,'time'=>90700,'cap'=>0);
$u30=array('atk'=>0,'di'=>80,'dc'=>80,'wood'=>5500,'clay'=>7000,'iron'=>5300,'crop'=>4900,'pop'=>1,'speed'=>5,'time'=>22700,'cap'=>3000);
$u31=array('atk'=>10,'di'=>25,'dc'=>20,'wood'=>85,'clay'=>75,'iron'=>120,'crop'=>25,'speed'=>7,'pop'=>1,'time'=>1600,'cap'=>45);
$u32=array('atk'=>20,'di'=>35,'dc'=>40,'wood'=>125,'clay'=>130,'iron'=>60,'crop'=>40,'speed'=>7,'pop'=>1,'time'=>1800,'cap'=>65);
$u33=array('atk'=>60,'di'=>40,'dc'=>60,'wood'=>140,'clay'=>150,'iron'=>40,'crop'=>60,'speed'=>6,'pop'=>1,'time'=>1900,'cap'=>80);
$u34=array('atk'=>10,'di'=>66,'dc'=>50,'wood'=>95,'clay'=>120,'iron'=>65,'crop'=>25,'speed'=>9,'pop'=>1,'time'=>2000,'cap'=>0);
$u35=array('atk'=>50,'di'=>70,'dc'=>33,'wood'=>250,'clay'=>200,'iron'=>125,'crop'=>45,'speed'=>10,'pop'=>2,'time'=>2000,'cap'=>120);
$u36=array('atk'=>100,'di'=>80,'dc'=>70,'wood'=>250,'clay'=>125,'iron'=>250,'crop'=>150,'speed'=>9,'pop'=>2,'time'=>2000,'cap'=>150);
$u37=array('atk'=>250,'di'=>140,'dc'=>200,'wood'=>250,'clay'=>220,'iron'=>135,'crop'=>50,'speed'=>4,'pop'=>3,'time'=>2000,'cap'=>125);
$u38=array('atk'=>450,'di'=>380,'dc'=>240,'wood'=>125,'clay'=>250,'iron'=>300,'crop'=>65,'speed'=>3,'pop'=>3,'time'=>2000,'cap'=>0);
$u39=array('atk'=>200,'di'=>170,'dc'=>250,'wood'=>350,'clay'=>350,'iron'=>125,'crop'=>80,'speed'=>5,'pop'=>3,'time'=>70500,'cap'=>0);
$u40=array('atk'=>600,'di'=>440,'dc'=>520,'wood'=>350,'clay'=>250,'iron'=>135,'crop'=>100,'speed'=>5,'pop'=>5,'time'=>31000,'cap'=>3000);
$u41=array('atk'=>20,'di'=>35,'dc'=>50,'wood'=>105,'clay'=>110,'iron'=>85,'crop'=>50,'pop'=>1,'speed'=>10,'time'=>1100,'cap'=>25);
$u42=array('atk'=>65,'di'=>30,'dc'=>10,'wood'=>95,'clay'=>145,'iron'=>100,'crop'=>55,'pop'=>1,'speed'=>9,'time'=>1300,'cap'=>55);
$u43=array('atk'=>100,'di'=>90,'dc'=>75,'wood'=>125,'clay'=>165,'iron'=>130,'crop'=>75,'pop'=>1,'speed'=>15,'time'=>1500,'cap'=>60);
$u44=array('atk'=>0,'di'=>10,'dc'=>0,'wood'=>50,'clay'=>25,'iron'=>20,'crop'=>5,'pop'=>2,'speed'=>20,'time'=>2200,'cap'=>0);
$u45=array('atk'=>155,'di'=>80,'dc'=>50,'wood'=>150,'clay'=>205,'iron'=>135,'crop'=>85,'pop'=>2,'speed'=>22,'time'=>3000,'cap'=>80);
$u46=array('atk'=>170,'di'=>140,'dc'=>80,'wood'=>175,'clay'=>230,'iron'=>200,'crop'=>100,'pop'=>2,'speed'=>20,'time'=>3450,'cap'=>45);
$u47=array('atk'=>250,'di'=>120,'dc'=>150,'wood'=>225,'clay'=>255,'iron'=>230,'crop'=>125,'pop'=>3,'speed'=>17,'time'=>4000,'cap'=>55);
$u48=array('atk'=>60,'di'=>45,'dc'=>10,'wood'=>1500,'clay'=>760,'iron'=>890,'crop'=>390,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u49=array('atk'=>80,'di'=>50,'dc'=>50,'wood'=>37000,'clay'=>30000,'iron'=>32000,'crop'=>33500,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u50=array('atk'=>30,'di'=>40,'dc'=>40,'wood'=>8000,'clay'=>8250,'iron'=>8500,'crop'=>5505,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u51=array('atk'=>10,'di'=>25,'dc'=>20,'wood'=>85,'clay'=>75,'iron'=>120,'crop'=>25,'speed'=>7,'pop'=>1,'time'=>1600,'cap'=>45);
$u52=array('atk'=>20,'di'=>35,'dc'=>40,'wood'=>125,'clay'=>130,'iron'=>60,'crop'=>40,'speed'=>7,'pop'=>1,'time'=>1800,'cap'=>65);
$u53=array('atk'=>60,'di'=>40,'dc'=>60,'wood'=>140,'clay'=>150,'iron'=>40,'crop'=>60,'speed'=>6,'pop'=>1,'time'=>1900,'cap'=>80);
$u54=array('atk'=>10,'di'=>66,'dc'=>50,'wood'=>95,'clay'=>120,'iron'=>65,'crop'=>25,'speed'=>9,'pop'=>1,'time'=>2000,'cap'=>0);
$u55=array('atk'=>50,'di'=>70,'dc'=>33,'wood'=>250,'clay'=>200,'iron'=>125,'crop'=>45,'speed'=>10,'pop'=>2,'time'=>2000,'cap'=>120);
$u56=array('atk'=>100,'di'=>80,'dc'=>70,'wood'=>250,'clay'=>125,'iron'=>250,'crop'=>150,'speed'=>9,'pop'=>2,'time'=>2000,'cap'=>150);
$u57=array('atk'=>250,'di'=>140,'dc'=>200,'wood'=>250,'clay'=>220,'iron'=>135,'crop'=>50,'speed'=>4,'pop'=>3,'time'=>2000,'cap'=>125);
$u58=array('atk'=>450,'di'=>380,'dc'=>240,'wood'=>125,'clay'=>250,'iron'=>300,'crop'=>65,'speed'=>3,'pop'=>3,'time'=>2000,'cap'=>0);
$u59=array('atk'=>200,'di'=>170,'dc'=>250,'wood'=>350,'clay'=>350,'iron'=>125,'crop'=>80,'speed'=>5,'pop'=>3,'time'=>70500,'cap'=>0);
$u60=array('atk'=>600,'di'=>440,'dc'=>520,'wood'=>350,'clay'=>250,'iron'=>135,'crop'=>100,'speed'=>5,'pop'=>5,'time'=>31000,'cap'=>3000);
$u99=array('atk'=>0,'di'=>0,'dc'=>0,'wood'=>20,'clay'=>30,'iron'=>10,'crop'=>20,'speed'=>0,'pop'=>0,'time'=>600,'cap'=>0);
// Hero data base values and increase per point
$h1=array('atk'=>50,'atkp'=>54,'di'=>60,'dip'=>49,'dc'=>85,'dcp'=>62.5);
$h2=array('atk'=>40,'atkp'=>46.5,'di'=>100,'dip'=>75.5,'dc'=>60,'dcp'=>47.5);
$h3=array('atk'=>90,'atkp'=>74,'di'=>65,'dip'=>57,'dc'=>40,'dcp'=>42);
$h5=array('atk'=>150,'atkp'=>107.5,'di'=>100,'dip'=>73,'dc'=>85,'dcp'=>59);
$h6=array('atk'=>225,'atkp'=>147.5,'di'=>135,'dip'=>79,'dc'=>175,'dcp'=>99);
$h11=array('atk'=>50,'atkp'=>54,'di'=>35,'dip'=>49.5,'dc'=>10,'dcp'=>24);
$h12=array('atk'=>15,'atkp'=>34,'di'=>60,'dip'=>48,'dc'=>100,'dcp'=>70.5);
$h13=array('atk'=>75,'atkp'=>67.5,'di'=>50,'dip'=>47.5,'dc'=>50,'dcp'=>47.5);
$h15=array('atk'=>70,'atkp'=>64,'di'=>165,'dip'=>100,'dc'=>65,'dcp'=>39.5);
$h16=array('atk'=>190,'atkp'=>127.5,'di'=>85,'dip'=>58.5,'dc'=>125,'dcp'=>80);
$h21=array('atk'=>20,'atkp'=>37.5,'di'=>65,'dip'=>53,'dc'=>85,'dcp'=>62);
$h22=array('atk'=>80,'atkp'=>71,'di'=>60,'dip'=>54,'dc'=>35,'dcp'=>38);
$h24=array('atk'=>115,'atkp'=>87.5,'di'=>40,'dip'=>42,'dc'=>65,'dcp'=>57);
$h25=array('atk'=>55,'atkp'=>57.5,'di'=>190,'dip'=>108.5,'dc'=>90,'dcp'=>60.5);
$h26=array('atk'=>175,'atkp'=>121,'di'=>85,'dip'=>55,'dc'=>275,'dcp'=>145);
?>
+27
View File
@@ -0,0 +1,27 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Edited by: akshay9, ZZJHONS, songeriux ##
## Filename Database.php ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
include("config.php");
switch(DB_TYPE) {
case 1:
include("Database/db_MYSQLi.php");
break;
//case 2:
//include("Database/db_MSSQL.php");
//break;
default:
include("Database/db_MYSQL.php");
break;
}
## Security
include("Protection.php");
?>
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+81
View File
@@ -0,0 +1,81 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Form.php ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class Form {
private $errorarray = array();
public $valuearray = array();
private $errorcount;
public function Form() {
if(isset($_SESSION['errorarray']) && isset($_SESSION['valuearray'])) {
$this->errorarray = $_SESSION['errorarray'];
$this->valuearray = $_SESSION['valuearray'];
$this->errorcount = count($this->errorarray);
unset($_SESSION['errorarray']);
unset($_SESSION['valuearray']);
}
else {
$this->errorcount = 0;
}
}
public function addError($field,$error) {
$this->errorarray[$field] = $error;
$this->errorcount = count($this->errorarray);
}
public function getError($field) {
if(array_key_exists($field,$this->errorarray)) {
return $this->errorarray[$field];
}
else {
return "";
}
}
public function getValue($field) {
if(array_key_exists($field,$this->valuearray)) {
return $this->valuearray[$field];
}
else {
return "";
}
}
public function getDiff($field,$cookie) {
if(array_key_exists($field,$this->valuearray) && $this->valuearray[$field] != $cookie) {
return $this->valuearray[$field];
}
else {
return $cookie;
}
}
public function getRadio($field,$value) {
if(array_key_exists($field,$this->valuearray) && $this->valuearray[$field] == $value) {
return "checked";
}
else {
return "";
}
}
public function returnErrors() {
return $this->errorcount;
}
public function getErrors() {
return $this->errorarray;
}
};
?>
+16
View File
@@ -0,0 +1,16 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename WorldWonderName.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
include("../Village.php");
$database->submitWWname($_POST['vref'],$_POST['wwname']);
header("Location: ../../build.php?id=99&n");
?>
+165
View File
@@ -0,0 +1,165 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Generator.php ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class Generator {
public function generateRandID(){
return md5($this->generateRandStr(16));
}
public function generateRandStr($length){
$randstr = "";
for($i=0; $i<$length; $i++){
$randnum = mt_rand(0,61);
if($randnum < 10){
$randstr .= chr($randnum+48);
}else if($randnum < 36){
$randstr .= chr($randnum+55);
}else{
$randstr .= chr($randnum+61);
}
}
return $randstr;
}
public function encodeStr($str,$length) {
$encode = md5($str);
return substr($encode,0,$length);
}
public function procDistanceTime($coor,$thiscoor,$ref,$mode) {
global $bid28,$bid14,$building;
$xdistance = ABS($thiscoor['x'] - $coor['x']);
if($xdistance > WORLD_MAX) {
$xdistance = (2 * WORLD_MAX + 1) - $xdistance;
}
$ydistance = ABS($thiscoor['y'] - $coor['y']);
if($ydistance > WORLD_MAX) {
$ydistance = (2 * WORLD_MAX + 1) - $ydistance;
}
$distance = SQRT(POW($xdistance,2)+POW($ydistance,2));
if(!$mode) {
if($ref == 1) {
$speed = 16;
}
else if($ref == 2) {
$speed = 12;
}
else if($ref == 3) {
$speed = 24;
}
else if($ref == 300) {
$speed = 5;
}
else {
$speed = 1;
}
}
else {
$speed = $ref;
if($building->getTypeLevel(14) != 0 && $distance >= TS_THRESHOLD) {
$speed = $speed * ($bid14[$building->gettypeLevel(14)]['attri']/100) ;
}
}
if($speed!=0){
return round(($distance/$speed) * 3600 / INCREASE_SPEED);
}else{
return round($distance * 3600 / INCREASE_SPEED);
}
}
public function getTimeFormat($time) {
$min = 0;
$hr = 0;
$days = 0;
while($time >= 60) :
$time -= 60;
$min += 1;
endwhile;
while ($min >= 60) :
$min -= 60;
$hr += 1;
endwhile;
if ($min < 10) {
$min = "0".$min;
}
if($time < 10) {
$time = "0".$time;
}
return $hr.":".$min.":".$time;
}
public function procMtime($time, $pref = 3) {
/*
$timezone = 7;
switch($timezone) {
case 7:
$time -= 3600;
break;
}
*/
- $time += 3600*0; //Edit this yourself
+ $time += 0; //Edit this yourself
$today = date('d',time())-1;
if (date('Ymd',time()) == date('Ymd',$time)) {
$day = "today";
}elseif($today == date('d',$time)){
$day = "yesterday";
}
else {
switch($pref) {
case 1:
$day = date("m/j/y",$time);
break;
case 2:
$day = date("j/m/y",$time);
break;
case 3:
$day = date("j.m.y",$time);
break;
default:
$day = date("y/m/j",$time);
break;
}
}
$new = date("H:i:s",$time);
if ($pref=="9"||$pref==9)
return $new;
else
return array($day,$new);
}
public function getBaseID($x,$y) {
return ((WORLD_MAX-$y) * (WORLD_MAX*2+1)) + (WORLD_MAX +$x + 1);
}
public function getMapCheck($wref) {
return substr(md5($wref),5,2);
}
public function pageLoadTimeStart() {
$starttime = microtime();
$startarray = explode(" ", $starttime);
//$starttime = $startarray[1] + $startarray[0];
return $startarray[0];
}
public function pageLoadTimeEnd() {
$endtime = microtime();
$endarray = explode(" ", $endtime);
//$endtime = $endarray[1] + $endarray[0];
return $endarray[0];
}
};
$generator = new Generator;
+374
View File
@@ -0,0 +1,374 @@
<?php
//////////////////////////////////////////////////////////////////////////////////////////////////////
// TRAVIANX //
// Only for advanced users, do not edit if you dont know what are you doing! //
// Made by: Dzoki & Dixie (TravianX) //
// - TravianX = Travian Clone Project - //
// DO NOT REMOVE COPYRIGHT NOTICE! //
//////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// ENGLISH //
// Author: Dzoki //
/////////////////////////////
//MAIN MENU
define("TRIBE1","Romans");
define("TRIBE2","Teutons");
define("TRIBE3","Gauls");
define("TRIBE4","Nature");
define("TRIBE5","Natars");
define("TRIBE6","Monsters");
define("HOME","Homepage");
define("INSTRUCT","Instructions");
define("ADMIN_PANEL","Admin Panel");
define("MASS_MESSAGE","Mass Message");
define("LOGOUT","Logout");
define("PROFILE","Profile");
define("SUPPORT","Support");
define("UPDATE_T_10","Update Top 10");
define("SYSTEM_MESSAGE","System message");
define("TRAVIAN_PLUS","Travian <b><span class=\"plus_g\">P</span><span class=\"plus_o\">l</span><span class=\"plus_g\">u</span><span class=\"plus_o\">s</span></span></span></b>");
define("CONTACT","Contact us!");
define("GAME_RULES","Game Rules");
//MENU
define("REG","Register");
define("FORUM","Forum");
define("CHAT","Chat");
define("IMPRINT","Imprint");
define("MORE_LINKS","More Links");
define("TOUR","Game Tour");
//ERRORS
define("USRNM_EMPTY","(Username empty)");
define("USRNM_TAKEN","(Name is already in use.)");
define("USRNM_SHORT","(min. ".USRNM_MIN_LENGTH." figures)");
define("USRNM_CHAR","(Invalid Characters)");
define("PW_EMPTY","(Password empty)");
define("PW_SHORT","(min. ".PW_MIN_LENGTH." figures)");
define("PW_INSECURE","(Password insecure. Please choose a more secure one.)");
define("EMAIL_EMPTY","(Email Empty)");
define("EMAIL_INVALID","(Invalid email address)");
define("EMAIL_TAKEN","(Email is already in use)");
define("TRIBE_EMPTY","<li>Please choose a tribe.</li>");
define("AGREE_ERROR","<li>You have to agree to the game rules and the general terms & conditions in order to register.</li>");
define("LOGIN_USR_EMPTY","Enter name.");
define("LOGIN_PASS_EMPTY","Enter password.");
define("EMAIL_ERROR","Email does not match existing");
define("PASS_MISMATCH","Passwords do not match");
define("ALLI_OWNER","Please appoint an alliance owner before deleting");
define("SIT_ERROR","Sitter already set");
define("USR_NT_FOUND","Name does not exist.");
define("LOGIN_PW_ERROR","The password is wrong.");
define("WEL_TOPIC","Useful tips & information ");
define("ATAG_EMPTY","Tag empty");
define("ANAME_EMPTY","Name empty");
define("ATAG_EXIST","Tag taken");
define("ANAME_EXIST","Name taken");
define("NOT_OPENED_YET","Server not started yet.");
define("REGISTER_CLOSED","The register is closed. You can't register to this server.");
define("NAME_EMPTY","Please insert name");
define("NAME_NO_EXIST","There is no user with the name ");
define("ID_NO_EXIST","There is no user with the id ");
define("SAME_NAME","You can't invite yourself");
define("ALREADY_INVITED"," already invited");
define("ALREADY_IN_ALLY"," already in this alliance");
//COPYRIGHT
define("TRAVIAN_COPYRIGHT","TravianZ 100% Open Source Travian Clone.");
//BUILD.TPL
define("CUR_PROD","Current production");
define("NEXT_PROD","Production at level ");
//BUILDINGS
define("B1","Woodcutter");
define("B1_DESC","The Woodcutter cuts down trees in order to produce lumber. The further you extend the woodcutter the more lumber is produced by him.");
define("B2","Clay Pit");
define("B2_DESC","Clay is produced here. By increasing its level you increase its clay production.");
define("B3","Iron Mine");
define("B3_DESC","Here miners produce the precious resource iron. By increasing the mine`s level you increase its iron production.");
define("B4","Cropland");
define("B4_DESC","Your population`s food is produced here. By increasing the farm`s level you increase its crop production.");
//DORF1
define("LUMBER","Lumber");
define("CLAY","Clay");
define("IRON","Iron");
define("CROP","Crop");
define("LEVEL","Level");
define("CROP_COM",CROP." consumption");
define("PER_HR","per hour");
define("PROD_HEADER","Production");
define("MULTI_V_HEADER","Villages");
define("ANNOUNCEMENT","Announcement");
define("GO2MY_VILLAGE","Go to my village");
define("VILLAGE_CENTER","Village centre");
define("FINISH_GOLD","Finish all construction and research orders in this village immediately for 2 Gold?");
define("WAITING_LOOP","(waiting loop)");
define("HRS","(hrs.)");
define("DONE_AT","done at");
define("CANCEL","cancel");
define("LOYALTY","Loyalty:");
define("CALCULATED_IN","Calculated in");
define("SEVER_TIME","Server time:");
//QUEST
define("Q_CONTINUE","Continue with the next task.");
define("Q_REWARD","Your reward:");
define("Q0","Welcome to ");
define("Q0_DESC","As I see you have been made chieftain of this little village. I will be your counselor for the first few days and never leave your (right hand) side.");
define("Q0_OPT1","To the first task.");
define("Q0_OPT2","Look around on your own.");
define("Q0_OPT3","Play no tasks.");
define("Q1","Task 1: Woodcutter");
define("Q1_DESC","There are four green forests around your village. Construct a woodcutter on one of them. Lumber is an important resource for our new settlement.");
define("Q1_ORDER","Order:<\/p>Construct a woodcutter.");
define("Q1_RESP","Yes, that way you gain more lumber.I helped a bit and completed the order instantly.");
define("Q1_REWARD","Woodcutter instantly completed.");
define("Q2","Task 2: Crop");
define("Q2_DESC","Now your subjects are hungry from working all day. Extend a cropland to improve your subjects' supply. Come back here once the building is complete.");
define("Q2_ORDER","Order:<\/p>Extend one cropland.");
define("Q2_RESP","Very good. Now your subjects have enough to eat again...");
define("Q3","Task 3: Your Village's Name");
define("Q3_DESC","Creative as you are you can grant your village the ultimate name.\r\n<br \/><br \/>\r\nClick on 'profile' in the left hand menu and then select 'change profile'...");
define("Q3_ORDER","Order:<\/p>Change your village's name to something nice.");
define("Q3_RESP","Wow, a great name for their village. It could have been the name of my village!...");
define("Q4","Task 4: Other Players");
define("Q4_DESC","In ". SERVER_NAME ." you play along with billions of other players. Click 'statistics' in the top menu to look up your rank and enter it here.");
define("Q4_ORDER","Order:<\/p>Look for your rank in the statistics and enter it here.");
define("Q4_BUTN","complete task");
define("Q4_RESP","Exactly! That's your rank.");
define("Q5","Task 5: Two Building Orders");
define("Q5_DESC","Build an iron mine and a clay pit. Of iron and clay one can never have enough.");
define("Q5_ORDER","Order:<\/p><ul><li>Extend one iron mine.<\/li><li>Extend one clay pit.<\/li><\/ul>");
define("Q5_RESP","As you noticed, building orders take rather long. The world of ". SERVER_NAME ." will continue to spin even if you are offline. Even in a few months there will be many new things for you to discover.\r\n<br \/><br \/>\r\nThe best thing to do is occasionally checking your village and giving you subjects new tasks to do.");
define("Q6","Message From The Taskmaster");
define("Q6_DESC","You are to be informed that a nice reward is waiting for you at the taskmaster.<br /><br />Hint: The message has been generated automatically. An answer is not necessary.");
define("Q5","Task 5: Two Building Orders");
define("Q5_DESC","Build an iron mine and a clay pit. Of iron and clay one can never have enough.");
define("Q5_ORDER","Order:<\/p><ul><li>Extend one iron mine.<\/li><li>Extend one clay pit.<\/li><\/ul>");
define("Q5_RESP","As you noticed, building orders take rather long. The world of ". SERVER_NAME ." will continue to spin even if you are offline. Even in a few months there will be many new things for you to discover.\r\n<br \/><br \/>\r\nThe best thing to do is occasionally checking your village and giving you subjects new tasks to do.");
//======================================================//
//================ UNITS - DO NOT EDIT! ================//
//======================================================//
define("U0","Hero");
//ROMAN UNITS
define("U1","Legionnaire");
define("U2","Praetorian");
define("U3","Imperian");
define("U4","Equites Legati");
define("U5","Equites Imperatoris");
define("U6","Equites Caesaris");
define("U7","Battering Ram");
define("U8","Fire Catapult");
define("U9","Senator");
define("U10","Settler");
//TEUTON UNITS
define("U11","Clubswinger");
define("U12","Spearman");
define("U13","Axeman");
define("U14","Scout");
define("U15","Paladin");
define("U16","Teutonic Knight");
define("U17","Ram");
define("U18","Catapult");
define("U19","Chief");
define("U20","Settler");
//GAUL UNITS
define("U21","Phalanx");
define("U22","Swordsman");
define("U23","Pathfinder");
define("U24","Theutates Thunder");
define("U25","Druidrider");
define("U26","Haeduan");
define("U27","Ram");
define("U28","Trebuchet");
define("U29","Chieftain");
define("U30","Settler");
define("U99","Trap");
//NATURE UNITS
define("U31","Rat");
define("U32","Spider");
define("U33","Snake");
define("U34","Bat");
define("U35","Wild Boar");
define("U36","Wolf");
define("U37","Bear");
define("U38","Crocodile");
define("U39","Tiger");
define("U40","Elephant");
//NATARS UNITS
define("U41","Pikeman");
define("U42","Thorned Warrior");
define("U43","Guardsman");
define("U44","Birds Of Prey");
define("U45","Axerider");
define("U46","Natarian Knight");
define("U47","War Elephant");
define("U48","Ballista");
define("U49","Natarian Emperor");
define("U50","Natarian Settler");
//MONSTER UNITS
define("U51","Monster Peon");
define("U52","Monster Hunter");
define("U53","Monster Warrior");
define("U54","Ghost");
define("U55","Monster Steed");
define("U56","Monster War Steed");
define("U57","Monster Ram");
define("U58","Monster Catapult");
define("U59","Monster Chief");
define("U60","Monster Settler");
// RESOURCES
define("R1","Lumber");
define("R2","Clay");
define("R3","Iron");
define("R4","Crop");
//INDEX.php
define("LOGIN","Login");
define("PLAYERS","Players");
define("ACTIVE","Active");
define("ONLINE","Online");
define("TUTORIAL","Tutorial");
define("PLAYER_STATISTICS","Player statistics");
define("TOTAL_PLAYERS","".PLAYERS." in total");
define("ACTIVE_PLAYERS","Active players");
define("ONLINE_PLAYERS","".PLAYERS." online");
define("MP_STRATEGY_GAME","".SERVER_NAME." - the multiplayer strategy game");
define("WHAT_IS","".SERVER_NAME." is one of the most popular browser games in the world. As a player in ".SERVER_NAME.", you will build your own empire, recruit a mighty army, and fight with your allies for game world hegemony.");
define("REGISTER_FOR_FREE","Register here for free!");
define("LATEST_GAME_WORLD","Latest game world");
define("LATEST_GAME_WORLD2","Register on the latest<br/>game world and enjoy<br/>the advantages of<br/>being one of the<br/>first players.");
define("PLAY_NOW","Play ".SERVER_NAME." now");
define("LEARN_MORE","Learn more <br/>about ".SERVER_NAME."!");
define("LEARN_MORE2","Now with a revolutionised<br>server system, completely new<br>graphics <br>This clone is The Shiz!");
define("COMUNITY","Community");
define("BECOME_COMUNITY","Become part of our community now!");
define("BECOME_COMUNITY2","Become a part of one of<br>the biggest gaming<br>communities in the<br>world.");
define("NEWS","News");
define("SCREENSHOTS","Screenshots");
define("LEARN1","Upgrade your fields and mines to increase your resource production. You will need resources to construct buildings and train soldiers.");
define("LEARN2","Construct and expand the buildings in your village. Buildings improve your overall infrastructure, increase your resource production and allow you to research, train and upgrade your troops.");
define("LEARN3","View and interact with your surroundings. You can make new friends or new enemies, make use of the nearby oases and observe as your empire grows and becomes stronger.");
define("LEARN4","Follow your improvement and success and compare yourself to other players. Look at the Top 10 rankings and fight to win a weekly medal.");
define("LEARN5","Receive detailed reports about your adventures, trades and battles. Don't forget to check the brand new reports about the happenings taking place in your surroundings.");
define("LEARN6","Exchange information and conduct diplomacy with other players. Always remember that communication is the key to winning new friends and solving old conflicts.");
define("LOGIN_TO","Log in to ". SERVER_NAME);
define("REGIN_TO","Register in ". SERVER_NAME);
define("P_ONLINE","Players online: ");
define("P_TOTAL","Players in total: ");
define("CHOOSE","Please choose a server.");
define("STARTED"," The server started ". round((time()-COMMENCE)/86400) ." days ago.");
//ANMELDEN.php
define("NICKNAME","Nickname");
define("EMAIL","Email");
define("PASSWORD","Password");
define("ROMANS","Romans");
define("TEUTONS","Teutons");
define("GAULS","Gauls");
define("NW","North West");
define("NE","North East");
define("SW","South West");
define("SE","South East");
define("RANDOM","random");
define("ACCEPT_RULES"," I accept the game rules and general terms and conditions.");
define("ONE_PER_SERVER","Each player may only own ONE account per server.");
define("BEFORE_REGISTER","Before you register an account you should read the <a href='../anleitung.php' target='_blank'>instructions</a> of TravianX to see the specific advantages and disadvantages of the three tribes.");
define("BUILDING_UPGRADING","Building:");
define("HOURS","hours");
//ATTACKS ETC.
define("TROOP_MOVEMENTS","Troop Movements:");
define("ARRIVING_REINF_TROOPS","Arriving reinforcing troops");
define("ARRIVING_REINF_TROOPS_SHORT","Reinf.");
define("OWN_ATTACKING_TROOPS","Own attacking troops");
define("ATTACK","Attack");
define("OWN_REINFORCING_TROOPS","Own reinforcing troops");
define("TROOPS_DORF","Troops:");
//LOGIN.php
define("COOKIES","You must have cookies enabled to be able to log in. If you share this computer with other people you should log out after each session for your own safety.");
define("NAME","Name");
define("PW_FORGOTTEN","Password forgotten?");
define("PW_REQUEST","Then you can request a new one which will be sent to your email address.");
define("PW_GENERATE","Generate new password.");
define("EMAIL_NOT_VERIFIED","Email not verified!");
define("EMAIL_FOLLOW","Follow this link to activate your account.");
define("VERIFY_EMAIL","Verify Email.");
define("SERVER_STARTS_IN","Server will start in: ");
define("START_NOW","START NOW");
//404.php
define("NOTHING_HERE","Nothing here!");
define("WE_LOOKED","We looked 404 times already but can't find anything");
//TIME RELATED
define("CALCULATED","Calculated in");
define("SERVER_TIME","Server time:");
//MASSMESSAGE.php
define("MASS","Message Content");
define("MASS_SUBJECT","Subject:");
define("MASS_COLOR","Message color:");
define("MASS_REQUIRED","All fields required");
define("MASS_UNITS","Images (units):");
define("MASS_SHOWHIDE","Show/Hide");
define("MASS_READ","Read this: after adding smilie, you have to add left or right after number otherwise image will won't work");
define("MASS_CONFIRM","Confirmation");
define("MASS_REALLY","Do you really want to send MassIGM?");
define("MASS_ABORT","Aborting right now");
define("MASS_SENT","Mass IGM was sent");
/*
|--------------------------------------------------------------------------
| Index
|--------------------------------------------------------------------------
*/
$lang['index'][0][1] = "Welcome to " . SERVER_NAME . "";
$lang['index'][0][2] = "Manual";
$lang['index'][0][3] = "Play now, for free!";
$lang['index'][0][4] = "What is " . SERVER_NAME . "";
$lang['index'][0][5] = "" . SERVER_NAME . " is a <b>browser game</b> featuring an engaging ancient world with thousands of other real players.</p><p>It`s <strong>free to play</strong> and requires <strong>no downloads</strong>.";
$lang['index'][0][6] = "Click here to play " . SERVER_NAME . "";
$lang['index'][0][7] = "Total players";
$lang['index'][0][8] = "Players active";
$lang['index'][0][9] = "Players online";
$lang['index'][0][10] = "About the game";
$lang['index'][0][11] = "You will begin as the chief of a tiny village and will embark on an exciting quest.";
$lang['index'][0][12] = "Build up villages, wage wars or establish trade routes with your neighbours.";
$lang['index'][0][13] = "Play with and against thousands of other real players and conquer the the world of Travian.";
$lang['index'][0][14] = "News";
$lang['index'][0][15] = "FAQ";
$lang['index'][0][16] = "Screenshots";
$lang['forum'] = "Forum";
$lang['register'] = "Register";
$lang['login'] = "Login";
?>
+300
View File
@@ -0,0 +1,300 @@
<?php
//////////////////////////////////////////////////////////////////////////////////////////////////////
// TRAVIANX //
// Only for advanced users, do not edit if you dont know what are you doing! //
// Made by: Dzoki & Dixie (TravianX) //
// - TravianX = Travian Clone Project - //
// DO NOT REMOVE COPYRIGHT NOTICE! //
//////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// SPANISH //
// author: Thyphoon //
/////////////////////////////
//MAIN MENU
define("HOME","P&aacute;gina Principal");
define("INSTRUCT","Instrucciones");
define("ADMIN_PANEL","Panel de control");
define("MASS_MESSAGE","Mens. en masa");
define("LOGOUT","Salir");
define("PROFILE","Perfil");
define("SUPPORT","Soporte");
define("UPDATE_T_10","Actualizar top 10");
define("SYSTEM_MESSAGE","Mens. del sistema");
define("TRAVIAN_PLUS","Travian <b><span class=\"plus_g\">P</span><span class=\"plus_o\">l</span><span class=\"plus_g\">u</span><span class=\"plus_o\">s</span></span></span></b>");
define("CONTACT","Contactenos!");
//MENU
define("REG","Registarse");
define("FORUM","Foro");
define("CHAT","Chat");
define("IMPRINT","Imprimir");
define("MORE_LINKS","Enlaces");
define("TOUR","Tutorial");
//ERRORS
define("USRNM_EMPTY","(Nombre de usuario vac&iacute;)");
define("USRNM_TAKEN","(El nombre ya esta en uso.)");
define("USRNM_SHORT","(min. ".USRNM_MIN_LENGTH." caracteres)");
define("USRNM_CHAR","(Caracteres inv&aacute;lidos)");
define("PW_EMPTY","(Contrase&ntilde;a en blanco)");
define("PW_SHORT","(min. ".PW_MIN_LENGTH." caracteres)");
define("PW_INSECURE","(Contrasena insegura. Por favor escoja una con ma&acute;s seguridad.)");
define("EMAIL_EMPTY","(Correo en blanco)");
define("EMAIL_INVALID","(Direccio&acute;n de correo inva&acute;lida)");
define("EMAIL_TAKEN","(El correo ya esta&acute; en uso)");
define("TRIBE_EMPTY","<li>Por favor escoja una tribu.</li>");
define("AGREE_ERROR","<li>Tiene que estar de acuerdo con las reglas y condicio&acute;n de uso antes de registrarse.</li>");
define("LOGIN_USR_EMPTY","Nombre vac&iacute;o.");
define("LOGIN_PASS_EMPTY","Contrase&ntilde;a.");
define("EMAIL_ERROR","El correo electr&oacute;nico no existe");
define("PASS_MISMATCH","Las contrase&ntilde;as no coinciden");
define("ALLI_OWNER","Por favor escoja un l&iacute;der de alianza antes de borrarla.");
define("SIT_ERROR","Cuidador ya configurado");
define("USR_NT_FOUND","Nombre no existente.");
define("LOGIN_PW_ERROR","La contrase&ntilde;a es incorrecta.");
define("WEL_TOPIC","Concejos &uacute;tiles e informaci&oacute;n ");
define("ATAG_EMPTY","Etiqueta vac&iacute;a");
define("ANAME_EMPTY","Nombre vac&iacute;o");
define("ATAG_EXIST","Etiqueta en uso");
define("ANAME_EXIST","Nombre en uso");
//COPYRIGHT
define("TRAVIAN_COPYRIGHT","TravianX Clon de Travian 100% C&oacute;digo Libre.");
//BUILD.TPL
define("CUR_PROD","Producci&oacute;n actual ");
define("NEXT_PROD","Producci&oacute;n al nivel ");
//BUILDINGS
define("B1","Le&ntilde;ador");
define("B1_DESC","El le&ntilde;ador tala &aacute;rboles para producir madera. Cuanto m&aacute;s se aumenta su nivel produce m&aacute;s madera.");
define("B2","Barrera");
define("B2_DESC","La arcilla se produce aqu&iacute;. Al incrementar el nivel aumentar&aacute; la producci&oacute;n de arcilla.");
define("B3","Mina de Hierro");
define("B3_DESC","Aqu&iacute; los mineros producen produce el valioso hierro. Cuanto m&aacutes se ampl&iacute;en las minas, m&aacute;s hierro se produce.");
define("B4","Granja");
define("B4_DESC","La comida de tu pobleci&oacute;n se produce aqu&iacute;. Incrementando el nivel de las granjas aumentas la producci&oacute;n de grano.");
//DORF1
define("LUMBER","Madera");
define("CLAY","Arcilla");
define("IRON","Hierro");
define("CROP","Grano");
define("LEVEL","Nivel");
define("CROP_COM",CROP." consumido");
define("PER_HR","por hora");
define("PROD_HEADER","Producci&oacute;n");
define("MULTI_V_HEADER","Villas");
define("ANNOUNCEMENT","Anuncio");
define("GO2MY_VILLAGE","Ir a mi villa");
define("VILLAGE_CENTER","Centro de la Villa");
define("FINISH_GOLD","&iquest;Terminar todas las construcciones e investigaciones en esta aldea por 2 oros?");
define("WAITING_LOOP","(lazo de espera)");
define("HRS","(hrs.)");
define("DONE_AT","listo a las ");
define("CANCEL","cancelar");
//QUEST
define("Q_CONTINUE","Continuar con la siguiente misi&oacute;n.");
define("Q_REWARD","Su recompensa:");
define("Q0","&iexcl;Biemvenido a ");
define("Q0_DESC","Veo que se le ha nombrado jefe de este peque&ntilde;o pueblo. Ser&eacute; su concejero y mano derecha los primeros d&iacute;as.<\/i> <br \/><i>Puede empesar cumpliendo unas simples tareas por las que ser&aacute; recompensado &iquest;desea realizarlas?");
define("Q0_OPT1","Si, comenzar con las tareas.");
define("Q0_OPT2","Vuelvo\u00a0despues\u00a0en\u00a0un\u00a0rato.");
define("Q0_OPT3","No gracias, no me interesa.");
define("Q1","Misi&oacute;n 1: Construye un le&ntilde;ador");
define("Q1_DESC","Alrededor de la aldea hay cuatro bosques verdes. Construye un le&ntilde;ador en cada uno de ellos. La madera es un recurso importante para un nuevo asentamiento");
define("Q1_ORDER","Orden:<\/p> mejorar un le&ntilde;ador.");
define("Q1_RESP","Si, de esa manera usted gana mas madera. Ayud&eacute; un poquito y complet&eacute; la orden.");
define("Q1_REWARD","Finalizaci&oacute;n inmediata del le&ntilde;ador.");
define("Q2","Misi&oacute;n 2: Cereal");
define("Q2_DESC","Ahora sus s&uacute;bditos estan hambrientos por haber trabajado todo el d&iacute;a. Extienda sus granjas para mejorar sus reservas. Regrese cuando la granja est&eacute; realizada.");
define("Q2_ORDER","Order:<\/p>mejorar una granja.");
define("Q2_RESP","Muy bien. Ahora sus s&uacute;bditos tiene suficiente comida...");
define("Q3","Misi&oacute;n 3: El Nombre de tu aldea");
define("Q3_DESC","Creativo como eres le puedes dar el nombre a tu aldea. Haz click en <b>perfil</b> en el lado izquierdo del men&uacute; y selecciona <b>cambiar perfil</b>");
define("Q3_ORDER","Order:<\/p>Change your village's name to something nice.");
define("Q3_RESP","Wow, un buen nombre para su pueblo. Podr&iacute;a haber nombrado el mio igual...");
define("Q4","Misi&oacute;n 4: Otros jugadores.");
define("Q4_DESC","En ". SERVER_NAME . " juegas junto con billones de otros jugadores. Haz click en 'Estadisticas' en el men&uacute; de arriba para ver tu ranking.");
define("Q4_ORDER","Orden: <\/p>Buscar tu ranking en las estadisticas e introducirlo aqu&iacute;.");
define("Q4_BUTN","completar misi&oacute;n");
define("Q4_RESP","&iexcl;Exactamente! Ese es tu rango.");
define("Q5","Misi&oacute;n 5: Dos ordenes de construcci&oacute;n");
define("Q5_DESC","Construye una mina de hierro y un barrera. El hierro y el barro nunca son suficientes");
define("Q5_ORDER","Orden:<\/p><ul><li>Ampliar una mina de hierro.<\/li><li>Ampliar una barrera.<\/li><\/ul>");
define("Q5_RESP","Como habr&aacute;s notado las ordenes de construcci&oacute;n toman mas tiempo. El mundo de ". SERVER_NAME ." continuar&aacute; girando incluso si est&aacute;s desconectado. En unos meses habr&aacute;n muchas cosas para descubrir. <br> Lo mejor que puedes hacer es ocacionalmente entrar a tu pueblo y asignar a sus pobladores nuevas tareas y cosas para hacer.");
define("Q6","Mensaje del Taskmaster");
define("Q6_DESC","Se le informa que tiene un premio del taskmaster esperandolo.<br /><br />No es necesario responder este mensaje.");
//======================================================//
//================ UNITS - DO NOT EDIT! ================//
//======================================================//
//ROMAN UNITS
define("U1","Legionnario");
define("U2","Praetoriano");
define("U3","Imperiano");
define("U4","Equites Legati");
define("U5","Equites Imperatoris");
define("U6","Equites Caesaris");
define("U7","Ariete");
define("U8","Catapulta de fuego");
define("U9","Senador");
define("U10","Colono");
//TEUTON UNITS
define("U11","Clubswinger");
define("U12","Lancero");
define("U13","Hachero");
define("U14","Explorador");
define("U15","Paladin");
define("U16","Caballero Teut&oacuten");
define("U17","Ariete");
define("U18","Catapulta");
define("U19","Jefe Teut&oacute;n");
define("U20","Colono");
//GAUL UNITS
define("U21","Phalange");
define("U22","Espadach&iacute;n");
define("U23","Pionero");
define("U24","Trueno de Tutatis");
define("U25","Druida");
define("U26","Haeduan");
define("U27","Ariete");
define("U28","Trebuchet");
define("U29","Jefe Galo");
define("U30","Colono");
//NATURE UNITS
define("U31","Rata");
define("U32","Ara&ntilde;a");
define("U33","Serpiente");
define("U34","Murci&eacute;lago");
define("U35","Javal&iacute;");
define("U36","Lobo");
define("U37","Oso");
define("U38","Cocodrilo");
define("U39","Tigre");
define("U40","Elefante");
//NATARS UNITS
define("U41","Piquero");
define("U42","Guerrero Espinoso");
define("U43","Defensor");
define("U44","P&aacute;jaro de Presa");
define("U45","Hachero Jinete");
define("U46","Caballero Natariano");
define("U47","Elefante de Guerra");
define("U48","Ballesta");
define("U49","Emperador Natariano");
//INDEX.php
define("LOGIN","Entrar");
define("PLAYERS","Jugadores");
define("ONLINE","Conectados");
define("TUTORIAL","Tutorial");
define("PLAYER_STATISTICS","Estad&iacute;sticas de Jugadores");
define("TOTAL_PLAYERS","".PLAYERS." en total");
define("ACTIVE_PLAYERS","jugadores activos");
define("ONLINE_PLAYERS","".PLAYERS." conectados");
define("MP_STRATEGY_GAME","".SERVER_NAME." - el juego de estrategia multijugador.");
define("WHAT_IS","".SERVER_NAME." es uno de los juegos onlines m&aacute;s conocidos en el mundo. Como jugador de ".SERVER_NAME." puedes construir tu propio imperio, reclutar tu propio ejercito y pelear con tus aliados para la conquista del mundo.");
define("REGISTER_FOR_FREE","Registrase aqu&iacute; gratis!");
define("LATEST_GAME_WORLD","Nuevo mundo");
define("LATEST_GAME_WORLD2","Registrate en el &uacute;ltimo<br/>mundo y disfruta<br/>las ventajas de<br/>ser uno de los<br/>primeros jugadores.");
define("PLAY_NOW","Jugar ".SERVER_NAME." ahora");
define("LEARN_MORE","Aprende m&aacute;s sobre ".SERVER_NAME."!");
define("LEARN_MORE2","Ahora con un revolucionario<br>sistema y gr&aacute;ficos<br>completamente nuevos<br>Este clon es el mejor!");
define("COMUNITY","Comunidad");
define("BECOME_COMUNITY","Unete ahora!");
define("BECOME_COMUNITY2","Forma parte de una<br>de la mayor comunida<br>de jugadores del mundo.");
define("NEWS","Noticias");
define("SCREENSHOTS","Galer&iacute;a de Im&aacute;genes");
define("LEARN1","Mejora tus sembrados y minas para aumentar la producci&oacute;n de recursos. Necesitar&aacute;s recursos para construir y entrenar soldados.");
define("LEARN2","Construlle y mejora los edificios en tu aldea. Los edificios mejoran la infraestructura, aumentan la producci&oacute;n y te permiten investigar, entrenar y equipar tus tropas.");
define("LEARN3","Observa e interact&uacute;a con tus alrededores. Puedes hacer nuevos amigos o enemigos, Utiliza los oasis cercanos y asegura que tu imperio crezca y se fortalezca.");
define("LEARN4","Sigue tus logros y comp&aacute;rate con otros jugadores. Mira la tabla de los 10 mejores y lucha por obtener una medalla de la semana.");
define("LEARN5","Recibe reportes detallados de tus aventuras, intercambio y batallas.");
define("LEARN6","Intercambia informaci&oacute;n y s&eacute; diplom&aacute;tico con otros jugadores. Siempre recuerda que la comunicaci&oacute;n es la llave para obtener nuevos amigos y resolver viejas disputas.");
define("LOGIN_TO","Entrar a ". SERVER_NAME);
define("REGIN_TO","Registrarse en ". SERVER_NAME);
define("P_ONLINE","Jugadores en l&iacute;nea: ");
define("P_TOTAL","Jugadores en total: ");
define("CHOOSE","Escoja un servidor por favor.");
define("STARTED"," El servidor empez&oacute; hace ". round((time()-COMMENCE)/86400) ." d&iacute;as.");
//ANMELDEN.php
define("NICKNAME","Sobrenombre");
define("EMAIL","Correo");
define("PASSWORD","Contrase&ntilde;a");
define("ROMANS","Romanos");
define("TEUTONS","Germanos");
define("GAULS","Galos");
define("NW","Noroeste");
define("NE","Noreste");
define("SW","Suroeste");
define("SE","Sureste");
define("RANDOM","al azar");
define("ACCEPT_RULES"," Estoy de acuerdo con las reglas y las condiciones generales de uso.");
define("ONE_PER_SERVER","Cada jugador puede tener solo una cuenta en el servidor.");
define("BEFORE_REGISTER","Si deseas ver un resumen de las ventajas y desventajas de cada raza, puedes hacerlo <a href='../anleitung.php' target='_blank'>aqu&iacute;</a>.");
define("BUILDING_UPGRADING","Construyendo:");
define("HOURS","horas");
//ATTACKS ETC.
define("TROOP_MOVEMENTS","movimientos de tropa:");
define("ARRIVING_REINF_TROOPS","Llegando refuerzos");
define("ARRIVING_REINF_TROOPS_SHORT","Refuer.");
define("OWN_ATTACKING_TROOPS","Tropas atacando");
define("ATTACK","Ataque");
define("OWN_REINFORCING_TROOPS","Refuerzos despachados");
define("TROOPS_DORF","Tropas:");
//LOGIN.php
define("COOKIES","Tienes que tener las cookies habilitadas para poder entrar. Si compartes ordenador con m&aacute;s jugadores o est&aacute;s en un lugar p&uacute;blico, aseg&uacute;rate de cerrar la sesi&oacute;n cuando salgas por tu propia seguridad.");
define("NAME","Nombre");
define("PW_FORGOTTEN","Olvid&oacute; la contrase&ntilde;a?");
define("PW_REQUEST","Entonces puede solicitar una que le ser&aacute enviada a su direcci&oacute;n de correo.");
define("PW_GENERATE","Pedir nueva contrase&ntilde;a");
define("EMAIL_NOT_VERIFIED","Correo no verificado!");
define("EMAIL_FOLLOW","Sigue este v&iacute;nculo para activar este enlace.");
define("VERIFY_EMAIL","Verificar Correo.");
//404.php
define("NOTHING_HERE","No hay nada ah&iacute;!");
define("WE_LOOKED","Buscamos 404 veces pero no encontramos nada");
//TIME RELATED
define("CALCULATED","Calculado en");
define("SERVER_TIME","Tiempo funcionando:");
//MASSMESSAGE.php
define("MASS","Contenido del mensaje");
define("MASS_SUBJECT","Asunto:");
define("MASS_COLOR","Color del Mensaje:");
define("MASS_REQUIRED","Todos los campos son requeridos");
define("MASS_UNITS","Imagenes (unidades):");
define("MASS_SHOWHIDE","Mostrar/Ocultar");
define("MASS_READ","Lee esto: despues de enviar un smiley, hay que a&ntilde;adir a la izquierda o la derecha despu&eacute;s de un n&uacute;mero de otro modo la imagen no funciona.");
define("MASS_CONFIRM","Confirmaci&oacute;n");
define("MASS_REALLY","Realmente quieres enviar un mensaje en masa?");
define("MASS_ABORT","Abortar?");
define("MASS_SENT","El mensaje en masa fue enviado");
//BUILDINGS
define("ACADEMY_NAME","Academia");
define("BARRACK_NAME","Barraca");
?>
+454
View File
@@ -0,0 +1,454 @@
<?php
//////////////////////////////////////////////////////////////////////////////////////////////////////
// TRAVIANX //
// Only for advanced users, do not edit if you dont know what are you doing! //
// Made by: Dzoki & Dixie (TravianX) //
// - TravianX = Travian Clone Project - //
// DO NOT REMOVE COPYRIGHT NOTICE! //
//////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// Русский //
// Author: kylesv (sV) //
/////////////////////////////
//MAIN MENU
define("TRIBE1","Римляне");
define("TRIBE2","Германцы");
define("TRIBE3","Галлы");
define("TRIBE4","Природа");
define("TRIBE5","Натары");
define("TRIBE6","Монстры");
define("HOME","Главная");
define("INSTRUCT","Инструкции");
define("ADMIN_PANEL","Админка");
define("MULTIHUNTER_PAN","Мультих. панель");
define("CREATE_NAT","Создать Натар");
define("MASS_MESSAGE","Сообщение всем");
define("LOGOUT","Выйти");
define("PROFILE","Профиль");
define("SUPPORT","Поддержка");
define("UPDATE_T_10","Обновить ТОП 10");
define("SYSTEM_MESSAGE","Сист. сообщение");
define("TRAVIAN_PLUS","Травиан <b><span class=\"plus_g\">P</span><span class=\"plus_o\">l</span><span class=\"plus_g\">u</span><span class=\"plus_o\">s</span></span></span></b>");
define("CONTACT","Связь с нами!");
define("GAME_RULES","Правила игры");
//MENU
define("REG","Регистрация");
define("FORUM","Форум");
define("CHAT","Чат");
define("IMPRINT","Распечатать");
define("MORE_LINKS","Больше");
define("TOUR","Турнир");
//ERRORS
define("USRNM_EMPTY","(пустое имя пользователя)");
define("USRNM_TAKEN","(Имя уже используется)");
define("USRNM_SHORT","(мин. ".USRNM_MIN_LENGTH." символов)");
define("USRNM_CHAR","(Неверные символы)");
define("PW_EMPTY","(Пустой пароль)");
define("PW_SHORT","(мин. ".PW_MIN_LENGTH." символов)");
define("PW_INSECURE","(Простой пароль. Придумайте более сложный)");
define("EMAIL_EMPTY","(Пустой email)");
define("EMAIL_INVALID","(Неправильный email)");
define("EMAIL_TAKEN","(Email уже используется)");
define("TRIBE_EMPTY","<li>Выберите племя.</li>");
define("AGREE_ERROR","<li>Вы должны принять правила игры и общие условия и условия для того, чтобы зарегистрироваться.</li>");
define("LOGIN_USR_EMPTY","Введите имя.");
define("LOGIN_PASS_EMPTY","Введите паролб.");
define("EMAIL_ERROR","Электронный адрес не соответствует существующему");
define("PASS_MISMATCH","Пароли не совпадают");
define("ALLI_OWNER","Пожалуйста, назначьте владельца перед удалением");
define("SIT_ERROR","Уже установленно");
define("USR_NT_FOUND","Имя пользователя не существует.");
define("LOGIN_PW_ERROR","Пароль неправильный.");
define("WEL_TOPIC","Useful tips & information ");
define("ATAG_EMPTY","Тэг пуст");
define("ANAME_EMPTY","Название пустое");
define("ATAG_EXIST","Тэг принят");
define("ANAME_EXIST","Название принято");
define("NOT_OPENED_YET","Сервер еще не запущен.");
//COPYRIGHT
define("TRAVIAN_COPYRIGHT","TravianX 100% Open Source Travian Clone.");
//BUILD.TPL
define("CUR_PROD","Текущее производство");
define("NEXT_PROD","Производство на уровне ");
//BUILDINGS
define("B1","Лесопилка");
define("B1_DESC","На лесопилке идет производство древесины. С увеличением уровня развития здания увеличивается его производительность.");
define("B2","Глиняный карьер");
define("B2_DESC","На глиняном карьере добывают сырье глину. С развитием глиняного карьера увеличивается его производительность.");
define("B3","Железный карьер");
define("B3_DESC","На железных рудниках шахтеры добывают ценное сырье – железо. С развитием рудника увеличивается его производительность.");
define("B4","Ферма");
define("B4_DESC","На фермах выращивают зерно для обеспечения продовольствием населения. С развитием фермы увеличивается ее производительность.");
//DORF1
define("LUMBER","Древесина");
define("CLAY","Глина");
define("IRON","Железо");
define("CROP","Зерно");
define("LEVEL","Уровень");
define("CROP_COM","Потребление зерна");
define("DURATION","Время строительства");
define("PER_HR","в час");
define("PROD_HEADER","Производство");
define("MULTI_V_HEADER","Деревни");
define("ANNOUNCEMENT","Объявление");
define("GO2MY_VILLAGE","Войти в мою деревню");
define("VILLAGE_CENTER","Центр деревни");
define("FINISH_GOLD","Завершить все строительство и исследования в деревне за 2 золота?");
define("WAITING_LOOP","(очередь)");
define("HRS","ч.");
define("DONE_AT","будет завершено в");
define("CANCEL","отмена");
define("LOYALTY","Лояльность:");
define("CALCULATED_IN","Создана за");
define("SEVER_TIME","Время сервера:");
define("MILISECS","мс");
//QUEST
define("Q_CONTINUE","Перейти к следующему заданию.");
define("Q_REWARD","Ваша награда:");
define("Q0","Добро пожаловать ");
define("Q0_DESC","As I see you have been made chieftain of this little village. I will be your counselor for the first few days and never leave your (right hand) side.");
define("Q0_OPT1","To the first task.");
define("Q0_OPT2","Look around on your own.");
define("Q0_OPT3","Play no tasks.");
define("Q1","Task 1: Woodcutter");
define("Q1_DESC","There are four green forests around your village. Construct a woodcutter on one of them. Lumber is an important resource for our new settlement.");
define("Q1_ORDER","Order:<\/p>Construct a woodcutter.");
define("Q1_RESP","Yes, that way you gain more lumber.I helped a bit and completed the order instantly.");
define("Q1_REWARD","Woodcutter instantly completed.");
define("Q2","Task 2: Crop");
define("Q2_DESC","Now your subjects are hungry from working all day. Extend a cropland to improve your subjects' supply. Come back here once the building is complete.");
define("Q2_ORDER","Order:<\/p>Extend one cropland.");
define("Q2_RESP","Very good. Now your subjects have enough to eat again...");
define("Q3","Task 3: Your Village's Name");
define("Q3_DESC","Creative as you are you can grant your village the ultimate name.\r\n<br \/><br \/>\r\nClick on 'profile' in the left hand menu and then select 'change profile'...");
define("Q3_ORDER","Order:<\/p>Change your village's name to something nice.");
define("Q3_RESP","Wow, a great name for their village. It could have been the name of my village!...");
define("Q4","Task 4: Other Players");
define("Q4_DESC","In ". SERVER_NAME ." you play along with billions of other players. Click 'statistics' in the top menu to look up your rank and enter it here.");
define("Q4_ORDER","Order:<\/p>Look for your rank in the statistics and enter it here.");
define("Q4_BUTN","complete task");
define("Q4_RESP","Exactly! That's your rank.");
define("Q5","Task 5: Two Building Orders");
define("Q5_DESC","Build an iron mine and a clay pit. Of iron and clay one can never have enough.");
define("Q5_ORDER","Order:<\/p><ul><li>Extend one iron mine.<\/li><li>Extend one clay pit.<\/li><\/ul>");
define("Q5_RESP","As you noticed, building orders take rather long. The world of ". SERVER_NAME ." will continue to spin even if you are offline. Even in a few months there will be many new things for you to discover.\r\n<br \/><br \/>\r\nThe best thing to do is occasionally checking your village and giving you subjects new tasks to do.");
define("Q6","Message From The Taskmaster");
define("Q6_DESC","You are to be informed that a nice reward is waiting for you at the taskmaster.<br /><br />Hint: The message has been generated automatically. An answer is not necessary.");
define("Q5","Task 5: Two Building Orders");
define("Q5_DESC","Build an iron mine and a clay pit. Of iron and clay one can never have enough.");
define("Q5_ORDER","Order:<\/p><ul><li>Extend one iron mine.<\/li><li>Extend one clay pit.<\/li><\/ul>");
define("Q5_RESP","As you noticed, building orders take rather long. The world of ". SERVER_NAME ." will continue to spin even if you are offline. Even in a few months there will be many new things for you to discover.\r\n<br \/><br \/>\r\nThe best thing to do is occasionally checking your village and giving you subjects new tasks to do.");
//======================================================//
//================ UNITS - DO NOT EDIT! ================//
//======================================================//
define("U0","Герой");
//ROMAN UNITS
define("U1","Легионер");
define("U2","Преторианец");
define("U3","Империанец");
define("U4","Конный разведчик");
define("U5","Конница императора");
define("U6","Конница Цезаря");
define("U7","Таран");
define("U8","Огненная катапульта");
define("U9","Сенатор");
define("U10","Поселенец");
//TEUTON UNITS
define("U11","Дубинщик");
define("U12","Копейщик");
define("U13","Топорщик");
define("U14","Скаут");
define("U15","Паладин");
define("U16","Тевтонская конница");
define("U17","Стенобитное орудие");
define("U18","Катапульта");
define("U19","Вождь");
define("U20","Поселенец");
//GAUL UNITS
define("U21","Фаланга");
define("U22","Мечник");
define("U23","Следопыт");
define("U24","Тевтатский гром");
define("U25","Друид-всадник");
define("U26","Эдуйская конница");
define("U27","Стенобитное орудие");
define("U28","Требушет");
define("U29","Предводитель");
define("U30","Поселенец");
//NATURE UNITS
define("U31","Крыса");
define("U32","Паук");
define("U33","Змея");
define("U34","Летучая мышь");
define("U35","Кабан");
define("U36","Волк");
define("U37","Медведь");
define("U38","Крокодил");
define("U39","Тигр");
define("U40","Слон");
//NATARS UNITS
define("U41","Пикейщик");
define("U42","Дубинщик с шипами");
define("U43","Гвардеец");
define("U44","Ворон");
define("U45","Всадник с топором");
define("U46","Рыцарь Натаров");
define("U47","Боевой слон");
define("U48","Балиста");
define("U49","Принц Натаров");
define("U50","Поселенец");
//MONSTER UNITS
define("U51","Monster Peon");
define("U52","Monster Hunter");
define("U53","Monster Warrior");
define("U54","Ghost");
define("U55","Monster Steed");
define("U56","Monster War Steed");
define("U57","Monster Ram");
define("U58","Monster Catapult");
define("U59","Monster Chief");
define("U60","Monster Settler");
//INDEX.php
define("LOGIN","Логин");
define("PLAYERS","Игроки");
define("ONLINE","Онлайн");
define("TUTORIAL","Учебник");
define("PLAYER_STATISTICS","Статистика пользователя");
define("TOTAL_PLAYERS","Общее число игроков");
define("ACTIVE_PLAYERS","Активные пользователи");
define("ONLINE_PLAYERS",PLAYERS." онлайн");
define("MP_STRATEGY_GAME","".SERVER_NAME." - многопользовательская онлайн игра");
define("WHAT_IS","".SERVER_NAME." одна из самых популярных браузерных игр в мире. В качестве игрока вы увеличиваете и развиваете свои владения, тренируете войска и вместе с альянсом сражаетесь за господство над игровым миром.");
define("REGISTER_FOR_FREE","Зарегистрироваться!");
define("LATEST_GAME_WORLD","Новый сервер");
define("LATEST_GAME_WORLD2","Зарегистрируйтесь на самом<br/> новом сервере и наслаждайтесь<br/>преимуществом первого игрока.");
define("PLAY_NOW","Играть ".SERVER_NAME." сейчас");
define("LEARN_MORE","Узнать <br/>больше о ".SERVER_NAME."!");
define("LEARN_MORE2","Now with a revolutionised<br>server system, completely new<br>graphics <br>This clone is The Shiz!");
define("COMUNITY","Community");
define("BECOME_COMUNITY","Become part of our community now!");
define("BECOME_COMUNITY2","Become a part of one of<br>the biggest gaming<br>communities in the<br>world.");
define("NEWS","Новости");
define("SCREENSHOTS","Скриншоты");
define("LEARN1","Upgrade your fields and mines to increase your resource production. You will need resources to construct buildings and train soldiers.");
define("LEARN2","Construct and expand the buildings in your village. Buildings improve your overall infrastructure, increase your resource production and allow you to research, train and upgrade your troops.");
define("LEARN3","View and interact with your surroundings. You can make new friends or new enemies, make use of the nearby oases and observe as your empire grows and becomes stronger.");
define("LEARN4","Follow your improvement and success and compare yourself to other players. Look at the Top 10 rankings and fight to win a weekly medal.");
define("LEARN5","Receive detailed reports about your adventures, trades and battles. Don't forget to check the brand new reports about the happenings taking place in your surroundings.");
define("LEARN6","Exchange information and conduct diplomacy with other players. Always remember that communication is the key to winning new friends and solving old conflicts.");
define("LOGIN_TO","Log in to ". SERVER_NAME);
define("REGIN_TO","Зарегистрироваться на ". SERVER_NAME);
define("P_ONLINE","Players online: ");
define("P_TOTAL","Players in total: ");
define("CHOOSE","Please choose a server.");
define("STARTED"," The server started ". round((time()-COMMENCE)/86400) ." days ago.");
//ANMELDEN.php
define("NICKNAME","Логин");
define("EMAIL","Email");
define("PASSWORD","Пароль");
define("ROMANS","Римляне");
define("TEUTONS","Германцы");
define("GAULS","Галлы");
define("NW","Северо-запад");
define("NE","Северо-восток");
define("SW","Юго-запад");
define("SE","Юго-восток");
define("RANDOM","случайно");
define("ACCEPT_RULES"," Я согласен с условиями и предупреждениями.");
define("ONE_PER_SERVER","Каждый игром имеет право иметь только один аккаунт на сервере.");
define("BEFORE_REGISTER","Перед тем как зарегистрироваться прочитайте <a href='../anleitung.php' target='_blank'>инструкции</a> TravianX чтобы понять особенности различных игровых племен на сервере.");
define("BUILDING_UPGRADING","Строительство:");
define("HOURS","ч.");
//ATTACKS ETC.
define("TROOP_MOVEMENTS","Перемещения войск:");
define("ARRIVING_REINF_TROOPS","Прибытие войск");
define("ARRIVING_REINF_TROOPS_SHORT","Приб.");
define("OWN_ATTACKING_TROOPS","Собственные атакующие войска");
define("ATTACK","Атака");
define("OWN_REINFORCING_TROOPS","Собственные прибивающие войска");
define("TROOPS_DORF","Войска:");
//LOGIN.php
define("COOKIES","You must have cookies enabled to be able to log in. If you share this computer with other people you should log out after each session for your own safety.");
define("NAME","Имя");
define("PW_FORGOTTEN","Забыли пароль?");
define("PW_REQUEST","Вы можете запросить другой пароль на свой почтовый адрес.");
define("PW_GENERATE","Создать новый пароль.");
define("EMAIL_NOT_VERIFIED","Email nне принят!");
define("EMAIL_FOLLOW","Проследуйте по следующей ссылке чтобы активировать аккаунт.");
define("VERIFY_EMAIL","Email подтвержден.");
//404.php
define("NOTHING_HERE","Ничего тут!");
define("WE_LOOKED","Мы посмотрели 404 раза и ничего не нашли");
//TIME RELATED
define("CALCULATED","Саздана за");
define("SERVER_TIME","Время сервера:");
//MASSMESSAGE.php
define("MASS","Сообщение");
define("MASS_SUBJECT","Тема:");
define("MASS_COLOR","Цвет сообщения:");
define("MASS_REQUIRED","Все поля рекомендуемые");
define("MASS_UNITS","Картинки (еденицы):");
define("MASS_SHOWHIDE","Показать/Скрыть");
define("MASS_READ","Read this: after adding smilie, you have to add left or right after number otherwise image will won't work");
define("MASS_CONFIRM","Confirmation");
define("MASS_REALLY","Do you really want to send MassIGM?");
define("MASS_ABORT","Aborting right now");
define("MASS_SENT","Mass IGM was sent");
/*
|--------------------------------------------------------------------------
| Index
|--------------------------------------------------------------------------
*/
$lang['index'][0][1] = "Welcome to " . SERVER_NAME . "";
$lang['index'][0][2] = "Manual";
$lang['index'][0][3] = "Play now, for free!";
$lang['index'][0][4] = "What is " . SERVER_NAME . "";
$lang['index'][0][5] = "" . SERVER_NAME . " is a <b>browser game</b> featuring an engaging ancient world with thousands of other real players.</p><p>It`s <strong>free to play</strong> and requires <strong>no downloads</strong>.";
$lang['index'][0][6] = "Click here to play " . SERVER_NAME . "";
$lang['index'][0][7] = "Total players";
$lang['index'][0][8] = "Players active";
$lang['index'][0][9] = "Players online";
$lang['index'][0][10] = "About the game";
$lang['index'][0][11] = "You will begin as the chief of a tiny village and will embark on an exciting quest.";
$lang['index'][0][12] = "Build up villages, wage wars or establish trade routes with your neighbours.";
$lang['index'][0][13] = "Play with and against thousands of other real players and conquer the the world of Travian.";
$lang['index'][0][14] = "News";
$lang['index'][0][15] = "FAQ";
$lang['index'][0][16] = "Screenshots";
$lang['forum'] = "Forum";
$lang['register'] = "Регистрация";
$lang['login'] = "Login";
/*
|--------------------------------------------------------------------------
| top_menu
|--------------------------------------------------------------------------
*/
$lang['header'] = array (
0 => 'Обзор деревни',
1 => 'Центр деревни',
2 => 'Карта',
3 => 'Статистика',
4 => 'Отчеты',
5 => 'Сообщения',
6 => 'Plus меню');
$lang['buildings'] = array (
1 => "Лесопилка",
2 => "Глиняный карьер",
3 => "Железный рудник",
4 => "Ферма",
5 => "Лесопильный завод",
6 => "Кирпичный завод",
7 => "Сталелитейный завод",
8 => "Мукомольная мельница",
9 => "Пекарня",
10 => "Склад",
11 => "Амбар",
12 => "Кузня",
13 => "Оружейня",
14 => "Арена",
15 => "Главное здание",
16 => "Пункт сбора",
17 => "Рынок",
18 => "Посольство",
19 => "Казарма",
20 => "Канюшня",
21 => "Мастерская",
22 => "Академия",
23 => "Тайник",
24 => "Ратуша",
25 => "Резиденция",
26 => "Дворец",
27 => "Сокровищница",
28 => "Торговая палата",
29 => "Большая казарма",
30 => "Большая конюшня",
31 => "Городская стена",
32 => "Земляной вал",
33 => "Изгородь",
34 => "Каменотес",
35 => "Пивоваренный завод",
36 => "Капканщик",
37 => "Таверна",
38 => "Большой склад",
39 => "Большой амбар",
40 => "Чудо Света",
41 => "Водопой",
42 => "Большая мастерская",
43 => "Ошибка",
44 => "&nbsp;(уровень&nbsp;");
$lang['fields'] = array (
0 => '&nbsp;уровень',
1 => 'Лесопилка уровень',
2 => 'Глиняный карьер уровень ',
3 => 'Железный рудник уровень',
4 => 'Ферма уровень',
5 => 'Наружняя строительная площадка',
6 => 'Строительная площадка',
7 => 'Строительная площадка пункта сбора');
$lang['npc'] = array (
0 => 'NPC торговец');
$lang['upgrade'] = array (
0 => 'Здание уже на максимальном уровне',
1 => 'Максимальный уровень здания строится',
2 => 'Здание будет снесено',
3 => '<b>Стоимость</b> строительства до уровня&nbsp;',
4 => 'Рабочие заняты.',
5 => 'Не хватает еды. Развивайте фермы.',
6 => 'Постройте склад.',
7 => 'Постройте амбар.',
8 => 'Достаточно ресурсов будет&nbsp;',
9 => '&nbsp;в&nbsp;&nbsp;',
10 => 'Улучшить до уровня&nbsp;',
11 => 'сегодня',
12 => 'завтра');
$lang['movement'] = array (
0 => 'в&nbsp;');
$lang['troops'] = array (
0 => 'нет',
1 => 'Герой');
?>
+372
View File
@@ -0,0 +1,372 @@
<?php
//////////////////////////////////////////////////////////////////////////////////////////////////////
// TRAVIANX //
// Only for advanced users, do not edit if you dont know what are you doing! //
// Made by: Dzoki & Dixie (TravianX) //
// - TravianX = Travian Clone Project - //
// DO NOT REMOVE COPYRIGHT NOTICE! //
//////////////////////////////////////////////////////////////////////////////////////////////////////
// //
// ENGLISH //
// Author: Dzoki //
/////////////////////////////
//MAIN MENU
define("TRIBE1","羅馬人");
define("TRIBE2","條頓人");
define("TRIBE3","高盧人");
define("TRIBE4","自然界");
define("TRIBE5","達賴族");
define("TRIBE6","Monsters");
define("HOME","首頁");
define("INSTRUCT","說明");
define("ADMIN_PANEL","管理員控制台-ACP");
define("MASS_MESSAGE","發送群信");
define("LOGOUT","登出");
define("PROFILE","個人資料");
define("SUPPORT","支援");
define("UPDATE_T_10","更新前10名");
define("SYSTEM_MESSAGE","系統公告");
define("TRAVIAN_PLUS","Travian <b><span class=\"plus_g\">P</span><span class=\"plus_o\">l</span><span class=\"plus_g\">u</span><span class=\"plus_o\">s</span></span></span></b>");
define("CONTACT","聯絡我們!");
define("GAME_RULES","遊戲規定");
//MENU
define("REG","註冊");
define("FORUM","論壇");
define("CHAT","聊天室");
define("IMPRINT","Imprint");
define("MORE_LINKS","更多連結");
define("TOUR","Game Tour");
//ERRORS
define("USRNM_EMPTY","(Username empty)");
define("USRNM_TAKEN","(Name is already in use.)");
define("USRNM_SHORT","(min. ".USRNM_MIN_LENGTH." figures)");
define("USRNM_CHAR","(Invalid Characters)");
define("PW_EMPTY","(Password empty)");
define("PW_SHORT","(min. ".PW_MIN_LENGTH." figures)");
define("PW_INSECURE","(Password insecure. Please choose a more secure one.)");
define("EMAIL_EMPTY","(Email Empty)");
define("EMAIL_INVALID","(Invalid email address)");
define("EMAIL_TAKEN","(Email is already in use)");
define("TRIBE_EMPTY","<li>Please choose a tribe.</li>");
define("AGREE_ERROR","<li>You have to agree to the game rules and the general terms & conditions in order to register.</li>");
define("LOGIN_USR_EMPTY","Enter name.");
define("LOGIN_PASS_EMPTY","Enter password.");
define("EMAIL_ERROR","Email does not match existing");
define("PASS_MISMATCH","Passwords do not match");
define("ALLI_OWNER","Please appoint an alliance owner before deleting");
define("SIT_ERROR","Sitter already set");
define("USR_NT_FOUND","Name does not exist.");
define("LOGIN_PW_ERROR","The password is wrong.");
define("WEL_TOPIC","Useful tips & information ");
define("ATAG_EMPTY","Tag empty");
define("ANAME_EMPTY","Name empty");
define("ATAG_EXIST","Tag taken");
define("ANAME_EXIST","Name taken");
define("NOT_OPENED_YET","Server not started yet.");
define("REGISTER_CLOSED","The register is closed. You can't register to this server.");
define("NAME_EMPTY","Please insert name");
define("NAME_NO_EXIST","There is no user with the name ");
define("ID_NO_EXIST","There is no user with the id ");
define("SAME_NAME","You can't invite yourself");
define("ALREADY_INVITED"," already invited");
define("ALREADY_IN_ALLY"," already in this alliance");
//COPYRIGHT
define("TRAVIAN_COPYRIGHT","TravianZ 100% Open Source Travian Clone.");
//BUILD.TPL
define("CUR_PROD","目前的產量");
define("NEXT_PROD","產量在等級 ");
//BUILDINGS
define("B1","伐木場");
define("B1_DESC","伐木場是砍伐木材的地方.伐木場等級越高,單位時間內能砍伐的木材也就越多.");
define("B2","泥坑");
define("B2_DESC","泥坑是生產泥土的地方.泥坑等級越高,單位時間內生產的磚塊也就越多.");
define("B3","鐵礦場");
define("B3_DESC","鐵礦場是用來採集鐵礦的.鐵礦場等級越高,每小時能採集的鐵礦就越多.");
define("B4","農場");
define("B4_DESC","農場是為居民生產糧食的地方.農場等級越高,所能生產的糧食也就越多.");
//DORF1
define("LUMBER","木材");
define("CLAY","磚塊");
define("IRON","鋼鐵");
define("CROP","穀物");
define("LEVEL","等級");
define("CROP_COM",CROP." consumption");
define("PER_HR","每小時");
define("PROD_HEADER","生產");
define("MULTI_V_HEADER","村莊");
define("ANNOUNCEMENT","Announcement");
define("GO2MY_VILLAGE","回到我的村莊");
define("VILLAGE_CENTER","地圖中心");
define("FINISH_GOLD","花費2金,結束這個村莊當前建築任務或者兵種研發, 升級的任務. (除了皇宮和行宮)");
define("WAITING_LOOP","(等待建築)");
define("HRS","(hrs.)");
define("DONE_AT","結束在");
define("CANCEL","取消");
define("LOYALTY","Loyalty:");
define("CALCULATED_IN","產生在");
define("SEVER_TIME","伺服器時間:");
//QUEST
define("Q_CONTINUE","Continue with the next task.");
define("Q_REWARD","Your reward:");
define("Q0","Welcome to ");
define("Q0_DESC","As I see you have been made chieftain of this little village. I will be your counselor for the first few days and never leave your (right hand) side.");
define("Q0_OPT1","To the first task.");
define("Q0_OPT2","Look around on your own.");
define("Q0_OPT3","Play no tasks.");
define("Q1","Task 1: Woodcutter");
define("Q1_DESC","There are four green forests around your village. Construct a woodcutter on one of them. Lumber is an important resource for our new settlement.");
define("Q1_ORDER","Order:<\/p>Construct a woodcutter.");
define("Q1_RESP","Yes, that way you gain more lumber.I helped a bit and completed the order instantly.");
define("Q1_REWARD","Woodcutter instantly completed.");
define("Q2","Task 2: Crop");
define("Q2_DESC","Now your subjects are hungry from working all day. Extend a cropland to improve your subjects' supply. Come back here once the building is complete.");
define("Q2_ORDER","Order:<\/p>Extend one cropland.");
define("Q2_RESP","Very good. Now your subjects have enough to eat again...");
define("Q3","Task 3: Your Village's Name");
define("Q3_DESC","Creative as you are you can grant your village the ultimate name.\r\n<br \/><br \/>\r\nClick on 'profile' in the left hand menu and then select 'change profile'...");
define("Q3_ORDER","Order:<\/p>Change your village's name to something nice.");
define("Q3_RESP","Wow, a great name for their village. It could have been the name of my village!...");
define("Q4","Task 4: Other Players");
define("Q4_DESC","In ". SERVER_NAME ." you play along with billions of other players. Click 'statistics' in the top menu to look up your rank and enter it here.");
define("Q4_ORDER","Order:<\/p>Look for your rank in the statistics and enter it here.");
define("Q4_BUTN","complete task");
define("Q4_RESP","Exactly! That's your rank.");
define("Q5","Task 5: Two Building Orders");
define("Q5_DESC","Build an iron mine and a clay pit. Of iron and clay one can never have enough.");
define("Q5_ORDER","Order:<\/p><ul><li>Extend one iron mine.<\/li><li>Extend one clay pit.<\/li><\/ul>");
define("Q5_RESP","As you noticed, building orders take rather long. The world of ". SERVER_NAME ." will continue to spin even if you are offline. Even in a few months there will be many new things for you to discover.\r\n<br \/><br \/>\r\nThe best thing to do is occasionally checking your village and giving you subjects new tasks to do.");
define("Q6","Message From The Taskmaster");
define("Q6_DESC","You are to be informed that a nice reward is waiting for you at the taskmaster.<br /><br />Hint: The message has been generated automatically. An answer is not necessary.");
define("Q5","Task 5: Two Building Orders");
define("Q5_DESC","Build an iron mine and a clay pit. Of iron and clay one can never have enough.");
define("Q5_ORDER","Order:<\/p><ul><li>Extend one iron mine.<\/li><li>Extend one clay pit.<\/li><\/ul>");
define("Q5_RESP","As you noticed, building orders take rather long. The world of ". SERVER_NAME ." will continue to spin even if you are offline. Even in a few months there will be many new things for you to discover.\r\n<br \/><br \/>\r\nThe best thing to do is occasionally checking your village and giving you subjects new tasks to do.");
//======================================================//
//================ UNITS - DO NOT EDIT! ================//
//======================================================//
define("U0","英雄");
//ROMAN UNITS
define("U1","Legionnaire");
define("U2","Praetorian");
define("U3","Imperian");
define("U4","Equites Legati");
define("U5","Equites Imperatoris");
define("U6","Equites Caesaris");
define("U7","Battering Ram");
define("U8","Fire Catapult");
define("U9","Senator");
define("U10","Settler");
//TEUTON UNITS
define("U11","Clubswinger");
define("U12","Spearman");
define("U13","Axeman");
define("U14","Scout");
define("U15","Paladin");
define("U16","Teutonic Knight");
define("U17","Ram");
define("U18","Catapult");
define("U19","Chief");
define("U20","Settler");
//GAUL UNITS
define("U21","Phalanx");
define("U22","Swordsman");
define("U23","Pathfinder");
define("U24","Theutates Thunder");
define("U25","Druidrider");
define("U26","Haeduan");
define("U27","Ram");
define("U28","Trebuchet");
define("U29","Chieftain");
define("U30","Settler");
define("U99","Trap");
//NATURE UNITS
define("U31","Rat");
define("U32","Spider");
define("U33","Snake");
define("U34","Bat");
define("U35","Wild Boar");
define("U36","Wolf");
define("U37","Bear");
define("U38","Crocodile");
define("U39","Tiger");
define("U40","Elephant");
//NATARS UNITS
define("U41","Pikeman");
define("U42","Thorned Warrior");
define("U43","Guardsman");
define("U44","Birds Of Prey");
define("U45","Axerider");
define("U46","Natarian Knight");
define("U47","War Elephant");
define("U48","Ballista");
define("U49","Natarian Emperor");
define("U50","Natarian Settler");
//MONSTER UNITS
define("U51","Monster Peon");
define("U52","Monster Hunter");
define("U53","Monster Warrior");
define("U54","Ghost");
define("U55","Monster Steed");
define("U56","Monster War Steed");
define("U57","Monster Ram");
define("U58","Monster Catapult");
define("U59","Monster Chief");
define("U60","Monster Settler");
// RESOURCES
define("R1","Lumber");
define("R2","Clay");
define("R3","Iron");
define("R4","Crop");
//INDEX.php
define("LOGIN","Login");
define("PLAYERS","Players");
define("ACTIVE","Active");
define("ONLINE","Online");
define("TUTORIAL","Tutorial");
define("PLAYER_STATISTICS","Player statistics");
define("TOTAL_PLAYERS","".PLAYERS." in total");
define("ACTIVE_PLAYERS","Active players");
define("ONLINE_PLAYERS","".PLAYERS." online");
define("MP_STRATEGY_GAME","".SERVER_NAME." - the multiplayer strategy game");
define("WHAT_IS","".SERVER_NAME." is one of the most popular browser games in the world. As a player in ".SERVER_NAME.", you will build your own empire, recruit a mighty army, and fight with your allies for game world hegemony.");
define("REGISTER_FOR_FREE","Register here for free!");
define("LATEST_GAME_WORLD","Latest game world");
define("LATEST_GAME_WORLD2","Register on the latest<br/>game world and enjoy<br/>the advantages of<br/>being one of the<br/>first players.");
define("PLAY_NOW","Play ".SERVER_NAME." now");
define("LEARN_MORE","Learn more <br/>about ".SERVER_NAME."!");
define("LEARN_MORE2","Now with a revolutionised<br>server system, completely new<br>graphics <br>This clone is The Shiz!");
define("COMUNITY","Community");
define("BECOME_COMUNITY","Become part of our community now!");
define("BECOME_COMUNITY2","Become a part of one of<br>the biggest gaming<br>communities in the<br>world.");
define("NEWS","News");
define("SCREENSHOTS","Screenshots");
define("LEARN1","Upgrade your fields and mines to increase your resource production. You will need resources to construct buildings and train soldiers.");
define("LEARN2","Construct and expand the buildings in your village. Buildings improve your overall infrastructure, increase your resource production and allow you to research, train and upgrade your troops.");
define("LEARN3","View and interact with your surroundings. You can make new friends or new enemies, make use of the nearby oases and observe as your empire grows and becomes stronger.");
define("LEARN4","Follow your improvement and success and compare yourself to other players. Look at the Top 10 rankings and fight to win a weekly medal.");
define("LEARN5","Receive detailed reports about your adventures, trades and battles. Don't forget to check the brand new reports about the happenings taking place in your surroundings.");
define("LEARN6","Exchange information and conduct diplomacy with other players. Always remember that communication is the key to winning new friends and solving old conflicts.");
define("LOGIN_TO","Log in to ". SERVER_NAME);
define("REGIN_TO","Register in ". SERVER_NAME);
define("P_ONLINE","Players online: ");
define("P_TOTAL","Players in total: ");
define("CHOOSE","Please choose a server.");
define("STARTED"," The server started ". round((time()-COMMENCE)/86400) ." days ago.");
//ANMELDEN.php
define("NICKNAME","暱稱");
define("EMAIL","電郵信箱");
define("PASSWORD","密碼");
define("ROMANS","羅馬人");
define("TEUTONS","條頓人");
define("GAULS","高盧人");
define("NW","西北方");
define("NE","東北方");
define("SW","西南方");
define("SE","東南方");
define("RANDOM","隨機");
define("ACCEPT_RULES"," 我接受本遊戲的 遊戲規定 和 條款.");
define("ONE_PER_SERVER","每個服務器,每個玩家只能擁有一個帳戶.");
define("BEFORE_REGISTER","在你創造帳號之前請你務必閱讀 <a href='../anleitung.php' target='_blank'>遊戲說明</a> 了解 TravianX 3個種族的優點和缺點");
define("BUILDING_UPGRADING","建築:");
define("HOURS","小時");
//ATTACKS ETC.
define("TROOP_MOVEMENTS","軍隊移動:");
define("ARRIVING_REINF_TROOPS","Arriving reinforcing troops");
define("ARRIVING_REINF_TROOPS_SHORT","Reinf.");
define("OWN_ATTACKING_TROOPS","Own attacking troops");
define("ATTACK","攻擊");
define("OWN_REINFORCING_TROOPS","Own reinforcing troops");
define("TROOPS_DORF","軍隊:");
//LOGIN.php
define("COOKIES","You must have cookies enabled to be able to log in. If you share this computer with other people you should log out after each session for your own safety.");
define("NAME","名稱");
define("PW_FORGOTTEN","忘記密碼?");
define("PW_REQUEST","Then you can request a new one which will be sent to your email address.");
define("PW_GENERATE","產生一組新密碼.");
define("EMAIL_NOT_VERIFIED","電子郵件帳號不正確!");
define("EMAIL_FOLLOW","Follow this link to activate your account.");
define("VERIFY_EMAIL","驗證郵件.");
//404.php
define("NOTHING_HERE","Nothing here!");
define("WE_LOOKED","We looked 404 times already but can't find anything");
//TIME RELATED
define("CALCULATED","產生在");
define("SERVER_TIME","伺服器時間:");
//MASSMESSAGE.php
define("MASS","Message Content");
define("MASS_SUBJECT","主旨:");
define("MASS_COLOR","Message color:");
define("MASS_REQUIRED","All fields required");
define("MASS_UNITS","Images (units):");
define("MASS_SHOWHIDE","Show/Hide");
define("MASS_READ","Read this: after adding smilie, you have to add left or right after number otherwise image will won't work");
define("MASS_CONFIRM","Confirmation");
define("MASS_REALLY","Do you really want to send MassIGM?");
define("MASS_ABORT","Aborting right now");
define("MASS_SENT","Mass IGM was sent");
/*
|--------------------------------------------------------------------------
| Index
|--------------------------------------------------------------------------
*/
$lang['index'][0][1] = "Welcome to " . SERVER_NAME . "";
$lang['index'][0][2] = "Manual";
$lang['index'][0][3] = "這是免費的, 現在就加入!";
$lang['index'][0][4] = "What is " . SERVER_NAME . "";
$lang['index'][0][5] = "" . SERVER_NAME . " 是 <b>網頁遊戲</b> 是架構於瀏覽器的遊戲<BR />TRAVIAN世界內有數千至數萬名玩家,一名玩家就是一個村莊的領主,以外交、權謀、諜戰、結盟、分工等等謀略,成為中世紀霸主<br /><p>這是 <strong>免費的</strong> 而且 <strong>不用下載</strong>.";
$lang['index'][0][6] = "點擊這裡玩 " . SERVER_NAME . "";
$lang['index'][0][7] = "總人數";
$lang['index'][0][8] = "活躍的玩家";
$lang['index'][0][9] = "在線的玩家";
$lang['index'][0][10] = "About the game";
$lang['index'][0][11] = "You will begin as the chief of a tiny village and will embark on an exciting quest.";
$lang['index'][0][12] = "Build up villages, wage wars or establish trade routes with your neighbours.";
$lang['index'][0][13] = "Play with and against thousands of other real players and conquer the the world of Travian.";
$lang['index'][0][14] = "新聞";
$lang['index'][0][15] = "說明";
$lang['index'][0][16] = "遊戲截圖";
$lang['forum'] = "論壇";
$lang['register'] = "註冊";
$lang['login'] = "登入";
?>
+110
View File
@@ -0,0 +1,110 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Logging.php ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class Logging {
public function addIllegal($uid,$ref,$type) {
global $database;
if(LOG_ILLEGAL) {
$log = "Attempted to ";
switch($type) {
case 1:
$log .= "access village $ref";
break;
}
$q = "Insert into ".TB_PREFIX."illegal_log values (0,$uid,'$log')";
$database->query($q);
}
}
public function addLoginLog($id,$ip) {
global $database;
if(LOG_LOGIN) {
$q = "Insert into ".TB_PREFIX."login_log values (0,$id,'$ip')";
$database->query($q);
}
}
public function addBuildLog($wid,$building,$level,$type) {
global $database;
if(LOG_BUILD) {
if($type) {
$log = "Start Construction of ";
}
else {
$log = "Start Upgrade of ";
}
$log .= $building." at level ".$level;
$q = "Insert into ".TB_PREFIX."build_log values (0,$wid,'$log')";
$database->query($q);
}
}
public function addTechLog($wid,$tech,$level) {
global $database;
if(LOG_TECH) {
$log = "Upgrading of tech ".$tech." to level ".$level;
$q = "Insert into ".TB_PREFIX."tech_log values (0,$wid,'$log')";
$database->query($q);
}
}
public function goldFinLog($wid) {
global $database;
if(LOG_GOLD_FIN) {
$log = "Finish construction and research with gold";
$q = "Insert into ".TB_PREFIX."gold_fin_log values (0,$wid,'$log')";
$database->query($q);
}
}
public function addAdminLog() {
global $database;
}
public function addMarketLog($wid,$type,$data) {
global $database;
if(LOG_MARKET) {
if($type == 1) {
$log = "Sent ".$data[0].",".$data[1].",".$data[2].",".$data[3]." to village ".$data[4];
}
else if($type == 2) {
$log = "Traded resource between ".$wid." and ".$data[0]." market ref is ".$data[1];
}
$q = "Insert into ".TB_PREFIX."market_log values (0,$wid,'$log')";
$database->query($q);
}
}
public function addWarLog() {
global $database;
}
public function clearLogs() {
global $database;
}
public function debug($time,$uid,$debug_info) {
global $database;
//$debugFile = "/tmp/debug";
//$fh = fopen($debugFile, 'a') or die('No debug file');
//fwrite($fh,"\n".date("Y-m-d H:i:s")." : ".$time.",".$uid.",".$debug_info."\n");
//fclose($fh);
$q = "INSERT INTO ".TB_PREFIX."debug_log (time,uid,debug_info) VALUES ($time,$uid,'$debug_info')";
$database->query($q);
}
};
$logging = new Logging;
//$logging->debug(time(),2,'Logging.php loaded');
?>
+95
View File
@@ -0,0 +1,95 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Mailer.php ##
## Developed by: Dixie ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class Mailer {
function sendActivate($email,$username,$pass,$act) {
$subject = "Welcome to ".SERVER_NAME;
$message = "Hello ".$username."
Thank you for your registration.
----------------------------
Name: ".$username."
Password: ".$pass."
Activation code: ".$act."
----------------------------
Click the following link in order to activate your account:
".SERVER."activate.php?code=".$act."
Greetings,
Travian adminision";
$headers = "From: ".ADMIN_EMAIL."\n";
mail($email, $subject, $message, $headers);
}
function sendInvite($email,$uid,$text) {
$subject = "".SERVER_NAME." registeration";
$message = "Hello ".$username."
Try the new ".SERVER_NAME."!
Link: ".SERVER."anmelden.php?id=ref".$uid."
".$text."
Greetings,
Travian";
$headers = "From: ".ADMIN_EMAIL."\n";
mail($email, $subject, $message, $headers);
}
function sendPassword($email,$uid,$username,$npw,$cpw) {
$subject = "Password forgotten";
$message = "Hello ".$username."
You have requested a new password for Travian.
----------------------------
Name: ".$username."
Password: ".$npw."
----------------------------
Please click this link to activate your new password. The old password then
becomes invalid:
http://${_SERVER['HTTP_HOST']}/password.php?cpw=$cpw&npw=$uid
If you want to change your new password, you can enter a new one in your profile
on tab \"account\".
In case you did not request a new password you may ignore this email.
Travian
";
$headers = "From: ".ADMIN_EMAIL."\n";
mail($email, $subject, $message, $headers);
}
};
$mailer = new Mailer;
?>
+358
View File
@@ -0,0 +1,358 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Market.php ##
## Developed by: Dzoki ##
## Some fixes: aggenkeech ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class Market
{
public $onsale,$onmarket,$sending,$recieving,$return = array();
public $maxcarry,$merchant,$used;
public function procMarket($post)
{
$this->loadMarket();
if(isset($_SESSION['loadMarket']))
{
$this->loadOnsale();
unset($_SESSION['loadMarket']);
}
if(isset($post['ft']))
{
switch($post['ft'])
{
case "mk1": $this->sendResource($post); break;
case "mk2": $this->addOffer($post); break;
case "mk3": $this->tradeResource($post); break;
}
}
}
public function procRemove($get)
{
global $database,$village,$session;
if(isset($get['t']) && $get['t'] == 1)
{
$this->filterNeed($get);
}
else if(isset($get['t']) && $get['t'] ==2 && isset($get['a']) && $get['a'] == 5 && isset($get['del']))
{
//GET ALL FIELDS FROM MARKET
$type = $database->getMarketField($village->wid,"gtype");
$amt = $database->getMarketField($village->wid,"gamt");
$vref = $village->wid;
$database->getResourcesBack($vref,$type,$amt);
$database->addMarket($village->wid,$get['del'],0,0,0,0,0,0,1);
header("Location: build.php?id=".$get['id']."&t=2");
}
if(isset($get['t']) && $get['t'] == 1 && isset($get['a']) && $get['a'] == $session->mchecker && !isset($get['del']))
{
$session->changeChecker();
$this->acceptOffer($get);
}
}
public function merchantAvail()
{
return $this->merchant - $this->used;
}
private function loadMarket()
{
global $session,$building,$bid28,$bid17,$database,$village;
$this->recieving = $database->getMovement(0,$village->wid,1);
$this->sending = $database->getMovement(0,$village->wid,0);
$this->return = $database->getMovement(2,$village->wid,1);
$this->merchant = ($building->getTypeLevel(17) > 0)? $bid17[$building->getTypeLevel(17)]['attri'] : 0;
$this->used = $database->totalMerchantUsed($village->wid);
$this->onmarket = $database->getMarket($village->wid,0);
$this->maxcarry = ($session->tribe == 1)? 500 : (($session->tribe == 2)? 1000 : 750);
$this->maxcarry *= TRADER_CAPACITY;
if($building->getTypeLevel(28) != 0)
{
$this->maxcarry *= $bid28[$building->getTypeLevel(28)]['attri'] / 100;
}
}
private function sendResource($post)
{
global $database,$village,$session,$generator,$logging;
$wtrans = (isset($post['r1']) && $post['r1'] != "")? $post['r1'] : 0;
$ctrans = (isset($post['r2']) && $post['r2'] != "")? $post['r2'] : 0;
$itrans = (isset($post['r3']) && $post['r3'] != "")? $post['r3'] : 0;
$crtrans = (isset($post['r4']) && $post['r4'] != "")? $post['r4'] : 0;
$wtrans = str_replace("-", "", $wtrans);
$ctrans = str_replace("-", "", $ctrans);
$itrans = str_replace("-", "", $itrans);
$crtrans = str_replace("-", "", $crtrans);
$availableWood = $database->getWoodAvailable($village->wid);
$availableClay = $database->getClayAvailable($village->wid);
$availableIron = $database->getIronAvailable($village->wid);
$availableCrop = $database->getCropAvailable($village->wid);
if($session->access == BANNED)
{
header("Location: banned.php");
}
else if($availableWood >= $post['r1'] AND $availableClay >= $post['r2'] AND $availableIron >= $post['r3'] AND $availableCrop >= $post['r4'])
{
$resource = array($wtrans,$ctrans,$itrans,$crtrans);
$reqMerc = ceil((array_sum($resource)-0.1)/$this->maxcarry);
if($this->merchantAvail() != 0 && $reqMerc <= $this->merchantAvail())
{
$id = $post['getwref'];
$coor = $database->getCoor($id);
if($database->getVillageState($id))
{
$timetaken = $generator->procDistanceTime($coor,$village->coor,$session->tribe,0);
$res = $resource[0]+$resource[1]+$resource[2]+$resource[3];
if($res!=0)
{
$reference = $database->sendResource($resource[0],$resource[1],$resource[2],$resource[3],$reqMerc,0);
$database->modifyResource($village->wid,$resource[0],$resource[1],$resource[2],$resource[3],0);
$database->addMovement(0,$village->wid,$id,$reference,time(),time()+$timetaken,$post['send3']);
$logging->addMarketLog($village->wid,1,array($resource[0],$resource[1],$resource[2],$resource[3],$id));
}
}
}
header("Location: build.php?id=".$post['id']);
}
else
{
// something
}
}
private function addOffer($post)
{
global $database,$village,$session;
if($post['rid1'] == $post['rid2'])
{
// Trading res for res of same type (invalid)
header("Location: build.php?id=".$post['id']."&t=2&e2");
}
elseif($post['m1'] > (2 * $post['m2']))
{
// Trade is for more than 2x (invalid)
header("Location: build.php?id=".$post['id']."&t=2&e2");
}
elseif($post['m2'] > (2 * $post['m1']))
{
// Trade is for less than 0.5x (invalid)
header("Location: build.php?id=".$post['id']."&t=2&e2");
}
else
{
$wood = ($post['rid1'] == 1)? $post['m1'] : 0;
$clay = ($post['rid1'] == 2)? $post['m1'] : 0;
$iron = ($post['rid1'] == 3)? $post['m1'] : 0;
$crop = ($post['rid1'] == 4)? $post['m1'] : 0;
$availableWood = $database->getWoodAvailable($village->wid);
$availableClay = $database->getClayAvailable($village->wid);
$availableIron = $database->getIronAvailable($village->wid);
$availableCrop = $database->getCropAvailable($village->wid);
if($session->access == BANNED)
{
header("Location: banned.php");
}
elseif($availableWood >= $wood AND $availableClay >= $clay AND $availableIron >= $iron AND $availableCrop >= $crop)
{
$reqMerc = 1;
if(($wood+$clay+$iron+$crop) > $this->maxcarry)
{
$reqMerc = round(($wood+$clay+$iron+$crop)/$this->maxcarry);
if(($wood+$clay+$iron+$crop) > $this->maxcarry*$reqMerc)
{
$reqMerc += 1;
}
}
if($this->merchantAvail() != 0 && $reqMerc <= $this->merchantAvail())
{
if($database->modifyResource($village->wid,$wood,$clay,$iron,$crop,0))
{
$time = 0;
if(isset($_POST['d1']))
{
$time = $_POST['d2'] * 3600;
}
$alliance = (isset($post['ally']) && $post['ally'] == 1)? $session->userinfo['alliance'] : 0;
$database->addMarket($village->wid,$post['rid1'],$post['m1'],$post['rid2'],$post['m2'],$time,$alliance,$reqMerc,0);
}
// Enough merchants
header("Location: build.php?id=".$post['id']."&t=2");
}
else
{
// Not enough merchants
header("Location: build.php?id=".$post['id']."&t=2&e3");
}
}
else
{
// not enough resources
header("Location: build.php?id=".$post['id']."&t=2&e1");
}
}
}
private function acceptOffer($get)
{
global $database,$village,$session,$logging,$generator;
$infoarray = $database->getMarketInfo($get['g']);
$reqMerc = 1;
if($infoarray['wamt'] > $this->maxcarry)
{
$reqMerc = round($infoarray['wamt']/$this->maxcarry);
if($infoarray['wamt'] > $this->maxcarry*$reqMerc)
{
$reqMerc += 1;
}
}
$myresource = $hisresource = array(1=>0,0,0,0);
$myresource[$infoarray['wtype']] = $infoarray['wamt'];
$mysendid = $database->sendResource($myresource[1],$myresource[2],$myresource[3],$myresource[4],$reqMerc,0);
$hisresource[$infoarray['gtype']] = $infoarray['gamt'];
$hissendid = $database->sendResource($hisresource[1],$hisresource[2],$hisresource[3],$hisresource[4],$infoarray['merchant'],0);
$hiscoor = $database->getCoor($infoarray['vref']);
$mytime = $generator->procDistanceTime($hiscoor,$village->coor,$session->tribe,0);
$targettribe = $database->getUserField($database->getVillageField($infoarray['vref'],"owner"),"tribe",0);
$histime = $generator->procDistanceTime($village->coor,$hiscoor,$targettribe,0);
$database->addMovement(0,$village->wid,$infoarray['vref'],$mysendid,time(),$mytime+time());
$database->addMovement(0,$infoarray['vref'],$village->wid,$hissendid,time(),$histime+time());
$resource = array(1=>0,0,0,0);
$resource[$infoarray['wtype']] = $infoarray['wamt'];
$database->modifyResource($village->wid,$resource[1],$resource[2],$resource[3],$resource[4],0);
$database->setMarketAcc($get['g']);
$database->removeAcceptedOffer($get['g']);
$logging->addMarketLog($village->wid,2,array($infoarray['vref'],$get['g']));
header("Location: build.php?id=".$get['id']);
}
private function loadOnsale()
{
global $database,$village,$session,$multisort,$generator;
$displayarray = $database->getMarket($village->wid,1);
$holderarray = array();
foreach($displayarray as $value)
{
$targetcoor = $database->getCoor($value['vref']);
$duration = $generator->procDistanceTime($targetcoor,$village->coor,$session->tribe,0);
if($duration <= $value['maxtime'] || $value['maxtime'] == 0)
{
$value['duration'] = $duration;
array_push($holderarray,$value);
}
}
$this->onsale = $multisort->sorte($holderarray, "'duration'", true, 2);
}
private function filterNeed($get)
{
if(isset($get['v']) || isset($get['s']) || isset($get['b']))
{
$holder = $holder2 = array();
if(isset($get['v']) && $get['v'] == "1:1")
{
foreach($this->onsale as $equal)
{
if($equal['wamt'] <= $equal['gamt'])
{
array_push($holder,$equal);
}
}
}
else
{
$holder = $this->onsale;
}
foreach($holder as $sale)
{
if(isset($get['s']) && isset($get['b']))
{
if($sale['gtype'] == $get['s'] && $sale['wtype'] == $get['b'])
{
array_push($holder2,$sale);
}
}
else if(isset($get['s']) && !isset($get['b']))
{
if($sale['gtype'] == $get['s'])
{
array_push($holder2,$sale);
}
}
else if(isset($get['b']) && !isset($get['s']))
{
if($sale['wtype'] == $get['b'])
{
array_push($holder2,$sale);
}
}
else
{
$holder2 = $holder;
}
}
$this->onsale = $holder2;
}
else
{
$this->loadOnsale();
}
}
private function tradeResource($post)
{
global $session,$database,$village;
$wwvillage = $database->getResourceLevel($village->wid);
if($wwvillage['f99t']!=40)
{
if($session->userinfo['gold'] >= 3)
{
//kijken of ze niet meer gs invoeren dan ze hebben
if($session->access == BANNED)
{
header("Location: banned.php");
}
else if (($post['m2'][0]+$post['m2'][1]+$post['m2'][2]+$post['m2'][3])<=(round($village->awood)+round($village->aclay)+round($village->airon)+round($village->acrop)))
{
$database->setVillageField($village->wid,"wood",$post['m2'][0]);
$database->setVillageField($village->wid,"clay",$post['m2'][1]);
$database->setVillageField($village->wid,"iron",$post['m2'][2]);
$database->setVillageField($village->wid,"crop",$post['m2'][3]);
$database->modifyGold($session->uid,3,0);
header("Location: build.php?id=".$post['id']."&t=3&c");;
}
else
{
header("Location: build.php?id=".$post['id']."&t=3");
}
}
else
{
header("Location: build.php?id=".$post['id']."&t=3");
}
}
}
};
$market = new Market;
?>
+576
View File
@@ -0,0 +1,576 @@
<?php
/** --------------------------------------------------- **\
| ********* DO NOT REMOVE THIS COPYRIGHT NOTICE ********* |
+---------------------------------------------------------+
| Credits: All the developers including the leaders: |
| Advocaite & Dzoki & Donnchadh |
| |
| Copyright: TravianX Project All rights reserved |
\** --------------------------------------------------- **/
class Message {
public $unread, $nunread = false;
public $note;
public $inbox, $inbox1, $sent, $sent1, $reading, $reply, $archived, $archived1, $noticearray, $notice, $readingNotice = array();
private $totalMessage, $totalNotice;
private $allNotice = array();
function Message() {
$this->getMessages();
$this->getNotice();
if($this->totalMessage > 0) {
$this->unread = $this->checkUnread();
}
if($this->totalNotice > 0) {
$this->nunread = $this->checkNUnread();
}
if(isset($_SESSION['reply'])) {
$this->reply = $_SESSION['reply'];
unset($_SESSION['reply']);
}
}
public function procMessage($post) {
if(isset($post['ft'])) {
switch($post['ft']) {
case "m1":
$this->quoteMessage($post['id']);
break;
case "m2":
if ($post['an'] == "[ally]"){
$this->sendAMessage($post['be'],addslashes($post['message']));
}else{
$this->sendMessage($post['an'],$post['be'],addslashes($post['message']));
}
header("Location: nachrichten.php?t=2");
break;
case "m3":
case "m4":
case "m5":
if(isset($post['delmsg_x'])) {
$this->removeMessage($post);
$this->header($get);
}
if(isset($post['archive_x'])) {
$this->archiveMessage($post);
}
if(isset($post['start_x'])) {
$this->unarchiveMessage($post);
}
break;
case "m6":
$this->createNote($post);
break;
case "m7":
$this->addFriends($post);
break;
}
}
}
public function noticeType($get) {
global $session, $database;
if(isset($get['t'])) {
if($get['t'] == 1) {
$type = array(8, 15, 16, 17);
}
if($get['t'] == 2) {
$type = array(10, 11, 12, 13);
}
if($get['t'] == 3) {
$type = array(1, 2, 3, 4, 5, 6, 7);
}
if($get['t'] == 4) {
$type = array(0, 18, 19, 20, 21);
}
if($get['t'] == 5) {
if(!$session->plus){
header("Location: berichte.php");
} else {
$type = 9;
}
}
if (!is_array($type)) { $type = array($type); }
$this->noticearray = $this->filter_by_value($database->getNotice($session->uid), "ntype", $type);
$this->notice = $this->filter_by_value($database->getNotice3($session->uid), "ntype", $type);
}
if(isset($get['id'])) {
$this->readingNotice = $this->getReadNotice($get['id']);
}
}
public function procNotice($post) {
if(isset($post["del_x"])) {
$this->removeNotice($post);
}
if(isset($post['archive_x'])) {
$this->archiveNotice($post);
}
if(isset($post['start_x'])) {
$this->unarchiveNotice($post);
}
}
public function quoteMessage($id) {
foreach($this->inbox as $message) {
if($message['id'] == $id) {
$message = preg_replace('/\[message\]/', '', $message);
$message = preg_replace('/\[\/message\]/', '', $message);
for($i=1;$i<=$message['alliance'];$i++){
$message = preg_replace('/\[alliance'.$i.'\]/', '[alliance0]', $message);
$message = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance0]', $message);
}
for($i=0;$i<=$message['player'];$i++){
$message = preg_replace('/\[player'.$i.'\]/', '[player0]', $message);
$message = preg_replace('/\[\/player'.$i.'\]/', '[/player0]', $message);
}
for($i=0;$i<=$message['coor'];$i++){
$message = preg_replace('/\[coor'.$i.'\]/', '[coor0]', $message);
$message = preg_replace('/\[\/coor'.$i.'\]/', '[/coor0]', $message);
}
for($i=0;$i<=$message['report'];$i++){
$message = preg_replace('/\[report'.$i.'\]/', '[report0]', $message);
$message = preg_replace('/\[\/report'.$i.'\]/', '[/report0]', $message);
}
$this->reply = $_SESSION['reply'] = $message;
header("Location: nachrichten.php?t=1&id=" . $message['owner']);
}
}
}
public function loadMessage($id) {
global $database, $session;
if($this->findInbox($id)) {
foreach($this->inbox as $message) {
if($message['id'] == $id) {
$this->reading = $message;
}
}
}
if($this->findSent($id)) {
foreach($this->sent as $message) {
if($message['id'] == $id) {
$this->reading = $message;
}
}
}
if($session->plus && $this->findArchive($id)) {
foreach($this->archived as $message) {
if($message['id'] == $id) {
$this->reading = $message;
}
}
}
if($this->reading['viewed'] == 0) {
$database->getMessage($id, 4);
}
}
private function filter_by_value_except($array, $index, $value) {
$newarray = array();
if(is_array($array) && count($array) > 0) {
foreach(array_keys($array) as $key) {
$temp[$key] = $array[$key][$index];
if($temp[$key] != $value) {
array_push($newarray, $array[$key]);
//$newarray[$key] = $array[$key];
}
}
}
return $newarray;
}
private function filter_by_value($array, $index, $value) {
$newarray = array();
if(is_array($array) && count($array) > 0) {
foreach(array_keys($array) as $key) {
$temp[$key] = $array[$key][$index];
if(in_array($temp[$key], $value)) {
array_push($newarray, $array[$key]);
//$newarray[$key] = $array[$key];
}
}
}
return $newarray;
}
private function getNotice() {
global $database, $session;
$this->allNotice = $database->getNotice3($session->uid);
$this->noticearray = $this->filter_by_value_except($database->getNotice($session->uid), "ntype", 9);
$this->notice = $this->filter_by_value_except($this->allNotice, "ntype", 9);
$this->totalNotice = count($this->allNotice);
}
private function removeMessage($post) {
global $database,$session;
for($i = 1; $i <= 10; $i++) {
if(isset($post['n' . $i])) {
$message1 = mysql_query("SELECT * FROM " . TB_PREFIX . "mdata where id = ".$post['n' . $i]."");
$message = mysql_fetch_array($message1);
if($message['target'] == $session->uid && $message['owner'] == $session->uid){
$database->getMessage($post['n' . $i], 8);
}else if($message['target'] == $session->uid){
$database->getMessage($post['n' . $i], 5);
}else if($message['owner'] == $session->uid){
$database->getMessage($post['n' . $i], 7);
}
}
}
header("Location: nachrichten.php");
}
private function archiveMessage($post) {
global $database;
for($i = 1; $i <= 10; $i++) {
if(isset($post['n' . $i])) {
$database->setArchived($post['n' . $i]);
}
}
header("Location: nachrichten.php");
}
private function unarchiveMessage($post) {
global $database;
for($i = 1; $i <= 10; $i++) {
if(isset($post['n' . $i])) {
$database->setNorm($post['n' . $i]);
}
}
header("Location: nachrichten.php");
}
private function removeNotice($post) {
global $database;
for($i = 1; $i <= 10; $i++) {
if(isset($post['n' . $i])) {
$database->removeNotice($post['n' . $i], 5);
}
}
header("Location: berichte.php");
}
private function archiveNotice($post) {
global $database;
for($i = 1; $i <= 10; $i++) {
if(isset($post['n' . $i])) {
$database->archiveNotice($post['n' . $i]);
}
}
header("Location: berichte.php");
}
private function unarchiveNotice($post) {
global $database;
for($i = 1; $i <= 10; $i++) {
if(isset($post['n' . $i])) {
$database->unarchiveNotice($post['n' . $i]);
}
}
header("Location: berichte.php");
}
private function getReadNotice($id) {
global $database;
foreach($this->allNotice as $notice) {
if($notice['id'] == $id) {
$database->noticeViewed($notice['id']);
return $notice;
}
}
}
public function loadNotes() {
global $session;
if(file_exists("GameEngine/Notes/" . md5($session->username) . ".txt")) {
$this->note = file_get_contents("GameEngine/Notes/" . md5($session->username) . ".txt");
} else {
$this->note = "";
}
}
private function createNote($post) {
global $session;
if($session->plus) {
$ourFileHandle = fopen("GameEngine/Notes/" . md5($session->username) . ".txt", 'w');
fwrite($ourFileHandle, $post['notizen']);
fclose($ourFileHandle);
}
}
private function getMessages() {
global $database, $session;
$this->inbox = $database->getMessage($session->uid, 1);
$this->sent = $database->getMessage($session->uid, 2);
$this->inbox1 = $database->getMessage($session->uid, 9);
$this->sent1 = $database->getMessage($session->uid, 10);
if($session->plus) {
$this->archived = $database->getMessage($session->uid, 6);
$this->archived1 = $database->getMessage($session->uid, 11);
}
$this->totalMessage = count($this->inbox) + count($this->sent);
}
private function sendAMessage($topic,$text) {
global $session,$database;
$allmembersQ = mysql_query("SELECT id FROM ".TB_PREFIX."users WHERE alliance='".$session->alliance."'");
$userally = $database->getUserField($session->uid,"alliance",0);
$permission=mysql_fetch_array(mysql_query("SELECT opt7 FROM ".TB_PREFIX."ali_permission WHERE uid='".$session->uid."'"));
if(WORD_CENSOR) {
$topic = $this->wordCensor($topic);
$text = $this->wordCensor($text);
}
if($topic == "") {
$topic = "No subject";
}
if(!preg_match('/\[message\]/',$text) && !preg_match('/\[\/message\]/',$text)){
$text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
$alliance2 = preg_replace('/\[\/alliance'.$i.'\](.*?)\[\/message\]/is', '', $text);
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1;
}
}
}
for($i=0;$i<=$player;$i++){
if(preg_match('/\[player'.$i.'\]/',$text) && preg_match('/\[\/player'.$i.'\]/',$text)){
$player1 = preg_replace('/\[message\](.*?)\[\/player'.$i.'\]/is', '', $text);
if(preg_match('/\[player'.$i.'\]/',$player1) && preg_match('/\[\/player'.$i.'\]/',$player1)){
$j = $i+1;
$player2 = preg_replace('/\[\/player'.$i.'\](.*?)\[\/message\]/is', '', $text);
$player1 = preg_replace('/\[player'.$i.'\]/', '[player'.$j.']', $player1);
$player1 = preg_replace('/\[\/player'.$i.'\]/', '[/player'.$j.']', $player1);
$text = $player2."[/player".$i."]".$player1;
$player += 1;
}
}
}
for($i=0;$i<=$coor;$i++){
if(preg_match('/\[coor'.$i.'\]/',$text) && preg_match('/\[\/coor'.$i.'\]/',$text)){
$coor1 = preg_replace('/\[message\](.*?)\[\/coor'.$i.'\]/is', '', $text);
if(preg_match('/\[coor'.$i.'\]/',$coor1) && preg_match('/\[\/coor'.$i.'\]/',$coor1)){
$j = $i+1;
$coor2 = preg_replace('/\[\/coor'.$i.'\](.*?)\[\/message\]/is', '', $text);
$coor1 = preg_replace('/\[coor'.$i.'\]/', '[coor'.$j.']', $coor1);
$coor1 = preg_replace('/\[\/coor'.$i.'\]/', '[/coor'.$j.']', $coor1);
$text = $coor2."[/coor".$i."]".$coor1;
$coor += 1;
}
}
}
for($i=0;$i<=$report;$i++){
if(preg_match('/\[report'.$i.'\]/',$text) && preg_match('/\[\/report'.$i.'\]/',$text)){
$report1 = preg_replace('/\[message\](.*?)\[\/report'.$i.'\]/is', '', $text);
if(preg_match('/\[report'.$i.'\]/',$report1) && preg_match('/\[\/report'.$i.'\]/',$report1)){
$j = $i+1;
$report2 = preg_replace('/\[\/report'.$i.'\](.*?)\[\/message\]/is', '', $text);
$report1 = preg_replace('/\[report'.$i.'\]/', '[report'.$j.']', $report1);
$report1 = preg_replace('/\[\/report'.$i.'\]/', '[/report'.$j.']', $report1);
$text = $report2."[/report".$i."]".$report1;
$report += 1;
}
}
}
if($permission[opt7]==1){
if ($userally != 0) {
while ($allmembers = mysql_fetch_array($allmembersQ)) {
$database->sendMessage($allmembers[id],$session->uid,$topic,$text,0,$alliance,$player,$coor,$report);
}
}
}
}
}
private function sendMessage($recieve, $topic, $text) {
global $session, $database;
$user = $database->getUserField($recieve, "id", 1);
if(WORD_CENSOR) {
$topic = $this->wordCensor($topic);
$text = $this->wordCensor($text);
}
if($topic == "") {
$topic = "No subject";
}
if(!preg_match('/\[message\]/',$text) && !preg_match('/\[\/message\]/',$text)){
$text = "[message]".$text."[/message]";
$alliance = $player = $coor = $report = 0;
for($i=0;$i<=$alliance;$i++){
if(preg_match('/\[alliance'.$i.'\]/',$text) && preg_match('/\[\/alliance'.$i.'\]/',$text)){
$alliance1 = preg_replace('/\[message\](.*?)\[\/alliance'.$i.'\]/is', '', $text);
if(preg_match('/\[alliance'.$i.'\]/',$alliance1) && preg_match('/\[\/alliance'.$i.'\]/',$alliance1)){
$j = $i+1;
$alliance2 = preg_replace('/\[\/alliance'.$i.'\](.*?)\[\/message\]/is', '', $text);
$alliance1 = preg_replace('/\[alliance'.$i.'\]/', '[alliance'.$j.']', $alliance1);
$alliance1 = preg_replace('/\[\/alliance'.$i.'\]/', '[/alliance'.$j.']', $alliance1);
$text = $alliance2."[/alliance".$i."]".$alliance1;
$alliance += 1;
}
}
}
for($i=0;$i<=$player;$i++){
if(preg_match('/\[player'.$i.'\]/',$text) && preg_match('/\[\/player'.$i.'\]/',$text)){
$player1 = preg_replace('/\[message\](.*?)\[\/player'.$i.'\]/is', '', $text);
if(preg_match('/\[player'.$i.'\]/',$player1) && preg_match('/\[\/player'.$i.'\]/',$player1)){
$j = $i+1;
$player2 = preg_replace('/\[\/player'.$i.'\](.*?)\[\/message\]/is', '', $text);
$player1 = preg_replace('/\[player'.$i.'\]/', '[player'.$j.']', $player1);
$player1 = preg_replace('/\[\/player'.$i.'\]/', '[/player'.$j.']', $player1);
$text = $player2."[/player".$i."]".$player1;
$player += 1;
}
}
}
for($i=0;$i<=$coor;$i++){
if(preg_match('/\[coor'.$i.'\]/',$text) && preg_match('/\[\/coor'.$i.'\]/',$text)){
$coor1 = preg_replace('/\[message\](.*?)\[\/coor'.$i.'\]/is', '', $text);
if(preg_match('/\[coor'.$i.'\]/',$coor1) && preg_match('/\[\/coor'.$i.'\]/',$coor1)){
$j = $i+1;
$coor2 = preg_replace('/\[\/coor'.$i.'\](.*?)\[\/message\]/is', '', $text);
$coor1 = preg_replace('/\[coor'.$i.'\]/', '[coor'.$j.']', $coor1);
$coor1 = preg_replace('/\[\/coor'.$i.'\]/', '[/coor'.$j.']', $coor1);
$text = $coor2."[/coor".$i."]".$coor1;
$coor += 1;
}
}
}
for($i=0;$i<=$report;$i++){
if(preg_match('/\[report'.$i.'\]/',$text) && preg_match('/\[\/report'.$i.'\]/',$text)){
$report1 = preg_replace('/\[message\](.*?)\[\/report'.$i.'\]/is', '', $text);
if(preg_match('/\[report'.$i.'\]/',$report1) && preg_match('/\[\/report'.$i.'\]/',$report1)){
$j = $i+1;
$report2 = preg_replace('/\[\/report'.$i.'\](.*?)\[\/message\]/is', '', $text);
$report1 = preg_replace('/\[report'.$i.'\]/', '[report'.$j.']', $report1);
$report1 = preg_replace('/\[\/report'.$i.'\]/', '[/report'.$j.']', $report1);
$text = $report2."[/report".$i."]".$report1;
$report += 1;
}
}
}
$database->sendMessage($user, $session->uid, $topic, $text, 0, $alliance, $player, $coor, $report);
}
}
//7 = village, attacker, att tribe, u1 - u10, lost %, w,c,i,c , cap
//8 = village, attacker, att tribe, enforcement
private function sendNotice($from, $vid, $fowner, $owner, $type, $extra) {
}
public function sendWelcome($uid, $username) {
global $database;
$welcomemsg = file_get_contents("GameEngine/Admin/welcome.tpl");
$welcomemsg = preg_replace("'%USER%'", $username, $welcomemsg);
$welcomemsg = preg_replace("'%START%'", date("y.m.d", COMMENCE), $welcomemsg);
$welcomemsg = preg_replace("'%TIME%'", date("H:i", COMMENCE), $welcomemsg);
$welcomemsg = preg_replace("'%PLAYERS%'", $database->countUser(), $welcomemsg);
$welcomemsg = preg_replace("'%ALLI%'", $database->countAlli(), $welcomemsg);
$welcomemsg = preg_replace("'%SERVER_NAME%'", SERVER_NAME, $welcomemsg);
$welcomemsg = "[message]".$welcomemsg."[/message]";
return $database->sendMessage($uid, 5, WEL_TOPIC, addslashes($welcomemsg), 0, 0, 0, 0, 0);
}
private function wordCensor($text) {
$censorarray = explode(",", CENSORED);
foreach($censorarray as $key => $value) {
$censorarray[$key] = "/" . $value . "/i";
}
return preg_replace($censorarray, "****", $text);
}
private function checkUnread() {
foreach($this->inbox as $message) {
if($message['viewed'] == 0) {
return true;
}
}
return false;
}
private function checkNUnread() {
foreach($this->allNotice as $notice) {
if($notice['viewed'] == 0) {
return true;
}
}
return false;
}
private function findInbox($id) {
foreach($this->inbox as $message) {
if($message['id'] == $id) {
return true;
}
}
return false;
}
private function findSent($id) {
foreach($this->sent as $message) {
if($message['id'] == $id) {
return true;
}
}
return false;
}
private function findArchive($id) {
foreach($this->archived as $message) {
if($message['id'] == $id) {
return true;
}
}
return false;
}
public function addFriends($post) {
global $database;
for($i=0;$i<=19;$i++) {
if($post['addfriends'.$i] != ""){
$uid = $database->getUserField($post['addfriends'.$i], "id", 1);
$added = 0;
for($j=0;$j<=$i;$j++) {
if($added == 0){
$user = $database->getUserField($post['myid'], "friend".$j, 0);
$userwait = $database->getUserField($post['myid'], "friend".$j."wait", 0);
$exist = 0;
for($k=0;$k<=19;$k++){
$user1 = $database->getUserField($post['myid'], "friend".$k, 0);
if($user1 == $uid or $uid == $post['myid']){
$exist = 1;
}
}
if($user == 0 && $userwait == 0 && $exist == 0){
$added1 = 0;
for($l=0;$l<=19;$l++){
$user2 = $database->getUserField($uid, "friend".$l, 0);
$userwait2 = $database->getUserField($uid, "friend".$l."wait", 0);
if($user2 == 0 && $userwait2 == 0 && $added1 == 0){
$database->addFriend($uid,"friend".$l."wait",$post['myid']);
$added1 = 1;
}
}
$database->addFriend($post['myid'],"friend".$j,$uid);
$database->addFriend($post['myid'],"friend".$j."wait",$uid);
$added = 1;
}
}
}
}
}
header("Location: nachrichten.php?t=1");
}
}
;
+54
View File
@@ -0,0 +1,54 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Multisort.php ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class multiSort {
function sorte($array)
{
for($i = 1; $i < func_num_args(); $i += 3)
{
$key = func_get_arg($i);
$order = true;
if($i + 1 < func_num_args())
$order = func_get_arg($i + 1);
$type = 0;
if($i + 2 < func_num_args())
$type = func_get_arg($i + 2);
switch($type)
{
case 1: // Case insensitive natural.
$t = 'strcasenatcmp($a[' . $key . '], $b[' . $key . '])';
break;
case 2: // Numeric.
$t = '$a[' . $key . '] - $b[' . $key . ']';
break;
case 3: // Case sensitive string.
$t = 'strcmp($a[' . $key . '], $b[' . $key . '])';
break;
case 4: // Case insensitive string.
$t = 'strcasecmp($a[' . $key . '], $b[' . $key . '])';
break;
default: // Case sensitive natural.
$t = 'strnatcmp($a[' . $key . '], $b[' . $key . '])';
break;
}
usort($array, create_function('$a, $b', 'return ' . ($order ? '' : '-') . '(' . $t . ');'));
}
return $array;
}
};
$multisort = new multiSort;
?>
View File
View File
+168
View File
@@ -0,0 +1,168 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Profile.php ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class Profile {
public function procProfile($post) {
global $session;
if(isset($post['ft'])) {
switch($post['ft']) {
case "p1":
if($session->access!=BANNED){
$this->updateProfile($post);
}else{
header("Location: banned.php");
}
break;
case "p3":
if($session->access!=BANNED){
$this->updateAccount($post);
}else{
header("Location: banned.php");
}
break;
}
}
if(isset($post['s'])) {
switch($post['s']) {
case "4":
if($session->access!=BANNED){
$this->gpack($post);
}else{
header("Location: banned.php");
}
break;
}
}
}
public function procSpecial($get) {
global $session;
if(isset($get['e'])) {
switch($get['e']) {
case 2:
if($session->access!=BANNED){
$this->removeMeSit($get);
}else{
header("Location: banned.php");
}
break;
case 3:
if($session->access!=BANNED){
$this->removeSitter($get);
}else{
header("Location: banned.php");
}
break;
case 4:
if($session->access!=BANNED){
$this->cancelDeleting($get);
}else{
header("Location: banned.php");
}
break;
}
}
}
private function updateProfile($post) {
global $database;
$birthday = $post['jahr'].'-'.$post['monat'].'-'.$post['tag'];
$database->submitProfile($database->RemoveXSS($post['uid']),$database->RemoveXSS($post['mw']),$database->RemoveXSS($post['ort']),$database->RemoveXSS($birthday),$database->RemoveXSS($post['be2']),$database->RemoveXSS($post['be1']));
$varray = $database->getProfileVillages($post['uid']);
for($i=0;$i<=count($varray)-1;$i++) {
$database->setVillageName($database->RemoveXSS($varray[$i]['wref']),$post['dname'.$i]);
}
header("Location: spieler.php?uid=".$post['uid']);
}
private function gpack($post) {
global $database, $session;
$database->gpack($database->RemoveXSS($session->uid),$database->RemoveXSS($post['custom_url']));
header("Location: spieler.php?uid=".$session->uid);
}
private function updateAccount($post) {
global $database,$session,$form;
if($post['pw2'] == $post['pw3']) {
if($database->login($session->username,$post['pw1'])) {
if ($_POST['uid'] != $session->uid){
die("Hacking Attempr");
} else {
$database->updateUserField($post['uid'],"password",md5($post['pw2']),1);
}
}
else {
$form->addError("pw",LOGIN_PW_ERROR);
}
}
else {
$form->addError("pw",PASS_MISMATCH);
}
if($post['email_alt'] == $session->userinfo['email']) {
$database->updateUserField($post['uid'],"email",$post['email_neu'],1);
}
else {
$form->addError("email",EMAIL_ERROR);
}
if($post['del'] && md5($post['del_pw']) == $session->userinfo['password']) {
$database->setDeleting($post['uid'],0);
}
else {
$form->addError("del",PASS_MISMATCH);
}
if($post['v1'] != "") {
$sitid = $database->getUserField($post['v1'],"id",1);
if($sitid == $session->userinfo['sit1'] || $sitid == $session->userinfo['sit2']) {
$form->addError("sit",SIT_ERROR);
}
else if($sitid != $session->uid){
if($session->userinfo['sit1'] == 0) {
$database->updateUserField($post['uid'],"sit1",$sitid,1);
}
else if($session->userinfo['sit2'] == 0) {
$database->updateUserField($post['uid'],"sit2",$sitid,1);
}
}
}
$_SESSION['errorarray'] = $form->getErrors();
header("Location: spieler.php?s=3");
}
private function removeSitter($get) {
global $database,$session;
if($get['a'] == $session->checker) {
if($session->userinfo['sit'.$get['type']] == $get['id']) {
$database->updateUserField($session->uid,"sit".$get['type'],0,1);
}
$session->changeChecker();
}
header("Location: spieler.php?s=".$get['s']);
}
private function cancelDeleting($get) {
global $database,$session;
$database->setDeleting($get['id'],1);
header("Location: spieler.php?s=".$get['s']);
}
private function removeMeSit($get) {
global $database,$session;
if($get['a'] == $session->checker) {
$database->removeMeSit($get['id'],$session->uid);
$session->changeChecker();
}
header("Location: spieler.php?s=".$get['s']);
}
};
$profile = new Profile;
?>
+26
View File
@@ -0,0 +1,26 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Protection.php ##
## Developed by: SlimShady ##
## Edited by: Dzoki & Dixie ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
//heef npc uitzondering omdat die met speciaal $_post werken
if(isset($_POST)){
if(!isset($_POST['ft'])){
$_POST = @array_map('mysql_real_escape_string', $_POST);
$_POST = array_map('htmlspecialchars', $_POST);
}
}
$rsargs=$_GET['rsargs'];
$_GET = array_map('mysql_real_escape_string', $_GET);
$_GET = array_map('htmlspecialchars', $_GET);
$_GET['rsargs']=$rsargs;
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
$_COOKIE = array_map('htmlspecialchars', $_COOKIE);
?>
+545
View File
@@ -0,0 +1,545 @@
<?php
/** --------------------------------------------------- **\
| ********* DO NOT REMOVE THIS COPYRIGHT NOTICE ********* |
+---------------------------------------------------------+
| Credits: All the developers including the leaders: |
| Advocaite & Dzoki & Donnchadh |
| |
| Copyright: TravianX Project All rights reserved |
\** --------------------------------------------------- **/
class Ranking {
private $rankarray = array();
private $rlastupdate;
public function getRank() {
return $this->rankarray;
}
public function getUserRank($id) {
$ranking = $this->getRank();
$users = "SELECT * FROM " . TB_PREFIX . "users WHERE access < " . (INCLUDE_ADMIN ? "10" : "8") . "";
$users2 = mysql_num_rows(mysql_query($users));
$users3 = $users2+1;
if(count($ranking) > 0) {
for($i=0;$i<($users3);$i++) {
if( isset( $ranking[$i]['userid'] ) )
{
if($ranking[$i]['userid'] == $id && $ranking[$i] != "pad") {
$myrank = $i;
}
}
}
}
return $myrank;
}
public function procRankReq($get) {
global $village, $session, $database;
if(isset($get['id'])) {
switch($get['id']) {
case 1:
$this->procRankArray();
break;
case 8:
$this->procHeroRankArray();
$this->getStart($this->searchRank($session->uid, "owner"));
break;
case 11:
$this->procRankRaceArray(1);
$this->getStart($this->searchRank($session->uid, "userid"));
break;
case 12:
$this->procRankRaceArray(2);
$this->getStart($this->searchRank($session->uid, "userid"));
break;
case 13:
$this->procRankRaceArray(3);
$this->getStart($this->searchRank($session->uid, "userid"));
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();
$this->getStart($this->searchRank($village->wid, "wref"));
break;
case 4:
$this->procARankArray();
if($get['aid'] == 0) {
$this->getStart(1);
} else {
$this->getStart($this->searchRank($get['aid'], "id"));
}
break;
case 41:
$this->procAAttRankArray();
if($get['aid'] == 0) {
$this->getStart(1);
} else {
$this->getStart($this->searchRank($get['aid'], "id"));
}
break;
case 42:
$this->procADefRankArray();
if($get['aid'] == 0) {
$this->getStart(1);
} else {
$this->getStart($this->searchRank($get['aid'], "id"));
}
break;
}
} else {
$this->procRankArray();
$this->getStart($this->searchRank($session->uid, "userid"));
}
}
public function procRank($post) {
if(isset($post['ft'])) {
switch($post['ft']) {
case "r1":
case "r31":
case "r32":
if(isset($post['rank']) && $post['rank'] != "") {
$this->getStart($post['rank']);
}
if(isset($post['name']) && $post['name'] != "") {
$this->getStart($this->searchRank(stripslashes($post['name']), "username"));
}
break;
case "r2":
case "r4":
case "r42":
case "r41":
if(isset($post['rank']) && $post['rank'] != "") {
$this->getStart($post['rank']);
}
if(isset($post['name']) && $post['name'] != "") {
$this->getStart($this->searchRank(stripslashes($post['name']), "name"));
}
break;
}
}
}
private function getStart($search) {
$multiplier = 1;
if(!is_numeric($search)) {
$_SESSION['search'] = $search;
} else {
if($search > count($this->rankarray)) {
$search = count($this->rankarray) - 1;
}
while($search > (20 * $multiplier)) {
$multiplier += 1;
}
$start = 20 * $multiplier - 19 - 1;
$_SESSION['search'] = $search;
$_SESSION['start'] = $start;
}
}
public function getAllianceRank($id) {
$this->procARankArray();
while(1) {
if(count($this->rankarray) > 1) {
$key = key($this->rankarray);
if($this->rankarray[$key]["id"] == $id) {
return $key;
break;
} else {
if(!next($this->rankarray)) {
return false;
break;
}
}
} else {
return 1;
}
}
}
public function searchRank($name, $field) {
while(1) {
$key = key($this->rankarray);
if($this->rankarray[$key][$field] == $name) {
return $key;
break;
} else {
if(!next($this->rankarray)) {
if($field != "userid"){
return $name;
break;
}else{
return 0;
break;
}
}
}
}
}
public function procRankArray() {
global $database, $multisort;
if($database->countUser() > 0){
$holder = array();
if(SHOW_NATARS == True){
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.oldrank oldrank, " . TB_PREFIX . "users.alliance alliance, (
SELECT SUM( " . TB_PREFIX . "vdata.pop )
FROM " . TB_PREFIX . "vdata
WHERE " . TB_PREFIX . "vdata.owner = userid
)totalpop, (
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 <= 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.oldrank oldrank, " . TB_PREFIX . "users.alliance alliance, (
SELECT SUM( " . TB_PREFIX . "vdata.pop )
FROM " . TB_PREFIX . "vdata
WHERE " . TB_PREFIX . "vdata.owner = userid
)totalpop, (
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;
}
foreach($datas as $result) {
$value['userid'] = $result['userid'];
$value['username'] = $result['username'];
$value['oldrank'] = $result['oldrank'];
$value['alliance'] = $result['alliance'];
$value['aname'] = $result['allitag'];
$value['totalpop'] = $result['totalpop'];
$value['totalvillage'] = $result['totalvillages'];
array_push($holder, $value);
}
$newholder = array("pad");
foreach($holder as $key) {
array_push($newholder, $key);
}
$this->rankarray = $newholder;
}
}
private function procRankRaceArray($race) {
global $database, $multisort;
//$array = $database->getRanking();
$holder = array();
//$value['totalvillage'] = count($database->getVillagesID($value['id']));
//$value['totalvillage'] = count($database->getVillagesID($value['id']));
//$value['totalpop'] = $database->getVSumField($value['id'],"pop");
//$value['aname'] = $database->getAllianceName($value['alliance']);
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.tribe tribe, " . 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, (
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.tribe = $race AND " . TB_PREFIX . "users.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
ORDER BY totalpop DESC, totalvillages DESC, userid DESC";
$result = (mysql_query($q));
while($row = mysql_fetch_assoc($result)) {
$datas[] = $row;
}
if(mysql_num_rows($result)) {
foreach($datas as $result) {
//$value = $array[$result['userid']];
$value['userid'] = $result['userid'];
$value['username'] = $result['username'];
$value['alliance'] = $result['alliance'];
$value['aname'] = $result['allitag'];
$value['totalpop'] = $result['totalpop'];
$value['totalvillage'] = $result['totalvillages'];
//SELECT (SELECT SUM(".TB_PREFIX."vdata.pop) FROM ".TB_PREFIX."vdata WHERE ".TB_PREFIX."vdata.owner = 2) totalpop, (SELECT COUNT(".TB_PREFIX."vdata.wref) FROM ".TB_PREFIX."vdata WHERE ".TB_PREFIX."vdata.owner = 2) totalvillages, (SELECT ".TB_PREFIX."alidata.tag FROM ".TB_PREFIX."alidata WHERE ".TB_PREFIX."alidata.id = ".TB_PREFIX."users.alliance AND ".TB_PREFIX."users.id = 2);
array_push($holder, $value);
}
} else {
$value['userid'] = 0;
$value['username'] = "No User";
$value['alliance'] = "";
$value['aname'] = "";
$value['totalpop'] = "";
$value['totalvillage'] = "";
array_push($holder, $value);
}
//$holder = $multisort->sorte($holder, "'totalvillage'", false, 2, "'totalpop'", false, 2);
$newholder = array("pad");
foreach($holder as $key) {
array_push($newholder, $key);
}
$this->rankarray = $newholder;
}
private function procAttRankArray() {
global $database, $multisort;
//$array = $database->getRanking();
$holder = array();
//$value['totalvillage'] = count($database->getVillagesID($value['id']));
//$value['totalpop'] = $database->getVSumField($value['id'],"pop");
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.apall, (
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
FROM " . TB_PREFIX . "vdata
WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99
)totalvillages, (
SELECT SUM( " . TB_PREFIX . "vdata.pop )
FROM " . TB_PREFIX . "vdata
WHERE " . TB_PREFIX . "vdata.owner = userid
)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, userid DESC";
$result = mysql_query($q) or die(mysql_error());
while($row = mysql_Fetch_assoc($result)) {
$datas[] = $row;
}
foreach($datas as $key => $row) {
//$value = $array[$row['userid']];
$value['username'] = $row['username'];
$value['totalvillages'] = $row['totalvillages'];
//$value['totalvillage'] = $row['totalvillages'];
$value['id'] = $row['userid'];
$value['totalpop'] = $row['pop'];
$value['apall'] = $row['apall'];
array_push($holder, $value);
printf("\n<!-- %s %s %s %s -->\n", $value['username'], $value['totalvillages'], $value['totalpop'], $value['apall']);
}
//$holder = $multisort->sorte($holder, "'ap'", false, 2, "'totalvillages'", false, 2, "'ap'", false, 2);
$newholder = array("pad");
foreach($holder as $key) {
array_push($newholder, $key);
}
$this->rankarray = $newholder;
}
private function procDefRankArray() {
//global $database, $multisort;
//$array = $database->getRanking();
$holder = array();
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, " . TB_PREFIX . "users.dpall, (
SELECT COUNT( " . TB_PREFIX . "vdata.wref )
FROM " . TB_PREFIX . "vdata
WHERE " . TB_PREFIX . "vdata.owner = userid AND type != 99
)totalvillages, (
SELECT SUM( " . TB_PREFIX . "vdata.pop )
FROM " . TB_PREFIX . "vdata
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") . " 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)) {
$datas[] = $row;
}
foreach($datas as $key => $row) {
//$value = $array[$row['userid']];
$value['username'] = $row['username'];
$value['totalvillages'] = $row['totalvillages'];
//$value['totalvillage'] = $row['totalvillages'];
$value['id'] = $row['userid'];
$value['totalpop'] = $row['pop'];
$value['dpall'] = $row['dpall'];
array_push($holder, $value);
}
//$holder = $multisort->sorte($holder, "'dpall'", false, 2, "'totalvillage'", false, 2, "'dpall'", false, 2);
$newholder = array("pad");
foreach($holder as $key) {
array_push($newholder, $key);
}
$this->rankarray = $newholder;
}
private function procVRankArray() {
global $database, $multisort;
$array = $database->getVRanking();
$holder = array();
foreach($array as $value) {
$coor = $database->getCoor($value['wref']);
$value['x'] = $coor['x'];
$value['y'] = $coor['y'];
$value['user'] = $database->getUserField($value['owner'], "username", 0);
array_push($holder, $value);
}
$holder = $multisort->sorte($holder, "'x'", true, 2, "'y'", true, 2, "'pop'", false, 2);
$newholder = array("pad");
foreach($holder as $key) {
array_push($newholder, $key);
}
$this->rankarray = $newholder;
}
public function procARankArray() {
global $database, $multisort;
$array = $database->getARanking();
$holder = array();
foreach($array as $value) {
$memberlist = $database->getAllMember($value['id']);
$totalpop = 0;
foreach($memberlist as $member) {
$totalpop += $database->getVSumField($member['id'], "pop");
}
$value['players'] = count($memberlist);
$value['totalpop'] = $totalpop;
if(!isset($value['avg'])) {
$value['avg'] = @round($totalpop / count($memberlist));
} else {
$value['avg'] = 0;
}
array_push($holder, $value);
}
$holder = $multisort->sorte($holder, "'totalpop'", false, 2);
$newholder = array("pad");
foreach($holder as $key) {
array_push($newholder, $key);
}
$this->rankarray = $newholder;
}
private function procHeroRankArray() {
global $database, $multisort;
$array = $database->getHeroRanking();
$holder = array();
foreach($array as $value) {
$value['owner'] = $database->getUserField($value['uid'], "username", 0);
$value['level'];
$value['uid'];
array_push($holder, $value);
}
$holder = $multisort->sorte($holder, "'experience'", false, 2);
$newholder = array("pad");
foreach($holder as $key) {
array_push($newholder, $key);
}
$this->rankarray = $newholder;
}
private function procAAttRankArray() {
global $database, $multisort;
$array = $database->getARanking();
$holder = array();
foreach($array as $value) {
$memberlist = $database->getAllMember($value['id']);
$totalap = 0;
foreach($memberlist as $member) {
$totalap += $member['ap'];
}
$value['players'] = count($memberlist);
$value['totalap'] = $totalap;
if($value['avg'] > 0) {
$value['avg'] = round($totalap / count($memberlist));
} else {
$value['avg'] = 0;
}
array_push($holder, $value);
}
$holder = $multisort->sorte($holder, "'totalap'", false, 2);
$newholder = array("pad");
foreach($holder as $key) {
array_push($newholder, $key);
}
$this->rankarray = $newholder;
}
private function procADefRankArray() {
global $database, $multisort;
$array = $database->getARanking();
$holder = array();
foreach($array as $value) {
$memberlist = $database->getAllMember($value['id']);
$totaldp = 0;
foreach($memberlist as $member) {
$totaldp += $member['dp'];
}
$value['players'] = count($memberlist);
$value['totaldp'] = $totaldp;
if($value['avg'] > 0) {
$value['avg'] = round($totalap / count($memberlist));
} else {
$value['avg'] = 0;
}
array_push($holder, $value);
}
$holder = $multisort->sorte($holder, "'totaldp'", false, 2);
$newholder = array("pad");
foreach($holder as $key) {
array_push($newholder, $key);
}
$this->rankarray = $newholder;
}
}
;
$ranking = new Ranking;
?>
+193
View File
@@ -0,0 +1,193 @@
<?php
ob_start(); // Enesure, that no more header already been sent error not showing up again
mb_internal_encoding("UTF-8"); // Add for utf8 varriables.
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Session.php ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
if(!file_exists('GameEngine/config.php') && !file_exists('../../GameEngine/config.php') && !file_exists('../../config.php')) {
header("Location: install/");
}
$script_name = ($_SERVER['REQUEST_URI'] == 'karte.php') ? 'karte' : $_SERVER['REQUEST_URI'];
include ("Battle.php");
include ("Data/buidata.php");
include ("Data/cp.php");
include ("Data/cel.php");
include ("Data/resdata.php");
include ("Data/unitdata.php");
include ("Data/hero_full.php");
include ("config.php");
include ("Database.php");
include ("Mailer.php");
include ("Form.php");
include ("Generator.php");
include ("Multisort.php");
include ("Ranking.php");
include ("Automation.php");
include ("Lang/" . LANG . ".php");
include ("Logging.php");
include ("Message.php");
include ("Alliance.php");
include ("Profile.php");
class Session {
private $time;
var $logged_in = false;
var $referrer, $url;
var $username, $uid, $access, $plus, $tribe, $isAdmin, $alliance, $gold, $oldrank, $gpack;
var $bonus = 0;
var $bonus1 = 0;
var $bonus2 = 0;
var $bonus3 = 0;
var $bonus4 = 0;
var $checker, $mchecker;
public $userinfo = array();
private $userarray = array();
var $villages = array();
function Session() {
$this->time = time();
session_start();
$this->logged_in = $this->checkLogin();
if($this->logged_in && TRACK_USR) {
$database->updateActiveUser($this->username, $this->time);
}
if(isset($_SESSION['url'])) {
$this->referrer = $_SESSION['url'];
} else {
$this->referrer = "/";
}
$this->url = $_SESSION['url'] = $_SERVER['PHP_SELF'];
$this->SurfControl();
}
public function Login($user) {
global $database, $generator, $logging;
$this->logged_in = true;
$_SESSION['sessid'] = $generator->generateRandID();
$_SESSION['username'] = $user;
$_SESSION['checker'] = $generator->generateRandStr(3);
$_SESSION['mchecker'] = $generator->generateRandStr(5);
$_SESSION['qst'] = $database->getUserField($_SESSION['username'], "quest", 1);
if(!isset($_SESSION['wid'])) {
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $database->getUserField($_SESSION['username'], "id", 1) . ' LIMIT 1');
$data = mysql_fetch_assoc($query);
$_SESSION['wid'] = $data['wref'];
} else
if($_SESSION['wid'] == '') {
$query = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `owner` = ' . $database->getUserField($_SESSION['username'], "id", 1) . ' LIMIT 1');
$data = mysql_fetch_assoc($query);
$_SESSION['wid'] = $data['wref'];
}
$this->PopulateVar();
$logging->addLoginLog($this->uid, $_SERVER['REMOTE_ADDR']);
$database->addActiveUser($_SESSION['username'], $this->time);
$database->updateUserField($_SESSION['username'], "sessid", $_SESSION['sessid'], 0);
header("Location: dorf1.php");
}
public function Logout() {
global $database;
$this->logged_in = false;
$database->updateUserField($_SESSION['username'], "sessid", "", 0);
if(ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(session_name(), '', time() - 42000, $params["path"], $params["domain"], $params["secure"], $params["httponly"]);
}
session_destroy();
session_start();
}
public function changeChecker() {
global $generator;
$this->checker = $_SESSION['checker'] = $generator->generateRandStr(3);
$this->mchecker = $_SESSION['mchecker'] = $generator->generateRandStr(5);
}
private function checkLogin(){
global $database;
if(isset($_SESSION['username']) && isset($_SESSION['sessid'])) {
//Get and Populate Data
$this->PopulateVar();
//update database
$database->addActiveUser($_SESSION['username'], $this->time);
$database->updateUserField($_SESSION['username'], "timestamp", $this->time, 0);
return true;
} else {
return false;
}
}
private function PopulateVar() {
global $database;
$this->userarray = $this->userinfo = $database->getUserArray($_SESSION['username'], 0);
$this->username = $this->userarray['username'];
$this->uid = $_SESSION['id_user'] = $this->userarray['id'];
$this->gpack = $this->userarray['gpack'];
$this->access = $this->userarray['access'];
$this->plus = ($this->userarray['plus'] > $this->time);
$this->goldclub = $this->userarray['goldclub'];
$this->villages = $database->getVillagesID($this->uid);
$this->tribe = $this->userarray['tribe'];
$this->isAdmin = $this->access >= MODERATOR;
$this->alliance = $_SESSION['alliance_user'] = $this->userarray['alliance'];
$this->checker = $_SESSION['checker'];
$this->mchecker = $_SESSION['mchecker'];
$this->sit = $database->GetOnline($this->uid);
$this->sit1 = $this->userarray['sit1'];
$this->sit2 = $this->userarray['sit2'];
$this->cp = floor($this->userarray['cp']);
$this->gold = $this->userarray['gold'];
$this->oldrank = $this->userarray['oldrank'];
$_SESSION['ok'] = $this->userarray['ok'];
if($this->userarray['b1'] > $this->time) {
$this->bonus1 = 1;
}
if($this->userarray['b2'] > $this->time) {
$this->bonus2 = 1;
}
if($this->userarray['b3'] > $this->time) {
$this->bonus3 = 1;
}
if($this->userarray['b4'] > $this->time) {
$this->bonus4 = 1;
}
}
private function SurfControl(){
if(SERVER_WEB_ROOT) {
$page = $_SERVER['SCRIPT_NAME'];
} else {
$explode = explode("/", $_SERVER['SCRIPT_NAME']);
$i = count($explode) - 1;
$page = $explode[$i];
}
$pagearray = array("index.php", "anleitung.php", "tutorial.php", "login.php", "activate.php", "anmelden.php", "xaccount.php");
if(!$this->logged_in) {
if(!in_array($page, $pagearray) || $page == "logout.php") {
header("Location: login.php");
}
} else {
if(in_array($page, $pagearray)) {
header("Location: dorf1.php");
}
}
}
};
$session = new Session;
$form = new Form;
$message = new Message;
?>
+736
View File
@@ -0,0 +1,736 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Technology.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class Technology {
public $unarray = array(1=>U1,U2,U3,U4,U5,U6,U7,U8,U9,U10,U11,U12,U13,U14,U15,U16,U17,U18,U19,U20,U21,U22,U23,U24,U25,U26,U27,U28,U29,U30,U31,U32,U33,U34,U35,U36,U37,U38,U39,U40,U41,U42,U43,U44,U45,U46,U47,U48,U49,U50,U99,U0);
public function grabAcademyRes() {
global $village;
$holder = array();
foreach($village->researching as $research) {
if(substr($research['tech'],0,1) == "t"){
array_push($holder,$research);
}
}
return $holder;
}
public function getABUpgrades($type='a') {
global $village;
$holder = array();
foreach($village->researching as $research) {
if(substr($research['tech'],0,1) == $type){
array_push($holder,$research);
}
}
return $holder;
}
public function isResearch($tech,$type) {
global $village;
if(count($village->researching) == 0) {
return false;
}
else {
switch($type) {
case 1: $string = "t"; break;
case 2: $string = "a"; break;
case 3: $string = "b"; break;
}
foreach($village->researching as $research) {
if($research['tech'] == $string.$tech) {
return true;
}
}
return false;
}
}
public function procTech($post) {
if(isset($post['ft'])) {
switch($post['ft']) {
case "t1":
$this->procTrain($post);
break;
case "t3":
$this->procTrain($post,true);
break;
}
}
}
public function procTechno($get) {
global $village;
if(isset($get['a'])) {
switch($village->resarray['f'.$get['id'].'t']) {
case 22:
$this->researchTech($get);
break;
case 13:
$this->upgradeArmour($get);
break;
case 12:
$this->upgradeSword($get);
break;
}
}
}
public function getTrainingList($type) {
global $database,$village;
$trainingarray = $database->getTraining($village->wid);
$listarray = array();
$barracks = array(1,2,3,11,12,13,14,21,22,31,32,33,34,35,36,37,38,39,40,41,42,43,44);
$greatbarracks = array(61,62,63,71,72,73,84,81,82,91,92,93,94,95,96,97,98,99,100,101,102,103,104);
$stables = array(4,5,6,15,16,23,24,25,26,45,46);
$greatstables = array(64,65,66,75,76,83,84,85,86,105,106);
$workshop = array(7,8,17,18,27,28,47,48);
$greatworkshop = array(67,68,77,78,87,88,107,108);
$residence = array(9,10,19,20,29,30,49,50);
$trapper = array(99);
if(count($trainingarray) > 0) {
foreach($trainingarray as $train) {
if($type == 1 && in_array($train['unit'],$barracks)) {
$train['name'] = $this->unarray[$train['unit']];
array_push($listarray,$train);
}
if($type == 2 && in_array($train['unit'],$stables)) {
$train['name'] = $this->unarray[$train['unit']];
array_push($listarray,$train);
}
if($type == 3 && in_array($train['unit'],$workshop)) {
$train['name'] = $this->unarray[$train['unit']];
array_push($listarray,$train);
}
if($type == 4 && in_array($train['unit'],$residence)) {
$train['name'] = $this->unarray[$train['unit']];
array_push($listarray,$train);
}
if($type == 5 && in_array($train['unit'],$greatbarracks)) {
$train['name'] = $this->unarray[$train['unit']-60];
$train['unit'] -= 60;
array_push($listarray,$train);
}
if($type == 6 && in_array($train['unit'],$greatstables)) {
$train['name'] = $this->unarray[$train['unit']-60];
$train['unit'] -= 60;
array_push($listarray,$train);
}
if($type == 7 && in_array($train['unit'],$greatworkshop)) {
$train['name'] = $this->unarray[$train['unit']-60];
$train['unit'] -= 60;
array_push($listarray,$train);
}
if($type == 8 && in_array($train['unit'],$trapper)) {
$train['name'] = $this->unarray[$train['unit']];
array_push($listarray,$train);
}
}
}
return $listarray;
}
public function getUnitList() {
global $database,$village;
$unitarray = func_num_args() == 1? $database->getUnit(func_get_arg(0)) : $village->unitall;
$listArray = array();
for($i=1;$i<count($this->unarray);$i++) {
$holder = array();
if($unitarray['u'.$i] != 0 && $unitarray['u'.$i] != "") {
$holder['id'] = $i;
$holder['name'] = $this->unarray[$i];
$holder['amt'] = $unitarray['u'.$i];
array_push($listArray,$holder);
}
}if($unitarray['hero'] != 0 && $unitarray['hero'] != "") {
$holder['id'] = "hero";
$holder['name'] = $this->unarray[$i];
$holder['amt'] = $unitarray['hero'];
array_push($listArray,$holder);
}
return $listArray;
}
public function maxUnit($unit,$great=false) {
$unit = "u".$unit;
global $village,$$unit;
$unitarray = $$unit;
$res = array();
$res = mysql_fetch_assoc(mysql_query("SELECT maxstore, maxcrop, wood, clay, iron, crop FROM ".TB_PREFIX."vdata WHERE wref = ".$village->wid)) or die(mysql_error());
if ($res['wood'] > $res['maxstore']){$res['wood'] = $res['maxstore'];}
if ($res['clay'] > $res['maxstore']){$res['clay'] = $res['maxstore'];}
if ($res['iron'] > $res['maxstore']){$res['iron'] = $res['maxstore'];}
if ($res['crop'] > $res['maxcrop']){$res['crop'] = $res['maxcrop'];}
$woodcalc = floor($res['wood'] / ($unitarray['wood'] * ($great?3:1)));
$claycalc = floor($res['clay'] / ($unitarray['clay'] * ($great?3:1)));
$ironcalc = floor($res['iron'] / ($unitarray['iron'] * ($great?3:1)));
if($res['crop']>0){
$cropcalc = floor($res['crop'] / ($unitarray['crop'] * ($great?3:1)));
}else{
$cropcalc = 0;
}
if($unit != "u99"){
$popcalc = floor($village->getProd("crop")/$unitarray['pop']);
}else{
$popcalc = $village->getProd("crop");
}
return min($woodcalc,$claycalc,$ironcalc,$cropcalc);
}
public function maxUnitPlus($unit,$great=false) {
$unit = "u".$unit;
global $village,$$unit;
$unitarray = $$unit;
$res = array();
$res = mysql_fetch_assoc(mysql_query("SELECT maxstore, maxcrop, wood, clay, iron, crop FROM ".TB_PREFIX."vdata WHERE wref = ".$village->wid)) or die(mysql_error());
$totalres = $res['wood']+$res['clay']+$res['iron']+$res['crop'];
$totalresunit = ($unitarray['wood'] * ($great?3:1))+($unitarray['clay'] * ($great?3:1))+($unitarray['iron'] * ($great?3:1))+($unitarray['crop'] * ($great?3:1));
$max =round($totalres/$totalresunit);
return $max;
}
public function getUnits() {
global $database,$village;
if(func_num_args() == 1) {
$base = func_get_arg(0);
}
$ownunit = func_num_args() == 2? func_get_arg(0) : $database->getUnit($base);
$enforcementarray = func_num_args() == 2? func_get_arg(1) : $database->getEnforceVillage($base,0);
if(count($enforcementarray) > 0) {
foreach($enforcementarray as $enforce) {
for($i=1;$i<=50;$i++) {
$ownunit['u'.$i] += $enforce['u'.$i];
}
}
}
return $ownunit;
}
function getAllUnits($base,$InVillageOnly=False,$mode=0) {
global $database;
$ownunit = $database->getUnit($base);
$ownunit['u99'] -= $ownunit['u99'];
$ownunit['u99o'] -= $ownunit['u99o'];
$enforcementarray = $database->getEnforceVillage($base,0);
if(count($enforcementarray) > 0) {
foreach($enforcementarray as $enforce) {
for($i=1;$i<=50;$i++) {
$ownunit['u'.$i] += $enforce['u'.$i];
}
$ownunit['hero'] += $enforce['hero'];
}
}
if($mode==0){
$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)) {
for($i=1;$i<=50;$i++) {
$ownunit['u'.$i] += $movement['u'.$i];
}
$ownunit['hero'] += $movement['hero'];
}
}
return $ownunit;
}
public function meetTRequirement($unit) {
global $session;
switch($unit) {
case 1:
if($session->tribe == 1) { return true; } else { return false; }
break;
case 2:
case 3:
case 4:
case 5:
case 6:
case 7:
case 8:
if($this->getTech($unit) && $session->tribe == 1) { return true; } else { return false; }
break;
case 10:
if($session->tribe == 1) { return true; } else { return false; }
break;
case 11:
if($session->tribe == 2) { return true; } else { return false; }
break;
case 12:
case 13:
case 14:
case 15:
case 16:
case 17:
case 18:
if($session->tribe == 2 && $this->getTech($unit)) { return true; } else { return false; }
break;
case 20:
if($session->tribe == 2) { return true; } else { return false; }
break;
case 21:
if($session->tribe == 3) { return true; } else { return false; }
break;
case 22:
case 23:
case 24:
case 25:
case 26:
case 27:
case 28:
if($session->tribe == 3 && $this->getTech($unit)) { return true; } else { return false; }
break;
case 30:
if($session->tribe == 3) { return true; } else { return false; }
break;
case 31:
if($session->tribe == 4) { return true; } else { return false; }
break;
case 32:
case 33:
case 34:
case 35:
case 36:
case 37:
case 38:
if($session->tribe == 4 && $this->getTech($unit)) { return true; } else { return false; }
break;
case 40:
if($session->tribe == 4) { return true; } else { return false; }
break;
case 41:
if($session->tribe == 5) { return true; } else { return false; }
break;
case 42:
case 43:
case 44:
case 45:
case 46:
case 47:
case 48:
if($session->tribe == 5 && $this->getTech($unit)) { return true; } else { return false; }
break;
case 50:
if($session->tribe == 5) { return true; } else { return false; }
break;
}
}
public function getTech($tech) {
global $village;
return ($village->techarray['t'.$tech] == 1);
}
private function procTrain($post,$great=false) {
global $session;
if($session->access != BANNED){
$start = ($session->tribe-1)*10+1;
$end = ($session->tribe*10);
for($i=$start;$i<=($end);$i++) {
if(isset($post['t'.$i]) && $post['t'.$i] != 0) {
$amt = $post['t'.$i];
$amt = intval($amt);
if ($amt < 0) $amt = 1;
$this->trainUnit($i,$amt,$great);
}
}
if($session->tribe == 3){
if(isset($post['t99']) && $post['t99'] != 0) {
$amt = $post['t99'];
$amt = intval($amt);
if ($amt < 0) $amt = 1;
$this->trainUnit(99,$amt,$great);
}
}
header("Location: build.php?id=".$post['id']);
}else{
header("Location: banned.php");
}
}
public function getUpkeep($array,$type,$vid=0,$prisoners=0) {
global $database,$session,$village;
if($vid==0) { $vid=$village->wid; }
$buildarray = array();
$buildarray = $database->getResourceLevel($vid);
$upkeep = 0;
switch($type) {
case 0:
$start = 1;
$end = 50;
break;
case 1:
$start = 1;
$end = 10;
break;
case 2:
$start = 11;
$end = 20;
break;
case 3:
$start = 21;
$end = 30;
break;
case 4:
$start = 31;
$end = 40;
break;
case 5:
$start = 41;
$end = 50;
break;
}
for($i=$start;$i<=$end;$i++) {
$k = $i-$start+1;
$unit = "u".$i;
$unit2 = "t".$k;
global $$unit;
$dataarray = $$unit;
for($j=19;$j<=38;$j++) {
if($buildarray['f'.$j.'t'] == 41) {
$horsedrinking = $j;
}
}
if($prisoners == 0){
if(isset($horsedrinking)){
if(($i==4 && $buildarray['f'.$horsedrinking] >= 10)
|| ($i==5 && $buildarray['f'.$horsedrinking] >= 15)
|| ($i==6 && $buildarray['f'.$horsedrinking] == 20)) {
$upkeep += ($dataarray['pop']-1) * $array[$unit];
} else {
$upkeep += $dataarray['pop'] * $array[$unit];
}}else{
$upkeep += $dataarray['pop'] * $array[$unit];
}
}else{
if(isset($horsedrinking)){
if(($i==4 && $buildarray['f'.$horsedrinking] >= 10)
|| ($i==5 && $buildarray['f'.$horsedrinking] >= 15)
|| ($i==6 && $buildarray['f'.$horsedrinking] == 20)) {
$upkeep += ($dataarray['pop']-1) * $array[$unit2];
} else {
$upkeep += $dataarray['pop'] * $array[$unit2];
}}else{
$upkeep += $dataarray['pop'] * $array[$unit2];
}
}
}
// $unit = "hero";
// global $$unit;
// $dataarray = $$unit;
if($prisoners == 0){
$upkeep += $array['hero'] * 6;
}else{
$upkeep += $array['t11'] * 6;
}
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,4,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($vid,4,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,4,2,0));
if($artefact > 0){
$upkeep /= 2;
$upkeep = round($upkeep);
}else if($artefact1 > 0){
$upkeep /= 2;
$upkeep = round($upkeep);
}else if($artefact2 > 0){
$upkeep /= 4;
$upkeep = round($upkeep);
$upkeep *= 3;
}
$foolartefact = $database->getFoolArtefactInfo(4,$vid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$upkeep *= $arte['effect2'];
}else{
$upkeep /= $arte['effect2'];
$upkeep = round($upkeep);
}
}
}
return $upkeep;
}
private function trainUnit($unit,$amt,$great=false) {
global $session,$database,${'u'.$unit},$building,$village,$bid19,$bid20,$bid21,$bid25,$bid26,$bid29,$bid30,$bid36,$bid41,$bid42;
if($this->getTech($unit) || $unit%10 <= 1 || $unit == 99) {
$footies = array(1,2,3,11,12,13,14,21,22,31,32,33,34,41,42,43,44);
$calvary = array(4,5,6,15,16,23,24,25,26,35,36,45,46);
$workshop = array(7,8,17,18,27,28,37,38,47,48);
$special = array(9,10,19,20,29,30,39,40,49,50);
$trapper = array(99);
if(in_array($unit,$footies)) {
if($great) {
$each = round(($bid29[$building->getTypeLevel(29)]['attri'] / 100) * ${'u'.$unit}['time'] / SPEED);
} else {
$each = round(($bid19[$building->getTypeLevel(19)]['attri'] / 100) * ${'u'.$unit}['time'] / SPEED);
}
}
if(in_array($unit,$calvary)) {
if($great) {
$each = round(($bid30[$building->getTypeLevel(30)]['attri'] * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / 100) * ${'u'.$unit}['time'] / SPEED);
} else {
$each = round(($bid20[$building->getTypeLevel(20)]['attri'] * ($building->getTypeLevel(41)>=1?(1/$bid41[$building->getTypeLevel(41)]['attri']):1) / 100) * ${'u'.$unit}['time'] / SPEED);
}
}
if(in_array($unit,$workshop)) {
if($great) {
$each = round(($bid42[$building->getTypeLevel(42)]['attri'] / 100) * ${'u'.$unit}['time'] / SPEED);
} else {
$each = round(($bid21[$building->getTypeLevel(21)]['attri'] / 100) * ${'u'.$unit}['time'] / SPEED);
}
}
if(in_array($unit,$special)) {
if($building->getTypeLevel(25) > 0){
$each = round(($bid25[$building->getTypeLevel(25)]['attri'] / 100) * ${'u'.$unit}['time'] / SPEED);
} else {
$each = round(($bid26[$building->getTypeLevel(26)]['attri'] / 100) * ${'u'.$unit}['time'] / SPEED);
}
}
if(in_array($unit,$trapper)) {
$each = round(($bid19[$building->getTypeLevel(36)]['attri'] / 100) * ${'u'.$unit}['time'] / SPEED);
}
if($unit%10 == 0 || $unit%10 == 9 && $unit != 99) {
$slots = $database->getAvailableExpansionTraining();
if($unit%10 == 0 && $slots['settlers'] <= $amt) { $amt = $slots['settlers']; }
if($unit%10 == 9 && $slots['chiefs'] <= $amt) { $amt = $slots['chiefs']; }
} else {
if($unit != 99){
if($this->maxUnit($unit,$great) < $amt) {
$amt = 0;
}
}else{
$trainlist = $this->getTrainingList(8);
foreach($trainlist as $train) {
$train_amt += $train['amt'];
}
$max = 0;
for($i=19;$i<41;$i++){
if($village->resarray['f'.$i.'t'] == 36){
$max += $bid36[$village->resarray['f'.$i]]['attri'];
}
}
$max1 = $max - ($village->unitarray['u99'] + $train_amt);
if($max1 < $amt) {
$amt = 0;
}
}
}
$wood = ${'u'.$unit}['wood'] * $amt * ($great?3:1);
$clay = ${'u'.$unit}['clay'] * $amt * ($great?3:1);
$iron = ${'u'.$unit}['iron'] * $amt * ($great?3:1);
$crop = ${'u'.$unit}['crop'] * $amt * ($great?3:1);
$each = ($each == 0) ? 1 : $each;
$time = $each*$amt;
if($database->modifyResource($village->wid,$wood,$clay,$iron,$crop,0) && $amt > 0) {
$database->trainUnit($village->wid,$unit+($great?60:0),$amt,${'u'.$unit}['pop'],$each,time()+$time,0);
}
}
}
public function meetRRequirement($tech) {
global $session,$building;
switch($tech) {
case 2:
if($building->getTypeLevel(22) >= 1 && $building->getTypeLevel(13) >= 1) { return true; } else { return false; }
break;
case 3:
if($building->getTypeLevel(22) >= 5 && $building->getTypeLevel(12) >= 1) { return true; } else { return false; }
break;
case 4:
case 23:
if($building->getTypeLevel(22) >= 5 && $building->getTypeLevel(20) >= 1) { return true; } else { return false; }
break;
case 5:
case 25:
if($building->getTypeLevel(22) >= 5 && $building->getTypeLevel(20) >= 5) { return true; } else { return false; }
break;
case 6:
if($building->getTypeLevel(22) >= 15 && $building->getTypeLevel(20) >= 10) { return true; } else { return false; }
break;
case 9:
case 29:
if($building->getTypeLevel(22) >= 20 && $building->getTypeLevel(16) >= 10) { return true; } else { return false; }
break;
case 12:
case 32:
case 42:
if($building->getTypeLevel(22) >= 1 && $building->getTypeLevel(19) >= 3) { return true; } else { return false; }
break;
case 13:
case 33:
case 43:
if($building->getTypeLevel(22) >= 3 && $building->getTypeLevel(12) >= 1) { return true; } else { return false; }
break;
case 14:
case 34:
case 44:
if($building->getTypeLevel(22) >= 1 && $building->getTypeLevel(15) >= 5) { return true; } else { return false; }
break;
case 15:
case 35:
case 45:
if($building->getTypeLevel(22) >= 1 && $building->getTypeLevel(20) >= 3) { return true; } else { return false; }
break;
case 16:
case 26:
case 36:
case 46:
if($building->getTypeLevel(22) >= 15 && $building->getTypeLevel(20) >= 10) { return true; } else { return false; }
break;
case 7:
case 17:
case 27:
case 37:
case 47:
if($building->getTypeLevel(22) >= 10 && $building->getTypeLevel(21) >= 1) { return true; } else { return false; }
break;
case 8:
case 18:
case 28:
case 38:
case 48:
if($building->getTypeLevel(22) >= 15 && $building->getTypeLevel(21) >= 10) { return true; } else { return false; }
break;
case 19:
case 39:
case 49:
if($building->getTypeLevel(22) >= 20 && $building->getTypeLevel(16) >= 5) { return true; } else { return false; }
break;
case 22:
if($building->getTypeLevel(22) >= 3 && $building->getTypeLevel(12) >= 1) { return true; } else { return false; }
break;
case 24:
if($building->getTypeLevel(22) >= 5 && $building->getTypeLevel(20) >= 3) { return true; } else { return false; }
break;
}
}
private function researchTech($get) {
//global $database,$session,${'r'.$get['a']},$village,$logging;
global $database,$session,${'r'.$get['a']},$bid22,$building,$village,$logging;
if($this->meetRRequirement($get['a']) && $get['c'] == $session->mchecker) {
$data = ${'r'.$get['a']};
$time = time() + round(($data['time'] * ($bid22[$building->getTypeLevel(22)]['attri'] / 100))/SPEED);
//$time = time() + round($data['time']/SPEED);
$database->modifyResource($village->wid,$data['wood'],$data['clay'],$data['iron'],$data['crop'],0);
$database->addResearch($village->wid,"t".$get['a'],$time);
$logging->addTechLog($village->wid,"t".$get['a'],1);
}
$session->changeChecker();
header("Location: build.php?id=".$get['id']);
}
private function upgradeSword($get) {
global $database,$session,$bid12,$building,$village,$logging;
$ABTech = $database->getABTech($village->wid);
$CurrentTech = $ABTech["b".$get['a']];
$unit = ($session->tribe-1)*10+intval($get['a']);
if(($this->getTech($unit) || ($unit % 10) == 1) && ($CurrentTech < $building->getTypeLevel(12)) && $get['c'] == $session->mchecker) {
global ${'ab'.strval($unit)};
$data = ${'ab'.strval($unit)};
$time = time() + round(($data[$CurrentTech+1]['time'] * ($bid12[$building->getTypeLevel(12)]['attri'] / 100))/SPEED);
if ($database->modifyResource($village->wid,$data[$CurrentTech+1]['wood'],$data[$CurrentTech+1]['clay'],$data[$CurrentTech+1]['iron'],$data[$CurrentTech+1]['crop'],0)) {
$database->addResearch($village->wid,"b".$get['a'],$time);
$logging->addTechLog($village->wid,"b".$get['a'],$CurrentTech+1);
}
}
$session->changeChecker();
header("Location: build.php?id=".$get['id']);
}
private function upgradeArmour($get) {
global $database,$session,$bid13,$building,$village,$logging;
$ABTech = $database->getABTech($village->wid);
$CurrentTech = $ABTech["a".$get['a']];
$unit = ($session->tribe-1)*10+intval($get['a']);
if(($this->getTech($unit) || ($unit % 10) == 1) && ($CurrentTech < $building->getTypeLevel(13)) && $get['c'] == $session->mchecker) {
global ${'ab'.strval($unit)};
$data = ${'ab'.strval($unit)};
$time = time() + round(($data[$CurrentTech+1]['time'] * ($bid13[$building->getTypeLevel(13)]['attri'] / 100))/SPEED);
if ($database->modifyResource($village->wid,$data[$CurrentTech+1]['wood'],$data[$CurrentTech+1]['clay'],$data[$CurrentTech+1]['iron'],$data[$CurrentTech+1]['crop'],0)) {
$database->addResearch($village->wid,"a".$get['a'],$time);
$logging->addTechLog($village->wid,"a".$get['a'],$CurrentTech+1);
}
}
$session->changeChecker();
header("Location: build.php?id=".$get['id']);
}
public function getUnitName($i) {
return $this->unarray[$i];
}
public function finishTech() {
global $database,$village;
$q = "UPDATE ".TB_PREFIX."research SET timestamp=".(time()-1)." WHERE vref = ".$village->wid;
$database->query($q);
}
public function calculateAvaliable($id,$resarray=array()) {
global $village,$generator,${'r'.$id};
if(count($resarray)==0) {
$resarray['wood'] = ${'r'.$id}['wood'];
$resarray['clay'] = ${'r'.$id}['clay'];
$resarray['iron'] = ${'r'.$id}['iron'];
$resarray['crop'] = ${'r'.$id}['crop'];
}
$rwtime = ($resarray['wood']-$village->awood) / $village->getProd("wood") * 3600;
$rcltime = ($resarray['clay']-$village->aclay) / $village->getProd("clay") * 3600;
$ritime = ($resarray['iron']-$village->airon) / $village->getProd("iron") * 3600;
$rctime = ($resarray['crop']-$village->acrop) / $village->getProd("crop") * 3600;
if($village->getProd("crop") >= 0) {
$reqtime = max($rwtime,$rcltime,$ritime,$rctime) + time();
} else {
$reqtime = max($rwtime,$rcltime,$ritime);
if($reqtime > $rctime) {
$reqtime = 0;
} else {
$reqtime += time();
}
}
return $generator->procMtime($reqtime);
}
public function checkReinf($id) {
global $database;
$enforce=$database->getEnforceArray($id,0);
$fail='0';
for($i=1; $i<50; $i++){
if($enforce['u'.$i.'']>0){
$fail='1';
}
}
if($fail==0){
$database->deleteReinf($id);
}
}
}
$technology = new Technology;
?>
+551
View File
@@ -0,0 +1,551 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Units.php ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class Units {
public $sending,$recieving,$return = array();
public function procUnits($post) {
if(isset($post['c'])) {
switch($post['c']) {
case "1":
if (isset($post['a'])&& $post['a']==533374){
$this->sendTroops($post);
}else{
$post = $this->loadUnits($post);
return $post;
}
break;
case "2":
if (isset($post['a'])&& $post['a']==533374 && $post['disabledr'] == ""){
$this->sendTroops($post);
}else{
$post = $this->loadUnits($post);
return $post;
}
break;
case "8":
$this->sendTroopsBack($post);
break;
case "3":
if (isset($post['a'])&& $post['a']==533374 && $post['disabled'] == ""){
$this->sendTroops($post);
}else{
$post = $this->loadUnits($post);
return $post;
}
break;
case "4":
if (isset($post['a'])&& $post['a']==533374){
$this->sendTroops($post);
}else{
$post = $this->loadUnits($post);
return $post;
}
case "5":
if (isset($post['a'])&& $post['a']== "new"){
$this->Settlers($post);
}else{
$post = $this->loadUnits($post);
return $post;
}
break;
}
}
}
private function loadUnits($post) {
global $database,$village,$session,$generator,$logging,$form;
// Busqueda por nombre de pueblo
// Confirmamos y buscamos las coordenadas por nombre de pueblo
if($post['x']!="" && $post['y']!=""){
$oid = $database->getVilWref($post['x'],$post['y']);
}else if($post['dname']!=""){
$oid = $database->getVillageByName(stripslashes($post['dname']));
}
if($database->isVillageOases($oid) != 0){
$too = $database->getOasisField($oid,"conqured");
if($too['conqured'] == 0){$disabledr ="disabled=disabled"; $disabled ="disabled=disabled";}else{
$disabledr ="";
if($session->sit == 0){
$disabled ="";
}else{
$disabled ="disabled=disabled";
}
}
}else{
$disabledr ="";
if($session->sit == 0){
$disabled ="";
}else{
$disabled ="disabled=disabled";
}
}
if($disabledr != "" && $post['c'] == 2){
$form->addError("error","You can't reinforce this village/oasis");
}
if($disabled != "" && $post['c'] == 3){
$form->addError("error","You can't attack this village/oasis with normal attack");
}
if( !$post['t1'] && !$post['t2'] && !$post['t3'] && !$post['t4'] && !$post['t5'] &&
!$post['t6'] && !$post['t7'] && !$post['t8'] && !$post['t9'] && !$post['t10'] && !$post['t11']){
$form->addError("error","You need to mark min. one troop");
}
if(!$post['dname'] && !$post['x'] && !$post['y']){
$form->addError("error","Insert name or coordinates");
}
if(isset($post['dname']) && $post['dname'] != "") {
$id = $database->getVillageByName(stripslashes($post['dname']));
if (!isset($id)){
$form->addError("error","Village do not exist");
}else{
$coor = $database->getCoor($id);
}
}
// Busqueda por coordenadas de pueblo
// Confirmamos y buscamos las coordenadas por coordenadas de pueblo
if(isset($post['x']) && isset($post['y']) && $post['x'] != "" && $post['y'] != "") {
$coor = array('x'=>$post['x'], 'y'=>$post['y']);
$id = $generator->getBaseID($coor['x'],$coor['y']);
if (!$database->getVillageState($id)){
$form->addError("error","Coordinates do not exist");
}
if ($session->tribe == 1){$Gtribe = "";}elseif ($session->tribe == 2){$Gtribe = "1";}elseif ($session->tribe == 3){$Gtribe = "2";}elseif ($session->tribe == 4){$Gtribe = "3";}elseif ($session->tribe == 5){$Gtribe = "4";}
for($i=1; $i<11; $i++)
{
if(isset($post['t'.$i]))
{
if ($post['t'.$i] > $village->unitarray['u'.$Gtribe.$i])
{
$form->addError("error","You can't send more units than you have");
break;
}
if($post['t'.$i]<0)
{
$form->addError("error","You can't send negative units.");
break;
}
}
}
if ($post['t11'] > $village->unitarray['hero'])
{
$form->addError("error","You can't send more units than you have");
break;
}
if($post['t11']<0)
{
$form->addError("error","You can't send negative units.");
break;
}
}
if ($database->isVillageOases($id) == 0) {
if($database->hasBeginnerProtection($id)==1) {
$form->addError("error","Player is under beginners protection. You can't attack him");
}
//check if banned/admin:
$villageOwner = $database->getVillageField($id,'owner');
$userAccess = $database->getUserField($villageOwner,'access',0);
if($userAccess == '0' or $userAccess == '8' or $userAccess == '9'){
$form->addError("error","Player is Banned. You can't attack him");
//break;
}
//check if attacking same village that units are in
if($id == $village->wid){
$form->addError("error","You cant attack same village you are sending from.");
//break;
}
// Procesamos el array con los errores dados en el formulario
if($form->returnErrors() > 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: a2b.php");
}else{
// Debemos devolver un array con $post, que contiene todos los datos mas
// otra variable que definira que el flag esta levantado y se va a enviar y el tipo de envio
$villageName = $database->getVillageField($id,'name');
$speed= 300;
$timetaken = $generator->procDistanceTime($coor,$village->coor,INCREASE_SPEED,1);
array_push($post, "$id", "$villageName", "$villageOwner","$timetaken");
return $post;
}
}else{
if($form->returnErrors() > 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: a2b.php");
}else{
$villageName = $database->getOasisField($oid,"name");
$speed= 300;
$timetaken = $generator->procDistanceTime($coor,$village->coor,INCREASE_SPEED,1);
array_push($post, "$id", "$villageName", "2","$timetaken");
return $post;
}
}
}
private function sendTroops($post) {
global $form, $database, $village, $generator, $session;
$data = $database->getA2b($post['timestamp_checksum'], $post['timestamp']);
$Gtribe = "";
if ($session->tribe == '2'){ $Gtribe = "1"; } else if ($session->tribe == '3'){ $Gtribe = "2"; }else if ($session->tribe == '4'){ $Gtribe = "3"; }else if ($session->tribe == '5'){ $Gtribe = "4"; }
for($i=1; $i<10; $i++){
if(isset($data['u'.$i])){
if ($data['u'.$i] > $village->unitarray['u'.$Gtribe.$i])
{
$form->addError("error","You can't send more units than you have");
break;
}
if($data['u'.$i]<0)
{
$form->addError("error","You can't send negative units.");
break;
}
}
}
if ($data['u11'] > $village->unitarray['hero'])
{
$form->addError("error","You can't send more units than you have");
break;
}
if($data['u11']<0)
{
$form->addError("error","You can't send negative units.");
break;
}
if($form->returnErrors() > 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: a2b.php");
} else {
if($session->access != BANNED){
if($session->tribe == 1){ $u = ""; } elseif($session->tribe == 2){ $u = "1"; } elseif($session->tribe == 3){ $u = "2"; }elseif($session->tribe == 4){ $u = "3"; }else {$u = "4"; }
$database->modifyUnit(
$village->wid,
array($u."1",$u."2",$u."3",$u."4",$u."5",$u."6",$u."7",$u."8",$u."9",$u.$session->tribe."0","hero"),
array($data['u1'],$data['u2'],$data['u3'],$data['u4'],$data['u5'],$data['u6'],$data['u7'],$data['u8'],$data['u9'],$data['u10'],$data['u11']),
array(0,0,0,0,0,0,0,0,0,0,0)
);
$query1 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysql_escape_string($data['to_vid']));
$data1 = mysql_fetch_assoc($query1);
$query2 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data1['owner']);
$data2 = mysql_fetch_assoc($query2);
$query11 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'vdata` WHERE `wref` = ' . mysql_escape_string($village->wid));
$data11 = mysql_fetch_assoc($query11);
$query21 = mysql_query('SELECT * FROM `' . TB_PREFIX . 'users` WHERE `id` = ' . $data11['owner']);
$data21 = mysql_fetch_assoc($query21);
$eigen = $database->getCoor($village->wid);
$from = array('x'=>$eigen['x'], 'y'=>$eigen['y']);
$ander = $database->getCoor($data['to_vid']);
$to = array('x'=>$ander['x'], 'y'=>$ander['y']);
$start = ($data21['tribe']-1)*10+1;
$end = ($data21['tribe']*10);
$speeds = array();
$scout = 1;
//find slowest unit.
for($i=1;$i<=10;$i++){
if (isset($data['u'.$i])){
if($data['u'.$i] != '' && $data['u'.$i] > 0){
if($unitarray) { reset($unitarray); }
$unitarray = $GLOBALS["u".(($session->tribe-1)*10+$i)];
$speeds[] = $unitarray['speed'];
}
}
}
if (isset($data['u11'])) {
if($data['u11'] != '' && $data['u11'] > 0){
$heroarray = $database->getHero($session->uid);
$herodata = $GLOBALS["u".$heroarray[0]['unit']];
$speeds[] = $herodata['speed'];
}
}
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0));
if($artefact > 0){
$fastertroops = 3;
}else if($artefact1 > 0){
$fastertroops = 2;
}else if($artefact2 > 0){
$fastertroops = 1.5;
}else{
$fastertroops = 1;
}
$time = round($generator->procDistanceTime($from,$to,min($speeds),1)/$fastertroops);
$foolartefact = $database->getFoolArtefactInfo(2,$village->wid,$session->uid);
if(count($foolartefact) > 0){
foreach($foolartefact as $arte){
if($arte['bad_effect'] == 1){
$time *= $arte['effect2'];
}else{
$time /= $arte['effect2'];
$time = round($time);
}
}
}
$to_owner = $database->getVillageField($data['to_vid'],"owner");
$artefact_2 = count($database->getOwnUniqueArtefactInfo2($to_owner,7,3,0));
$artefact1_2 = count($database->getOwnUniqueArtefactInfo2($data['to_vid'],7,1,1));
$artefact2_2 = count($database->getOwnUniqueArtefactInfo2($to_owner,7,2,0));
$foolartefact2 = $database->getFoolArtefactInfo(7,$data['to_vid'],$to_owner);
$good_artefact = 0;
if(count($foolartefact2) > 0){
foreach($foolartefact2 as $arte){
if($arte['bad_effect'] == 0){
$good_artefact = 1;
}
}
}
if (isset($post['ctar1'])){if($artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0 or $good_artefact == 1){$post['ctar1'] = 99;}else{$post['ctar1'] = $post['ctar1'];}}else{ $post['ctar1'] = 0;}
if (isset($post['ctar2'])){if($artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0 or $good_artefact == 1){$post['ctar2'] = 99;}else{$post['ctar2'] = $post['ctar2'];}}else{ $post['ctar2'] = 0;}
if (isset($post['spy'])){$post['spy'] = $post['spy'];}else{ $post['spy'] = 0;}
$abdata = $database->getABTech($village->wid);
$reference = $database->addAttack(($village->wid),$data['u1'],$data['u2'],$data['u3'],$data['u4'],$data['u5'],$data['u6'],$data['u7'],$data['u8'],$data['u9'],$data['u10'],$data['u11'],$data['type'],$post['ctar1'],$post['ctar2'],$post['spy'],$abdata['b1'],$abdata['b2'],$abdata['b3'],$abdata['b4'],$abdata['b5'],$abdata['b6'],$abdata['b7'],$abdata['b8']);
$checkexist = $database->checkVilExist($data['to_vid']);
$checkoexist = $database->checkOasisExist($data['to_vid']);
if($checkexist or $checkoexist){
$database->addMovement(3,$village->wid,$data['to_vid'],$reference,time(),($time+time()));
}
if($form->returnErrors() > 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: a2b.php");
}
header("Location: build.php?id=39");
}else{
header("Location: banned.php");
}
}}
private function sendTroopsBack($post) {
global $form, $database, $village, $generator, $session, $technology;
if($session->access != BANNED){
$enforce=$database->getEnforceArray($post['ckey'],0);
if(($enforce['from']==$village->wid) || ($enforce['vref']==$village->wid)){
$to = $database->getVillage($enforce['from']);
$Gtribe = "";
if ($database->getUserField($to['owner'],'tribe',0) == '2'){ $Gtribe = "1"; } else if ($database->getUserField($to['owner'],'tribe',0) == '3'){ $Gtribe = "2"; } else if ($database->getUserField($to['owner'],'tribe',0) == '4'){ $Gtribe = "3"; }else if ($database->getUserField($to['owner'],'tribe',0) == '5'){ $Gtribe = "4"; }
for($i=1; $i<10; $i++){
if(isset($post['t'.$i])){
if($i!=10){
if ($post['t'.$i] > $enforce['u'.$Gtribe.$i])
{
$form->addError("error","You can't send more units than you have");
break;
}
if($post['t'.$i]<0)
{
$form->addError("error","You can't send negative units.");
break;
}
}
} else {
$post['t'.$i.'']='0';
}
}
if(isset($post['t11'])){
if ($post['t11'] > $enforce['hero'])
{
$form->addError("error","You can't send more units than you have");
break;
}
if($post['t11']<0)
{
$form->addError("error","You can't send negative units.");
break;
}
} else {
$post['t11']='0';
}
if($form->returnErrors() > 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: a2b.php");
} else {
//change units
$start = ($database->getUserField($to['owner'],'tribe',0)-1)*10+1;
$end = ($database->getUserField($to['owner'],'tribe',0)*10);
$j='1';
for($i=$start;$i<=$end;$i++){
$database->modifyEnforce($post['ckey'],$i,$post['t'.$j.''],0); $j++;
}
$database->modifyEnforce($post['ckey'],'hero',$post['t11'],0); $j++;
//get cord
$from = $database->getVillage($enforce['from']);
$fromcoor = $database->getCoor($enforce['from']);
$tocoor = $database->getCoor($enforce['vref']);
$fromCor = array('x'=>$tocoor['x'], 'y'=>$tocoor['y']);
$toCor = array('x'=>$fromcoor['x'], 'y'=>$fromcoor['y']);
$speeds = array();
//find slowest unit.
for($i=1;$i<=10;$i++){
if (isset($post['t'.$i])){
if( $post['t'.$i] != '' && $post['t'.$i] > 0){
if($unitarray) { reset($unitarray); }
$unitarray = $GLOBALS["u".(($session->tribe-1)*10+$i)];
$speeds[] = $unitarray['speed'];
} else {
$post['t'.$i.'']='0';
}
} else {
$post['t'.$i.'']='0';
}
}
if (isset($post['t11'])){
if( $post['t11'] != '' && $post['t11'] > 0){
$qh = "SELECT * FROM ".TB_PREFIX."hero WHERE uid = ".$from['owner']."";
$resulth = mysql_query($qh);
$hero_f=mysql_fetch_array($resulth);
$hero_unit=$hero_f['unit'];
$speeds[] = $GLOBALS['u'.$hero_unit]['speed'];
} else {
$post['t11']='0';
}
} else {
$post['t11']='0';
}
$artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0));
$artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1));
$artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0));
if($artefact > 0){
$fastertroops = 3;
}else if($artefact1 > 0){
$fastertroops = 2;
}else if($artefact2 > 0){
$fastertroops = 1.5;
}else{
$fastertroops = 1;
}
$time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops);
$foolartefact2 = $database->getFoolArtefactInfo(2,$village->wid,$session->uid);
if(count($foolartefact2) > 0){
foreach($foolartefact2 as $arte){
if($arte['bad_effect'] == 1){
$time *= $arte['effect2'];
}else{
$time /= $arte['effect2'];
$time = round($time);
}
}
}
$reference = $database->addAttack($enforce['from'],$post['t1'],$post['t2'],$post['t3'],$post['t4'],$post['t5'],$post['t6'],$post['t7'],$post['t8'],$post['t9'],$post['t10'],$post['t11'],2,0,0,0,0);
$database->addMovement(4,$village->wid,$enforce['from'],$reference,time(),($time+time()));
$technology->checkReinf($post['ckey']);
header("Location: build.php?id=39");
}
} else {
$form->addError("error","You cant change someones troops.");
if($form->returnErrors() > 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: a2b.php");
}
}
}else{
header("Location: banned.php");
}
}
public function Settlers($post) {
global $form, $database, $village, $session;
if($session->access != BANNED){
$mode = CP;
$total = count($database->getProfileVillages($session->uid));
$need_cps = ${'cp'.$mode}[$total+1];
$cps = $session->cp;
$rallypoint = $database->getResourceLevel($village->wid);
if($rallypoint['f39'] > 0){
if($cps >= $need_cps) {
$unit = ($session->tribe*10);
$database->modifyResource($village->wid,750,750,750,750,0);
$database->modifyUnit($village->wid,array($unit),array(3),array(0));
$database->addMovement(5,$village->wid,$post['s'],0,time(),time()+$post['timestamp']);
header("Location: build.php?id=39");
if($form->returnErrors() > 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: a2b.php");
}
} else {
header("Location: build.php?id=39");
}
}else{
header("Location: dorf1.php");
}
}else{
header("Location: banned.php");
}
}
public function Hero($uid) {
global $database;
$heroarray = $database->getHero($uid);
$herodata = $GLOBALS["h".$heroarray[0]['unit']];
$h_atk = $herodata['atk'] + 5 * floor($heroarray[0]['attack'] * $herodata['atkp'] / 5);
$h_di = $herodata['di'] + 5 * floor($heroarray[0]['defence'] * $herodata['dip'] / 5);
$h_dc = $herodata['dc'] + 5 * floor($heroarray[0]['defence'] * $herodata['dcp'] / 5);
$h_ob = 1 + 0.002 * $heroarray[0]['attackbonus'];
$h_db = 1 + 0.002 * $heroarray[0]['defencebonus'];
return array('heroid'=>$heroarray[0]['heroid'],'unit'=>$heroarray[0]['unit'],'atk'=>$h_atk,'di'=>$h_di,'dc'=>$h_dc,'ob'=>$h_ob,'db'=>$h_db,'health'=>$heroarray[0]['health']);
}
};
$units = new Units;
?>
+295
View File
@@ -0,0 +1,295 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Village.php ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
include("Session.php");
include("Building.php");
include("Market.php");
include("Technology.php");
class Village {
public $type;
public $coor = array();
public $awood,$aclay,$airon,$acrop,$pop,$maxstore,$maxcrop;
public $wid,$vname,$capital,$natar,$master;
public $resarray = array();
public $unitarray,$techarray,$unitall,$researching,$abarray = array();
private $infoarray = array();
private $production = array();
private $oasisowned,$ocounter = array();
function Village() {
global $session;
if(isset($_SESSION['wid'])) {
$this->wid = $_SESSION['wid'];
}
else {
$this->wid = $session->villages[0];
}
$this->LoadTown();
$this->calculateProduction();
$this->processProduction();
$this->ActionControl();
}
public function getProd($type) {
return $this->production[$type];
}
public function getAllUnits($vid) {
global $database,$technology;
return $technology->getUnits($database->getUnit($vid),$database->getEnforceVillage($vid,0));
}
private function LoadTown() {
global $database,$session,$logging,$technology;
$this->infoarray = $database->getVillage($this->wid);
if($this->infoarray['owner'] != $session->uid && !$session->isAdmin) {
unset($_SESSION['wid']);
$logging->addIllegal($session->uid,$this->wid,1);
$this->wid = $session->villages[0];
$this->infoarray = $database->getVillage($this->wid);
}
$this->resarray = $database->getResourceLevel($this->wid);
$this->coor = $database->getCoor($this->wid);
$this->type = $database->getVillageType($this->wid);
$this->oasisowned = $database->getOasis($this->wid);
$this->ocounter = $this->sortOasis();
$this->unitarray = $database->getUnit($this->wid);
$this->enforcetome = $database->getEnforceVillage($this->wid,0);
$this->enforcetoyou = $database->getEnforceVillage($this->wid,1);
$this->unitall = $technology->getAllUnits($this->wid);
$this->techarray = $database->getTech($this->wid);
$this->abarray = $database->getABTech($this->wid);
$this->researching = $database->getResearching($this->wid);
$this->capital = $this->infoarray['capital'];
$this->natar = $this->infoarray['natar'];
$this->currentcel = $this->infoarray['celebration'];
$this->wid = $this->infoarray['wref'];
$this->vname = $this->infoarray['name'];
$this->awood = $this->infoarray['wood'];
$this->aclay = $this->infoarray['clay'];
$this->airon = $this->infoarray['iron'];
$this->acrop = $this->infoarray['crop'];
$this->pop = $this->infoarray['pop'];
$this->maxstore = $this->infoarray['maxstore'];
$this->maxcrop = $this->infoarray['maxcrop'];
$this->allcrop = $this->getCropProd();
$this->loyalty = $this->infoarray['loyalty'];
$this->master = count($database->getMasterJobs($this->wid));
//de gs in town, zetten op max pakhuisinhoud
if($this->awood>$this->maxstore){ $this->awood=$this->maxstore; $database->updateResource($this->wid,'wood',$this->maxstore); }
if($this->aclay>$this->maxstore){ $this->aclay=$this->maxstore; $database->updateResource($this->wid,'clay',$this->maxstore); }
if($this->airon>$this->maxstore){ $this->airon=$this->maxstore; $database->updateResource($this->wid,'iron',$this->maxstore); }
if($this->acrop>$this->maxcrop){ $this->acrop=$this->maxcrop; $database->updateResource($this->wid,'crop',$this->maxcrop); }
}
private function calculateProduction() {
global $technology,$database,$session;
$normalA = $database->getOwnArtefactInfoByType($_SESSION['wid'],4);
$largeA = $database->getOwnUniqueArtefactInfo($session->uid,4,2);
$uniqueA = $database->getOwnUniqueArtefactInfo($session->uid,4,3);
$upkeep = $technology->getUpkeep($this->unitall,0,$this->wid);
$this->production['wood'] = $this->getWoodProd();
$this->production['clay'] = $this->getClayProd();
$this->production['iron'] = $this->getIronProd();
if ($uniqueA['size']==3 && $uniqueA['owner']==$session->uid){
$this->production['crop'] = $this->getCropProd()-$this->pop-(($upkeep)-round($upkeep*0.50));
}else if ($normalA['type']==4 && $normalA['size']==1 && $normalA['owner']==$session->uid){
$this->production['crop'] = $this->getCropProd()-$this->pop-(($upkeep)-round($upkeep*0.25));
}else if ($largeA['size']==2 && $largeA['owner']==$session->uid){
$this->production['crop'] = $this->getCropProd()-$this->pop-(($upkeep)-round($upkeep*0.25));
}else{
$this->production['crop'] = $this->getCropProd()-$this->pop-$upkeep;
}
}
private function processProduction() {
global $database;
$timepast = time() - $this->infoarray['lastupdate'];
$nwood = ($this->production['wood'] / 3600) * $timepast;
$nclay = ($this->production['clay'] / 3600) * $timepast;
$niron = ($this->production['iron'] / 3600) * $timepast;
$ncrop = ($this->production['crop'] / 3600) * $timepast;
$database->modifyResource($this->wid,$nwood,$nclay,$niron,$ncrop,1);
$database->updateVillage($this->wid);
$this->LoadTown();
}
private function getWoodProd() {
global $bid1,$bid5,$session;
$basewood = $sawmill = 0;
$woodholder = array();
for($i=1;$i<=38;$i++) {
if($this->resarray['f'.$i.'t'] == 1) {
array_push($woodholder,'f'.$i);
}
if($this->resarray['f'.$i.'t'] == 5) {
$sawmill = $this->resarray['f'.$i];
}
}
for($i=0;$i<=count($woodholder)-1;$i++) { $basewood+= $bid1[$this->resarray[$woodholder[$i]]]['prod']; }
$wood = $basewood + $basewood * 0.25 * $this->ocounter[0];
if($sawmill >= 1) {
$wood += $basewood / 100 * $bid5[$sawmill]['attri'];
}
if($session->bonus1 == 1) {
$wood *= 1.25;
}
$wood *= SPEED;
return round($wood);
}
private function getClayProd() {
global $bid2,$bid6,$session;
$baseclay = $clay = $brick = 0;
$clayholder = array();
for($i=1;$i<=38;$i++) {
if($this->resarray['f'.$i.'t'] == 2) {
array_push($clayholder,'f'.$i);
}
if($this->resarray['f'.$i.'t'] == 6) {
$brick = $this->resarray['f'.$i];
}
}
for($i=0;$i<=count($clayholder)-1;$i++) { $baseclay+= $bid2[$this->resarray[$clayholder[$i]]]['prod']; }
$clay = $baseclay + $baseclay * 0.25 * $this->ocounter[1];
if($brick >= 1) {
$clay += $baseclay / 100 * $bid6[$brick]['attri'];
}
if($session->bonus2 == 1) {
$clay *= 1.25;
}
$clay *= SPEED;
return round($clay);
}
private function getIronProd() {
global $bid3,$bid7,$session;
$baseiron = $foundry = 0;
$ironholder = array();
for($i=1;$i<=38;$i++) {
if($this->resarray['f'.$i.'t'] == 3) {
array_push($ironholder,'f'.$i);
}
if($this->resarray['f'.$i.'t'] == 7) {
$foundry = $this->resarray['f'.$i];
}
}
for($i=0;$i<=count($ironholder)-1;$i++) { $baseiron+= $bid3[$this->resarray[$ironholder[$i]]]['prod']; }
$iron = $baseiron + $baseiron * 0.25 * $this->ocounter[2];
if($foundry >= 1) {
$iron += $baseiron / 100 * $bid7[$foundry]['attri'];
}
if($session->bonus3 == 1) {
$iron *= 1.25;
}
$iron *= SPEED;
return round($iron);
}
private function getCropProd() {
global $bid4,$bid8,$bid9,$session;
$basecrop = $grainmill = $bakery = 0;
$cropholder = array();
for($i=1;$i<=38;$i++) {
if($this->resarray['f'.$i.'t'] == 4) {
array_push($cropholder,'f'.$i);
}
if($this->resarray['f'.$i.'t'] == 8) {
$grainmill = $this->resarray['f'.$i];
}
if($this->resarray['f'.$i.'t'] == 9) {
$bakery = $this->resarray['f'.$i];
}
}
for($i=0;$i<=count($cropholder)-1;$i++) { $basecrop+= $bid4[$this->resarray[$cropholder[$i]]]['prod']; }
$crop = $basecrop + $basecrop * 0.25 * $this->ocounter[3];
if($grainmill >= 1 || $bakery >= 1) {
$crop += $basecrop /100 * ($bid8[$grainmill]['attri'] + $bid9[$bakery]['attri']);
}
if($session->bonus4 == 1) {
$crop *= 1.25;
}
$crop *= SPEED;
return round($crop);
}
private function sortOasis() {
$crop = $clay = $wood = $iron = 0;
if (!empty($this->oasisowned)) {
foreach ($this->oasisowned as $oasis) {
switch($oasis['type']) {
case 1:
case 2:
$wood += 1;
break;
case 3:
$wood += 1;
$crop += 1;
break;
case 4:
case 5:
$clay += 1;
break;
case 6:
$clay += 1;
$crop += 1;
break;
case 7:
case 8:
$iron += 1;
break;
case 9:
$iron += 1;
$crop += 1;
break;
case 10:
case 11:
$crop += 1;
break;
case 12:
$crop += 2;
break;
}
}
}
return array($wood,$clay,$iron,$crop);
}
private function ActionControl() {
global $session;
if(SERVER_WEB_ROOT) {
$page = $_SERVER['SCRIPT_NAME'];
}
else {
$explode = explode("/",$_SERVER['SCRIPT_NAME']);
$i = count($explode)-1;
$page = $explode[$i];
}
if($page == "build.php" && $session->uid != $this->infoarray['owner']) {
unset($_SESSION['wid']);
header("Location: dorf1.php");
}
}
};
$village = new Village;
$building = new Building;
?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

+37
View File
@@ -0,0 +1,37 @@
<?php
############################################################
## ##
## Test functions so far mini template parser ##
## Author : Advocaite ##
## Project : TravianX ##
## ##
############################################################
function addSub($subName, $sub)
{
$GLOBALS['subs']["{".$subName."}"] = $sub;
}
function template($filepath, $subs)
{
global $s;
if(file_exists($filepath))
{
$text = file_get_contents($filepath);
} else {
print "File '$filepath' not found";
return false;
}
foreach($subs as $sub => $repl)
{
$text = str_replace($sub, $repl, $text);
}
ob_start();
eval("?>".$text);
$text = ob_get_contents();
ob_end_clean();
return $text;
}
?>