first commit

This commit is contained in:
unknown
2012-03-29 13:00:34 +02:00
commit 6928cbcd1d
2446 changed files with 85772 additions and 0 deletions
+141
View File
@@ -0,0 +1,141 @@
// Flash Player Version Detection - Rev 1.6
// Detect Client Browser type
// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
function ControlVersion()
{
var version;
var axo;
var e;
// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
try {
// version will be set for 7.X or greater players
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
version = axo.GetVariable("$version");
} catch (e) {
}
if (!version)
{
try {
// version will be set for 6.X players only
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
// installed player is some revision of 6.0
// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
// so we have to be careful.
// default to the first public version
version = "WIN 6,0,21,0";
// throws if AllowScripAccess does not exist (introduced in 6.0r47)
axo.AllowScriptAccess = "always";
// safe to call for 6.0r47 or greater
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 4.X or 5.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = axo.GetVariable("$version");
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 3.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
version = "WIN 3,0,18,0";
} catch (e) {
}
}
if (!version)
{
try {
// version will be set for 2.X player
axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
version = "WIN 2,0,0,11";
} catch (e) {
version = -1;
}
}
return version;
}
// JavaScript helper required to detect Flash Player PlugIn version information
function GetSwfVer(id){
// NS/Opera version >= 3 check for Flash plugin in plugin array
var flashVer = -1;
if (navigator.plugins != null && navigator.plugins.length > 0) {
if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
var descArray = flashDescription.split(" ");
var tempArrayMajor = descArray[2].split(".");
var versionMajor = tempArrayMajor[0];
var versionMinor = tempArrayMajor[1];
var versionRevision = descArray[3];
if (versionRevision == "") {
versionRevision = descArray[4];
}
if (versionRevision[0] == "d") {
versionRevision = versionRevision.substring(1);
} else if (versionRevision[0] == "r") {
versionRevision = versionRevision.substring(1);
if (versionRevision.indexOf("d") > 0) {
versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
}
}
var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
}
}
// MSN/WebTV 2.6 supports Flash 4
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
// WebTV 2.5 supports Flash 3
else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
// older WebTV supports Flash 2
else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
else if ( isIE && isWin && !isOpera ) {
flashVer = ControlVersion();
}
if(flashVer != -1) {
writeFlashTags(id);
}
return flashVer;
}
function writeFlashTags(id)
{
var swfFilename = "stats.swf";
var swfUrlWithGetParameters = swfFilename + "?id=" + id;
document.writeln("<div style=\"position:absolute; z-index:-1; top:0px; left:0px;\"><object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab\" width=\"1\" height=\"1\">");
document.writeln("<param name=\"movie\" value=\""+swfUrlWithGetParameters+"\" />");
document.writeln("<param name=\"quality\" value=\"low\" />");
document.writeln("<param name=\"allowScriptAccess\" value=\"always\" />");
document.writeln("<param name=\"allowNetworking\" value=\"true\" />");
document.writeln("<embed width=\"1\" height=\"1\" src=\""+swfUrlWithGetParameters+"\" ");
document.writeln("quality=\"low\" allowNetworking=\"true\" name=\""+swfFilename+"\" play=\"true\" loop=\"false\" ");
document.writeln("allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" ");
document.writeln("pluginspage=\"http://www.macromedia.com/go/getflashplayer\"> ");
document.writeln("</embed> </object></div>");
}
+142
View File
@@ -0,0 +1,142 @@
<?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><?php if($_SESSION['access'] == ADMIN){ echo 'Admin Control Panel - TravianX'; } else if($_SESSION['access'] == MULTIHUNTER){ echo 'Multihunter 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="http://forum.ragezone.com/f583/img/x.gif" width="1" height="1">
</div>
<img class="fl2" src="http://forum.ragezone.com/f583/img/admin/x1.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="http://forum.ragezone.com/f583/img/admin/x2.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="http://forum.ragezone.com/f583/img/admin/x3.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="http://forum.ragezone.com/f583/img/admin/x4.gif" width="70" height="100" border="0" onmouseover="this.className='fl1'" onmouseout="this.className='fl2'"><img class="fl2" src="http://forum.ragezone.com/f583/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="<?php echo HOMEPAGE; ?>"><img src="http://forum.ragezone.com/f583/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()){?>
<?php if($_SESSION['access'] == ADMIN){ ?>
<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=gold">Give Gold</a>
<a href="?p=natarstart">Add Natar Villages</a>
<a href="?p=natarend">Add World Wonder Villages</a>
<a href="?p=admin_log"><font color="Red"><b>Admin Log</font></b></a>
<a href="?p=config">Config</a>
<a href="#"></a><a href="#"></a><a href="#"></a>
<a href="?action=logout">Logout</a>
<?php } else if($_SESSION['access'] == MULTIHUNTER){ ?>
<a href="admin.php">MCP 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="#"></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{
include('../Templates/Admin/login.tpl');
}
?>
</div>
</div>
</div>
<div id="lright1"></div>
<div id="ce"></div>
</body>
</html>
+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.');
}
}
}
+226
View File
@@ -0,0 +1,226 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Account.php ##
## Developed by: 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']) || $_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']) || $_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'],$_POST['kid'],$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);
$this->generateBase($_POST['kid'],$uid,$_POST['name']);
header("Location: login.php");
}
}
}
}
private function Activate() {
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'],$dbarray['location'],"");
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");
}
}
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 {
setcookie("COOKUSR",$_POST['user'],time()+COOKIE_EXPIRE,COOKIE_PATH);
$database->UpdateOnline("login" ,$_POST['user'],time());
$session->login($_POST['user']);
}
}
private function Logout() {
global $session,$database;
unset($_SESSION['wid']);
$database->activeModify($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;
$database->updateUserField($uid,"location","",1);
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;
?>
+106
View File
@@ -0,0 +1,106 @@
<?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);
if ($session->access < ADMIN) die("Access Denied: You are not Admin!");
$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");
?>
+25
View File
@@ -0,0 +1,25 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename gold.php ##
## Developed by: Dzoki ##
## 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!");
$id = $_POST['id'];
$admid = $_POST['admid'];
mysql_query("UPDATE ".TB_PREFIX."users SET cp = cp + ".$_POST['cp']." WHERE id = ".$id."");
$name = $database->getUserField($id,"username",0);
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$admid,'Added ".$_POST['cp']." Cultural Points to user <a href=\'admin.php?p=player&uid=$id\'>$name</a> ',".time().")");
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."&cp=ok");
?>
+24
View File
@@ -0,0 +1,24 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.php ##
## Developed by: Dzoki ##
## 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!");
$id = $_POST['id'];
$user = $database->getUserArray($id,1);
mysql_query("UPDATE ".TB_PREFIX."users SET email = '".$_POST['email']."', tribe = ".$_POST['tribe'].", location = '".$_POST['location']."', desc1 = '".$_POST['desc1']."', `desc2` = '".$_POST['desc2']."' WHERE id = ".$_POST['id']."");
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,".$_SESSION['id'].",'Changed <a href=\'admin.php?p=village&did=$id\'>".$user['username']."</a>\'s profile',".time().")");
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."");
?>
+26
View File
@@ -0,0 +1,26 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename gold.php ##
## Developed by: Dzoki ##
## 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!");
$id = $_POST['id'];
$gold = $_POST['gold'];
$q = "UPDATE ".TB_PREFIX."users SET gold = gold + ".$_POST['gold']." WHERE id != '0'";
mysql_query($q);
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$id,'Added <b>$gold</b> gold to all users',".time().")");
header("Location: ../../../Admin/admin.php?p=gold&g");
?>
+25
View File
@@ -0,0 +1,25 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename gold_1.php ##
## Developed by: Dzoki ##
## 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!");
$id = $_POST['id'];
$admid = $_POST['admid'];
mysql_query("UPDATE ".TB_PREFIX."users SET gold = gold + ".$_POST['gold']." WHERE id = ".$id."");
$name = $database->getUserField($id,"username",0);
mysql_query("Insert into ".TB_PREFIX."admin_log values (0,$admid,'Added <b>".$_POST['gold']."</b> gold to user <a href=\'admin.php?p=player&uid=$id\'>$name</a> ',".time().")");
header("Location: ../../../Admin/admin.php?p=player&uid=".$id."&g=ok");
?>
+43
View File
@@ -0,0 +1,43 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename gold.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
include_once("../../Session.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!");
$id = $_POST['id'];
$amt = $_POST['vill_amount'];
for($i=1;$i<=$amt;$i++) {
$kid = rand(1,4);
$wid = $database->generateBase($kid);
$database->setFieldTaken($wid);
$time = time();
$q = "insert into `s1_vdata`(`wref`,`owner`,`name`,`capital`,`pop`,`cp`,`celebration`,`type`,`wood`,`clay`,`iron`,`maxstore`,`crop`,`maxcrop`,`lastupdate`,`loyalty`,`exp1`,`exp2`,`exp3`,`created`) values ('$wid','3','World Wonder',0,233,232,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,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,1,40,'World Wonder')";
mysql_query($q);
$database->addUnits($wid);
$database->addTech($wid);
$database->addABTech($wid);
$q = "UPDATE ".TB_PREFIX."units SET u41 = u41 + '150000', u42 = u42 + '150000', u43 = u43 + '150000', u44 = u44 + '150000', u45 = u45 + '150000', u46 = u46 + '150000', u47 = u47 + '150000', u48 = u48 + '150000' , u49 = u49 + '150000', u50 = u50 + '150000' 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");
?>
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8" ?>
<dwsync>
<file name="userCount.php" server="D:/wamp/www/New/" local="129157402737451172" remote="129157402730000000" />
</dwsync>
+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.');
}
}
}
+309
View File
@@ -0,0 +1,309 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename database.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
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);
}
}
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 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 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 = 1;";
$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 and capital = 1;";
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 = $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 = $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 = $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 && isset($_SESSION['id'])){
return true;
}else{
return false;
}
}
function Act($get){
global $admin,$database;
switch($get['action']){
case recountPop:
$admin->recountPop($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(preg_match("/^[0-9]+$/",$get['uid'])){
//if(eregi("^[0-9]*+$",$get['uid'])){
$get['uid'] = $get['uid'];
}else{
$get['uid'] = $database->getUserField($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.
TravianX Team
+370
View File
@@ -0,0 +1,370 @@
<?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;
// ¿El campo posee informacion?
if(!isset($post['a_name']) || $post['a_name'] == "") {
$form->addError("name1", NAME_EMPTY);
}
// ¿Existe el usuario?
if(!$database->checkExist($post['a_name'], 0)) {
$form->addError("name2", NAME_NO_EXIST);
}
// ¿La invitacion es a si mismo?
if($post['a_name'] == ($session->username)) {
$form->addError("name3", SAME_NAME);
}
// ¿Esta ya invitado a la alianza?
$UserData = $database->getUserArray($post['a_name'], 0);
if($database->getInvitation($UserData['id'])) {
$form->addError("name4", OLRADY_INVITED);
}
// ¿Esta ya en la alianza?
$UserData = $database->getUserArray($post['a_name'], 0);
if($UserData['alliance'] == $session->alliance) {
$form->addError("name5", OLRADY_IN_ALLY);
}
// ¿La invitación la envia un autorizado?
if($this->userPermArray['opt4'] == 0) {
$form->addError("perm", NO_PERMISSION);
}
if($form->returnErrors() != 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $post;
print_r($form->getErrors());
} 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 . '">' . $session->username . '</a> has invited <a href="spieler.php?uid=' . $UserData['id'] . '">' . $UserData['username'] . '</a> into the alliance.');
}
}
/*****************************************
Function to reject an invitation
*****************************************/
private function rejectInvite($get) {
global $database, $session;
foreach($this->inviteArray as $invite) {
if($invite['id'] == $get['d']) {
$database->removeInvitation($get['d']);
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . $session->username . '</a> has deleted an invitation.');
}
}
//header("Location: build.php?id=".$get['id']);
}
/*****************************************
Function to del an invitation
*****************************************/
private function delInvite($get) {
global $database, $session;
$inviteArray = $database->getAliInvitations($session->alliance);
foreach($inviteArray as $invite) {
if($invite['id'] == $get['d']) {
$database->removeInvitation($get['d']);
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . $session->username . '</a> has deleted an invitation.');
}
}
//header("Location: build.php?id=".$get['id']);
}
/*****************************************
Function to accept an invitation
*****************************************/
private function acceptInvite($get) {
global $database, $session;
foreach($this->inviteArray as $invite) {
if($invite['id'] == $get['d']) {
$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 . '">' . $session->username . '</a> has joined the alliance.');
}
}
header("Location: build.php?id=" . $get['id']);
}
/*****************************************
Function to create an alliance
*****************************************/
private function createAlliance($post) {
global $form, $database, $session, $bid18, $village;
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);
// 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($session->alliance, 'The alliance has been founded by <a href="spieler.php?uid=' . $session->uid . '">' . $session->username . '</a>');
header("Location: build.php?id=" . $post['id']);
}
}
/*****************************************
Function to change the alliance name
*****************************************/
private function changeAliName($get) {
global $form, $database, $session;
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 . '">' . $session->username . '</a> has changed the alliance name.');
}
}
/*****************************************
Function to create/change the alliance description
*****************************************/
private function updateAlliProfile($post) {
global $database, $session, $form;
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), $database->RemoveXSS($post['be2']), $database->RemoveXSS($post['be1']));
// log the notice
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . $session->username . '</a> has changed the alliance description');
}
}
/*****************************************
Function to change the user permissions
*****************************************/
private function changeUserPermissions($post) {
global $database, $session, $form;
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 . '">' . $session->username . '</a> has changed permissions.');
}
}
/*****************************************
Function to kick a user from alliance
*****************************************/
private function kickAlliUser($post) {
global $database, $session, $form;
if($this->userPermArray['opt2'] == 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->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=' . $session->uid . '">' . $session->username . '</a> kicked <a href="spieler.php?uid=' . $post['a_user'] . '">' . $UserData['username'] . '</a>.');
//header("Location: build.php?id=".$post['id']);
}
}
/*****************************************
Function to quit from alliance
*****************************************/
private function quitally($post) {
global $database, $session, $form;
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);
$database->deleteAlliPermissions($session->uid);
// log the notice
$database->deleteAlliance($session->alliance);
$database->insertAlliNotice($session->alliance, '<a href="spieler.php?uid=' . $session->uid . '">' . $session->username . '</a> has quit the alliance');
header("Location: dorf1.php");
}
}
private function changediplomacy($post) {
global $database, $session, $form;
$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->diplomacyInviteCheck($database->getAllianceID($aName), $session->alliance)) {
$database->diplomacyInviteAdd($session->alliance, $database->getAllianceID($aName), $aType);
$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");
}
}
}
$alliance = new Alliance;
?>
File diff suppressed because it is too large Load Diff
+183
View File
@@ -0,0 +1,183 @@
<?php
$pattern= array();
$pattern[0] = "/\[b\](.*?)\[\/b\]/is";
$pattern[1] = "/\[i\](.*?)\[\/i\]/is";
$pattern[2] = "/\[u\](.*?)\[\/u\]/is";
$pattern[3] = "/\[tid1\]/";
$pattern[4] = "/\[tid2\]/";
$pattern[5] = "/\[tid3\]/";
$pattern[6] = "/\[tid4\]/";
$pattern[7] = "/\[tid5\]/";
$pattern[8] = "/\[tid6\]/";
$pattern[9] = "/\[tid7\]/";
$pattern[10] = "/\[tid8\]/";
$pattern[11] = "/\[tid9\]/";
$pattern[12] = "/\[tid10\]/";
$pattern[13] = "/\[tid11\]/";
$pattern[14] = "/\[tid12\]/";
$pattern[15] = "/\[tid13\]/";
$pattern[16] = "/\[tid14\]/";
$pattern[17] = "/\[tid15\]/";
$pattern[18] = "/\[tid16\]/";
$pattern[19] = "/\[tid17\]/";
$pattern[20] = "/\[tid18\]/";
$pattern[21] = "/\[tid19\]/";
$pattern[22] = "/\[tid20\]/";
$pattern[23] = "/\[tid21\]/";
$pattern[24] = "/\[tid22\]/";
$pattern[25] = "/\[tid23\]/";
$pattern[26] = "/\[tid24\]/";
$pattern[27] = "/\[tid25\]/";
$pattern[28] = "/\[tid26\]/";
$pattern[29] = "/\[tid27\]/";
$pattern[30] = "/\[tid28\]/";
$pattern[31] = "/\[tid29\]/";
$pattern[32] = "/\[tid30\]/";
$pattern[33] = "/\[tid31\]/";
$pattern[34] = "/\[tid32\]/";
$pattern[35] = "/\[tid33\]/";
$pattern[36] = "/\[tid34\]/";
$pattern[37] = "/\[tid35\]/";
$pattern[38] = "/\[tid36\]/";
$pattern[39] = "/\[tid37\]/";
$pattern[40] = "/\[tid38\]/";
$pattern[41] = "/\[tid39\]/";
$pattern[42] = "/\[tid40\]/";
$pattern[43] = "/\[tid41\]/";
$pattern[44] = "/\[tid42\]/";
$pattern[45] = "/\[tid43\]/";
$pattern[46] = "/\[tid44\]/";
$pattern[47] = "/\[tid45\]/";
$pattern[48] = "/\[tid46\]/";
$pattern[49] = "/\[tid47\]/";
$pattern[50] = "/\[tid48\]/";
$pattern[51] = "/\[tid49\]/";
$pattern[52] = "/\[tid50\]/";
$pattern[53] = "/\[hero\]/";
$pattern[54] = "/\[lumber\]/";
$pattern[55] = "/\[clay\]/";
$pattern[56] = "/\[iron\]/";
$pattern[57] = "/\[crop\]/";
$pattern[58] = "/\*aha\*/";
$pattern[59] = "/\*angry\*/";
$pattern[60] = "/\*cool\*/";
$pattern[61] = "/\*cry\*/";
$pattern[62] = "/\*cute\*/";
$pattern[63] = "/\*depressed\*/";
$pattern[64] = "/\*eek\*/";
$pattern[65] = "/\*ehem\*/";
$pattern[66] = "/\*emotional\*/";
$pattern[67] = "/\:D/";
$pattern[68] = "/\:\)/";
$pattern[69] = "/\*hit\*/";
$pattern[70] = "/\*hmm\*/";
$pattern[71] = "/\*hmpf\*/";
$pattern[72] = "/\*hrhr\*/";
$pattern[73] = "/\*huh\*/";
$pattern[74] = "/\*lazy\*/";
$pattern[75] = "/\*love\*/";
$pattern[76] = "/\*nocomment\*/";
$pattern[77] = "/\*noemotion\*/";
$pattern[78] = "/\*notamused\*/";
$pattern[79] = "/\*pout\*/";
$pattern[80] = "/\*redface\*/";
$pattern[81] = "/\*rolleyes\*/";
$pattern[82] = "/\:\(/";
$pattern[83] = "/\*shy\*/";
$pattern[84] = "/\*smile\*/";
$pattern[85] = "/\*tongue\*/";
$pattern[86] = "/\*veryangry\*/";
$pattern[87] = "/\*veryhappy\*/";
$pattern[88] = "/\;\)/";
$replace= array();
$replace[0] = "<b>$1</b>";
$replace[1] = "<i>$1</i>";
$replace[2] = "<u>$1</u>";
$replace[3] = "<img class='unit u1' src='img/x.gif' title='Legionnaire' alt='Legionnaire'>";
$replace[4] = "<img class='unit u2' src='img/x.gif' title='Praetorian' alt='Praetorian'>";
$replace[5] = "<img class='unit u3' src='img/x.gif' title='Imperian' alt='Imperian'>";
$replace[6] = "<img class='unit u4' src='img/x.gif' title='Equites Legati' alt='Equites Legati'>";
$replace[7] = "<img class='unit u5' src='img/x.gif' title='Equites Imperatoris' alt='Equites Imperatoris'>";
$replace[8] = "<img class='unit u6' src='img/x.gif' title='Equites Caesaris' alt='Equites Caesaris'>";
$replace[9] = "<img class='unit u7' src='img/x.gif' title='Battering Ram' alt='Battering Ram'>";
$replace[10] = "<img class='unit u8' src='img/x.gif' title='Fire Catapult' alt='Fire Catapult'>";
$replace[11] = "<img class='unit u9' src='img/x.gif' title='Senator' alt='Senator'>";
$replace[12] = "<img class='unit u10' src='img/x.gif' title='Settler' alt='Settler'>";
$replace[13] = "<img class='unit u11' src='img/x.gif' title='Clubswinger' alt='Clubswinger'>";
$replace[14] = "<img class='unit u12' src='img/x.gif' title='Spearman' alt='Spearman'>";
$replace[15] = "<img class='unit u13' src='img/x.gif' title='Axeman' alt='Axeman'>";
$replace[16] = "<img class='unit u14' src='img/x.gif' title='Scout' alt='Scout'>";
$replace[17] = "<img class='unit u15' src='img/x.gif' title='Paladin' alt='Paladin'>";
$replace[18] = "<img class='unit u16' src='img/x.gif' title='Teutonic Knight' alt='Teutonic Knight'>";
$replace[19] = "<img class='unit u17' src='img/x.gif' title='Ram' alt='Ram'>";
$replace[20] = "<img class='unit u18' src='img/x.gif' title='Catapult' alt='Catapult'>";
$replace[21] = "<img class='unit u19' src='img/x.gif' title='Chief' alt='Chief'>";
$replace[22] = "<img class='unit u20' src='img/x.gif' title='Settler' alt='Settler'>";
$replace[23] = "<img class='unit u21' src='img/x.gif' title='Phalanx' alt='Phalanx'>";
$replace[24] = "<img class='unit u22' src='img/x.gif' title='Swordsman' alt='Swordsman'>";
$replace[25] = "<img class='unit u23' src='img/x.gif' title='Pathfinder' alt='Pathfinder'>";
$replace[26] = "<img class='unit u24' src='img/x.gif' title='Theutates Thunder' alt='Theutates Thunder'>";
$replace[27] = "<img class='unit u25' src='img/x.gif' title='Druidrider' alt='Druidrider'>";
$replace[28] = "<img class='unit u26' src='img/x.gif' title='Haeduan' alt='Haeduan'>";
$replace[29] = "<img class='unit u27' src='img/x.gif' title='Ram' alt='Ram'>";
$replace[30] = "<img class='unit u28' src='img/x.gif' title='Trebuchet' alt='Trebuchet'>";
$replace[31] = "<img class='unit u29' src='img/x.gif' title='Chieftain' alt='Chieftain'>";
$replace[32] = "<img class='unit u30' src='img/x.gif' title='Settler' alt='Settler'>";
$replace[33] = "<img class='unit u31' src='img/x.gif' title='Rat' alt='Rat'>";
$replace[34] = "<img class='unit u32' src='img/x.gif' title='Spider' alt='Spider'>";
$replace[35] = "<img class='unit u33' src='img/x.gif' title='Snake' alt='Snake'>";
$replace[36] = "<img class='unit u34' src='img/x.gif' title='Bat' alt='Bat'>";
$replace[37] = "<img class='unit u35' src='img/x.gif' title='Wild Boar' alt='Wild Boar'>";
$replace[38] = "<img class='unit u36' src='img/x.gif' title='Wolf' alt='Wolf'>";
$replace[39] = "<img class='unit u37' src='img/x.gif' title='Bear' alt='Bear'>";
$replace[40] = "<img class='unit u38' src='img/x.gif' title='Crocodile' alt='Crocodile'>";
$replace[41] = "<img class='unit u39' src='img/x.gif' title='Tiger' alt='Tiger'>";
$replace[42] = "<img class='unit u40' src='img/x.gif' title='Elephant' alt='Elephant'>";
$replace[43] = "<img class='unit u41' src='img/x.gif' title='Pikeman' alt='Pikeman'>";
$replace[44] = "<img class='unit u42' src='img/x.gif' title='Thorned Warrior' alt='Thorned Warrior'>";
$replace[45] = "<img class='unit u43' src='img/x.gif' title='Guardsman' alt='Guardsman'>";
$replace[46] = "<img class='unit u44' src='img/x.gif' title='Birds Of Prey' alt='Birds Of Prey'>";
$replace[47] = "<img class='unit u45' src='img/x.gif' title='Axerider' alt='Axerider'>";
$replace[48] = "<img class='unit u46' src='img/x.gif' title='Natarian Knight' alt='Natarian Knight'>";
$replace[49] = "<img class='unit u47' src='img/x.gif' title='War Elephant' alt='War Elephant'>";
$replace[50] = "<img class='unit u48' src='img/x.gif' title='Ballista' alt='Ballista'>";
$replace[51] = "<img class='unit u49' src='img/x.gif' title='Natarian Emperor' alt='Natarian Emperor'>";
$replace[52] = "<img class='unit u50' src='img/x.gif' title='Settler' alt='Settler'>";
$replace[53] = "<img class='unit uhero' src='img/x.gif' title='Hero' alt='Hero'>";
$replace[54] = "<img src='img/x.gif' class='r1' title='Lumber' alt='Lumber'>";
$replace[55] = "<img src='img/x.gif' class='r2' title='Clay' alt='Clay'>";
$replace[56] = "<img src='img/x.gif' class='r3' title='Iron' alt='Iron'>";
$replace[57] = "<img src='img/x.gif' class='r4' title='Crop' alt='Crop'>";
$replace[58] = "<img class='smiley aha' src='img/x.gif' alt='*aha*' title='*aha*'>";
$replace[59] = "<img class='smiley angry' src='img/x.gif' alt='*angry*' title='*angry*'>";
$replace[60] = "<img class='smiley cool' src='img/x.gif' alt='*cool*' title='*cool*'>";
$replace[61] = "<img class='smiley cry' src='img/x.gif' alt='*cry*' title='*cry*'>";
$replace[62] = "<img class='smiley cute' src='img/x.gif' alt='*cute*' title='*cute*'>";
$replace[63] = "<img class='smiley depressed' src='img/x.gif' alt='*depressed*' title='*depressed*'>";
$replace[64] = "<img class='smiley eek' src='img/x.gif' alt='*eek*' title='*eek*'>";
$replace[65] = "<img class='smiley ehem' src='img/x.gif' alt='*ehem*' title='*ehem*'>";
$replace[66] = "<img class='smiley emotional' src='img/x.gif' alt='*emotional*' title='*emotional*'>";
$replace[67] = "<img class='smiley grin' src='img/x.gif' alt=':D' title=':D'>";
$replace[68] = "<img class='smiley happy' src='img/x.gif' alt=':)' title=':)'>";
$replace[69] = "<img class='smiley hit' src='img/x.gif' alt='*hit*' title='*hit*'>";
$replace[70] = "<img class='smiley hmm' src='img/x.gif' alt='*hmm*' title='*hmm*'>";
$replace[71] = "<img class='smiley hmpf' src='img/x.gif' alt='*hmpf*' title='*hmpf*'>";
$replace[72] = "<img class='smiley hrhr' src='img/x.gif' alt='*hrhr*' title='*hrhr*'>";
$replace[73] = "<img class='smiley huh' src='img/x.gif' alt='*huh*' title='*huh*'>";
$replace[74] = "<img class='smiley lazy' src='img/x.gif' alt='*lazy*' title='*lazy*'>";
$replace[75] = "<img class='smiley love' src='img/x.gif' alt='*love*' title='*love*'>";
$replace[76] = "<img class='smiley nocomment' src='img/x.gif' alt='*nocomment*' title='*nocomment*'>";
$replace[77] = "<img class='smiley noemotion' src='img/x.gif' alt='*noemotion*' title='*noemotion*'>";
$replace[78] = "<img class='smiley notamused' src='img/x.gif' alt='*notamused*' title='*notamused*'>";
$replace[79] = "<img class='smiley pout' src='img/x.gif' alt='*pout*' title='*pout*'>";
$replace[80] = "<img class='smiley redface' src='img/x.gif' alt='*redface*' title='*redface*'>";
$replace[81] = "<img class='smiley rolleyes' src='img/x.gif' alt='*rolleyes*' title='*rolleyes*'>";
$replace[82] = "<img class='smiley sad' src='img/x.gif' alt=':(' title=':('>";
$replace[83] = "<img class='smiley shy' src='img/x.gif' alt='*shy*' title='*shy*'>";
$replace[84] = "<img class='smiley smile' src='img/x.gif' alt='*smile*' title='*smile*'>";
$replace[85] = "<img class='smiley tongue' src='img/x.gif' alt='*tongue*' title='*tongue*'>";
$replace[86] = "<img class='smiley veryangry' src='img/x.gif' alt='*veryangry*' title='*veryangry*'>";
$replace[87] = "<img class='smiley veryhappy' src='img/x.gif' alt='*veryhappy*' title='*veryhappy*'>";
$replace[88] = "<img class='smiley wink' src='img/x.gif' alt=';)' title=';)'>";
+850
View File
@@ -0,0 +1,850 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Battle.php ##
## Developed by: Dzoki & Dixie Reworked buy Advocaite love it or hate it ##
## Thanks to: Akakori & Elmar ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
class Battle {
public function procSim($post) {
global $form;
// Recivimos el formulario y procesamos
if(isset($post['a1_v']) && (isset($post['a2_v1']) || isset($post['a2_v2']) || isset($post['a2_v3']) || isset($post['a2_v4']))) {
$_POST['mytribe'] = $post['a1_v'];
$target = array();
if(isset($post['a2_v1'])) {
array_push($target,1);
}
if(isset($post['a2_v2'])) {
array_push($target,2);
}
if(isset($post['a2_v3'])) {
array_push($target,3);
}
if(isset($post['a2_v4'])) {
array_push($target,4);
}
if(isset($post['a2_v5'])) {
array_push($target,5);
}
$_POST['target'] = $target;
if(isset($post['a1_1'])) {
$sum = $sum2 = 0;
for($i=1;$i<=10;$i++) {
$sum += $post['a1_'.$i];
}
if($sum > 0) {
if($post['palast'] == "") {
$post['palast'] = 0;
}
if(isset($post['wall1']) && $post['wall1'] == "") {
$post['wall1'] = 0;
}
if(isset($post['wall2']) && $post['wall2'] == "") {
$post['wall2'] = 0;
}
if(isset($post['wall3']) && $post['wall3'] == "") {
$post['wall3'] = 0;
}if(isset($post['wall4']) && $post['wall4'] == "") {
$post['wall4'] = 0;
}if(isset($post['wall5']) && $post['wall5'] == "") {
$post['wall5'] = 0;
}
$post['tribe'] = $target[0];
$_POST['result'] = $this->simulate($post);
$form->valuearray = $post;
}
}
}
}
private function getBattleHero($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['health']);
}
private function simulate($post) {
// Establecemos los arrays con las unidades del atacante y defensor
$attacker = array('u1'=>0,'u2'=>0,'u3'=>0,'u4'=>0,'u5'=>0,'u6'=>0,'u7'=>0,'u8'=>0,'u9'=>0,'u10'=>0,'u11'=>0,'u12'=>0,'u13'=>0,'u14'=>0,'u15'=>0,'u16'=>0,'u17'=>0,'u18'=>0,'u19'=>0,'u20'=>0,'u21'=>0,'u22'=>0,'u23'=>0,'u24'=>0,'u25'=>0,'u26'=>0,'u27'=>0,'u28'=>0,'u29'=>0,'u30'=>0,'u31'=>0,'u32'=>0,'u33'=>0,'u34'=>0,'u35'=>0,'u36'=>0,'u37'=>0,'u38'=>0,'u39'=>0,'u40'=>0,'u41'=>0,'u42'=>0,'u43'=>0,'u44'=>0,'u45'=>0,'u46'=>0,'u47'=>0,'u48'=>0,'u49'=>0,'u50'=>0);
$start = ($post['a1_v']-1)*10+1;
$att_ab = array('a1'=>0,'a2'=>0,'a3'=>0,'a4'=>0,'a5'=>0,'a6'=>0,'a7'=>0,'a8'=>0);
$def_ab = array('b1'=>0,'b2'=>0,'b3'=>0,'b4'=>0,'b5'=>0,'b6'=>0,'b7'=>0,'b8'=>0);
$index = 1;
for($i=$start;$i<=($start+9);$i++) {
$attacker['u'.$i] = $post['a1_'.$index];
if($index <=8) {
$att_ab['a'.$index] = $post['f1_'.$index];
}
$index += 1;
}
$defender = array();
for($i=1;$i<=50;$i++) {
if(isset($post['a2_'.$i]) && $post['a2_'.$i] != "") {
$defender['u'.$i] = $post['a2_'.$i];
}
else {
$defender['u'.$i] = 0;
}
}
$deftribe = $post['tribe'];
$wall = 0;
switch($deftribe) {
case 1:
for($i=1;$i<=8;$i++) {
$def_ab['b'.$i] = $post['f2_'.$i];
}
$wall = $post['wall1'];
break;
case 2:
for($i=11;$i<=18;$i++) {
$def_ab['b'.$i] = $post['f2_'.$i];
}
$wall = $post['wall2'];
break;
case 3:
for($i=21;$i<=28;$i++) {
$def_ab['b'.$i] = $post['f2_'.$i];
}
$wall = $post['wall3'];
break;
case 4:
for($i=31;$i<=38;$i++) {
$def_ab['b'.$i] = $post['f2_'.$i];
}
$wall = $post['wall4'];
break;
case 5:
for($i=41;$i<=48;$i++) {
$def_ab['b'.$i] = $post['f2_'.$i];
}
$wall = $post['wall5'];
break;
}
if($post['kata'] == "") {
$post['kata'] = 0;
}
// check scout
$scout = 1;
for($i=$start;$i<=($start+9);$i++) {
if($i == 4 || $i == 14 || $i == 23 || $i == 34 || $i == 44)
{}
else{
if($attacker['u'.$i]>0) {
$scout = 0;
break;
}
}
}
if(!$scout)
return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],$post['ktyp']+3,$def_ab,$att_ab,$post['kata'],1);
else
return $this->calculateBattle($attacker,$defender,$wall,$post['a1_v'],$deftribe,$post['palast'],$post['ew1'],$post['ew2'],1,$def_ab,$att_ab,$post['kata'],1);
}
//1 raid 0 normal
function calculateBattle($Attacker,$Defender,$def_wall,$att_tribe,$def_tribe,$residence,$attpop,$defpop,$type,$def_ab,$att_ab,$tblevel,$stonemason,$walllevel) {
global $bid34;
// Definieer de array met de eenheden
$calvary = array(4,5,6,15,16,23,24,25,26,35,36,45,46);
$catapult = array(8,18,28,38,48);
$rams = array(7,17,27,37,47);
$catp = $ram = 0;
// Array om terug te keren met het resultaat van de berekening
$result = array();
$involve = 0;
$winner = false;
// bij 0 alle deelresultaten
$cap = $ap = $dp = $cdp = $rap = $rdp = 0;
//exit($type);
if ($Attacker['uhero'] != 0)
{
//exit($Attacker['id']);
$atkhero= $this->getBattleHero($Attacker['id']);
}
if ($Defender['uhero'] != 0)
{
//exit($Defender['id']);
$defhero= $this->getBattleHero($Defender['id']);
}
// Berekenen het totaal aantal punten van Aanvaller
$start = ($att_tribe-1)*10+1;
$end = ($att_tribe*10);
$abcount = 1;
if($type == 1)
{
for($i=$start;$i<=$end;$i++) {
global ${'u'.$i};
if($abcount <= 8 && $att_ab['a'.$abcount] > 0) {
$ap += (35 + ( 35 + 300 * ${'u'.$i}['pop'] / 7) * (pow(1.007, $att_ab['a'.$abcount]) - 1)) * $Attacker['u'.$i];
}
else {
$ap += $Attacker['u'.$i] * 35;
}
$abcount +=1;
$units['Att_unit'][$i] = $Attacker['u'.$i];
}
if ($Attacker['uhero'] != 0){
$ap += $atkhero['atk'] * 35;
$ap = $ap * $atkhero['ob'];
}
}
else
{
for($i=$start;$i<=$end;$i++) {
global ${'u'.$i};
if($abcount <= 8 && $att_ab['a'.$abcount] > 0) {
if(in_array($i,$calvary)) {
$cap += (${'u'.$i}['atk'] + (${'u'.$i}['atk'] + 300 * ${'u'.$i}['pop'] / 7) * (pow(1.007, $att_ab['a'.$abcount]) - 1)) * $Attacker['u'.$i];
}
else {
$ap += (${'u'.$i}['atk'] + (${'u'.$i}['atk'] + 300 * ${'u'.$i}['pop'] / 7) * (pow(1.007, $att_ab['a'.$abcount]) - 1)) * $Attacker['u'.$i];
}
}
else {
if(in_array($i,$calvary)) {
$cap += $Attacker['u'.$i]*${'u'.$i}['atk'];
}
else {
$ap += $Attacker['u'.$i]*${'u'.$i}['atk'];
}
}
$abcount +=1;
// Punten van de catavult van de aanvaller
if(in_array($i,$catapult)) {
$catp += $Attacker['u'.$i];
}
// Punten van de Rammen van de aanvaller
if(in_array($i,$rams))
{
$ram += $Attacker['u'.$i];
}
$involve += $Attacker['u'.$i];
$units['Att_unit'][$i] = $Attacker['u'.$i];
}
if ($Attacker['uhero'] != 0)
{
$units['Att_unit']['hero'] = $Attacker['uhero'];
$cap += $Attacker['uhero']*$atkhero['atk'];
$ap += $Attacker['uhero']*$atkhero['atk'];
$ap = $ap * $atkhero['ob'];
$cap = $cap * $atkhero['ob'];
}
}
//
// Berekent het totaal aantal punten van de Defender
//
$start = ($def_tribe-1)*10+1;
$end = ($def_tribe*10);
$abcount = 1;
if($type == 1)
{
for($y=4;$y<=44;$y++) {
if($y == 4 || $y == 14 || $y == 23 || $y == 34 || $y == 44)
{
global ${'u'.$y};
if($y >= $start && $y <= ($end-2) && $def_ab['b'.$abcount] > 0) {
$dp += (20 + (20 + 300 * ${'u'.$y}['pop'] / 7) * (pow(1.007, $def_ab['b'.$y]) - 1)) * $Defender['u'.$y];
$abcount +=1;
}
else {
$dp += $Defender['u'.$y]*20;
}
$units['Def_unit'][$y] = $Defender['u'.$y];
}
if ($Defender['uhero'] != 0){
$dp += $defhero['di'] * 35;
$dp = $dp * $defhero['db'];
}
}
}
else
{
for($y=1;$y<=50;$y++) {
global ${'u'.$y};
if($y >= $start && $y <= ($end-2) && $def_ab['b'.$abcount] > 0) {
$dp += (${'u'.$y}['di'] + (${'u'.$y}['di'] + 300 * ${'u'.$y}['pop'] / 7) * (pow(1.007, $def_ab['b'.$y]) - 1)) * $Defender['u'.$y];
$cdp += (${'u'.$y}['dc'] + (${'u'.$y}['dc'] + 300 * ${'u'.$y}['pop'] / 7) * (pow(1.007, $def_ab['b'.$y]) - 1)) * $Defender['u'.$y];
$abcount +=1;
}
else {
$dp += $Defender['u'.$y]*${'u'.$y}['di'];
$cdp += $Defender['u'.$y]*${'u'.$y}['dc'];
}
$involve += $Defender['u'.$y];
$units['Def_unit'][$y] = $Defender['u'.$y];
}
if ($Defender['uhero'] != 0)
{
$units['Def_unit']['hero'] = $Defender['uhero'];
$cdp += $Defender['uhero']*$defhero['dc'];
$dp += $Defender['uhero']*$defhero['di'];
$dp = $dp * $defhero['db'];
$cdp = $cdp * $defhero['db'];
}
}
//
// Formule voor de berekening van de bonus verdedigingsmuur "en" Residence ";
//
if($def_wall > 0) {
// Stel de factor berekening voor de "Muur" als het type van de beschaving
// Factor = 1030 Romeinse muur
// Factor = 1020 Wall Germanen
// Factor = 1025 Wall Galliers
$factor = ($def_tribe == 1)? 1.030 : (($def_tribe == 2)? 1.020 : 1.025);
// Defense Infanterie = infanterie * Muur (%)
$dp *= pow($factor,$def_wall);
// Defensa Cavelerie = Cavelerie * Muur (%)
$cdp *= pow($factor,$def_wall);
// Berekening van de Basic defence bonus "Residence"
$dp += ((2*(pow($residence,2)))*(pow($factor,$def_wall)));
$cdp += ((2*(pow($residence,2)))*(pow($factor,$def_wall)));
}
else
{
// Berekening van de Basic defence bonus "Residence"
$dp += (2*(pow($residence,2)));
$cdp += (2*(pow($residence,2)));
}
//
// Formule voor het berekenen van punten aanvallers (Infanterie & Cavalry)
//
$rap = $ap+$cap;
//
// Formule voor de berekening van Defensive Punten
//
if ($rap==0)
$rdp = ($dp) + ($cdp) + 10;
else
$rdp = ($dp * ($ap/$rap)) + ($cdp * ($cap/$rap)) + 10;
//
// En de Winnaar is....:
//
$result['Attack_points'] = $rap;
$result['Defend_points'] = $rdp;
$winner = ($rap > $rdp);
$result['Winner'] = ($winner)? "attacker" : "defender";
// Formule voor de berekening van de Moraal
if($attpop > $defpop) {
if ($rap < $rdp) {
$moralbonus = min(1.5, pow($attpop / $defpop, (0.2*($rap/$rdp))));
}
else {
$moralbonus = min(1.5, pow($attpop / $defpop, 0.2));
}
}
else {
$moralbonus = 1.0;
}
if($involve >= 1000) {
$Mfactor = round(2*(1.8592-pow($involve,0.015)),4);
}
else {
$Mfactor = 1.5;
}
// Formule voor het berekenen verloren drives
// $type = 1 Raid, 0 Normal
if($type == 1)
{
$holder = pow((($rdp*$moralbonus)/$rap),$Mfactor);
$holder = $holder / (1 + $holder);
// Attacker
$result[1] = $holder;
// Defender
$result[2] = 0;
}
else if($type == 2)
{
}
else if($type == 4) {
$holder = ($winner) ? pow((($rdp*$moralbonus)/$rap),$Mfactor) : pow(($rap/($rdp*$moralbonus)),$Mfactor);
$holder = $holder / (1 + $holder);
// Attacker
$result[1] = $winner ? $holder : 1 - $holder;
// Defender
$result[2] = $winner ? 1 - $holder : $holder;
$ram -= round($ram*$result[1]/100);
$catp -= round($catp*$result[1]/100);
}
else if($type == 3)
{
// Attacker
$result[1] = ($winner)? pow((($rdp*$moralbonus)/$rap),$Mfactor) : 1;
$result[1] = round($result[1],8);
// Defender
$result[2] = (!$winner)? pow(($rap/($rdp*$moralbonus)),$Mfactor) : 1;
$result[2] = round($result[2],8);
// Als aangevallen met "Hero"
$ku = ($att_tribe-1)*10+9;
$kings = $Attacker['u'.$ku];
$aviables= $kings-round($kings*$result[1]);
if ($aviables>0){
switch($aviables){
case 1:
$fealthy = rand(20,30);
break;
case 2:
$fealthy = rand(40,60);
break;
case 3:
$fealthy = rand(60,80);
break;
case 4:
$fealthy = rand(80,100);
break;
default:
$fealthy = 100;
break;
}
$result['hero_fealthy'] = $fealthy;
}
$ram -= ($winner)? round($ram*$result[1]/100) : round($ram*$result[2]/100);
$catp -= ($winner)? round($catp*$result[1]/100) : round($catp*$result[2]/100);
}
// Formule voor de berekening van katapulten nodig
if($catp > 0 && $tblevel != 0) {
$wctp = pow(($rap/$rdp),1.5);
$wctp = ($wctp >= 1)? 1-0.5/$wctp : 0.5*$wctp;
$wctp *= $catp;
$need = round((($moralbonus * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a8']))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
// Aantal katapulten om het gebouw neer te halen
$result[3] = $need;
// Aantal Katapulten die handeling
$result[4] = $wctp;
$result[5] = $moralbonus;
$result[6] = $att_ab['a8'];
}
if($ram > 0 && $walllevel != 0) {
$wctp = pow(($rap/$rdp),1.5);
$wctp = ($wctp >= 1)? 1-0.5/$wctp : 0.5*$wctp;
$wctp *= $ram;
$need = round((($moralbonus * (pow($walllevel,2) + $walllevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a7']))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
// Aantal katapulten om het gebouw neer te halen
$result[7] = $need;
// Aantal Katapulten die handeling
$result[8] = $wctp;
}
$result[6] = pow($rap/$rdp*$moralbonus,$Mfactor);
$total_att_units = count($units['Att_unit']);
$start = intval(($att_tribe-1)*10+1);
$end = intval(($att_tribe*10));
//exit($start."|".$end."|".$att_tribe);
//$y=1;
for($i=$start;$i <= $end;$i++)
{
$y = $i-(($att_tribe-1)*10);
//exit(intval("$y"));
$result['casualties_attacker'][$y] = round($result[1]*$units['Att_unit'][$i]);
//$y++;
//exit($result['casualties_attacker'][$y]);
}
//$result['casualties_attacker']['11'] = 0;
//exit($result['casualties_attacker']['2']);
//$_hero=11;
if ($units['Att_unit']['hero']>0)
{
$_result=mysql_query("select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$atkhero['heroid']."'");
$fdb = mysql_fetch_array($_result);
$hero_id=$fdb['heroid'];
$hero_health=$fdb['health'];
$damage_health=round(100*$result[1]);
//exit($damage_health."|".$hero_health."|".$atkhero['heroid']);
if ($hero_health<=$damage_health)
{
//hero die
$result['casualties_attacker']['11'] = 1;
mysql_query("update " . TB_PREFIX . "hero set `dead`='1' where `heroid`='".$hero_id."'");
}
else
{
mysql_query("update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
}
}
//exit($result['casualties_attacker']['11']);
//$result['casualties_attacker'][11] = round($result[1]*$units['Att_unit']['hero']);
//$result['casualties_defender']['11'] = 0;
//exit($result['casualties_defender']['2']);
//$_hero=11;
if ($units['Def_unit']['hero']>0)
{
$_result=mysql_query("select * from " . TB_PREFIX . "hero where `dead`='0' and `heroid`='".$defhero['heroid']."'");
$fdb = mysql_fetch_array($_result);
$hero_id=$fdb['heroid'];
$hero_health=$fdb['health'];
$damage_health=round(100*$result[1]);
//exit($damage_health."|".$hero_health."|".$defhero['heroid']);
if ($hero_health<=$damage_health)
{
//hero die
$result['casualties_defender']['11'] = 1;
mysql_query("update " . TB_PREFIX . "hero set `dead`='1' where `heroid`='".$hero_id."'");
mysql_query("update " . TB_PREFIX . "hero set `health`='0' where `heroid`='".$hero_id."'");
}
else
{
mysql_query("update " . TB_PREFIX . "hero set `health`=`health`-".$damage_health." where `heroid`='".$hero_id."'");
}
}
//exit($result['casualties_defender']['11']);
//$result['casualties_defender'][11] = round($result[1]*$units['Def_unit']['hero']);
// Work out bounty
$start = ($att_tribe-1)*10+1;
$end = ($att_tribe*10);
$max_bounty = 0;
for($i=$start;$i<=$end;$i++) {
$y = $i-(($att_tribe-1)*10);
$max_bounty += ($Attacker['u'.$i]-$result['casualties_attacker'][$y])*${'u'.$i}['cap'];
}
$result['bounty'] = $max_bounty;
return $result;
}
public function resolveConflict($data) {
global $database,$units,$unitsbytype;
$UnitChief = $UnitRam = $UnitCatapult = 0;
$attacker_count = $attack_infantry = $attack_cavalry = $attack_scout = $rams = $catapults = 0;
$defender_count = $defense_infantry = $defense_cavalry = $defense_scout = $defense_heros = 0;
$DefenderFieldsArray = $ResourceImprovementArray = $TrapperArray = array();
$FieldPalRes = $BonusPalRes = $BonusStoneMason = $BonusArtefactDurability = 0;
$ExperienceAttacker = $ExperienceDefender = 0;
$RecountReqd = $AllDefendersDead = False;
$AttackArrivalTime = $data['endtime'];
$AttackerData = $database->getVillageBattleData($data['from']);
$AttackerData['pop'] = $database->getPopulation($AttackerData['id']);
$Blacksmith = $database->getABTech($data['from']);
for($i=1;$i<=11;$i++) { $attacker_count += $data['t'.$i]; }
if($data['type'] != 1) {
// Trap attacking troops if this is not a scouting mission
}
for($i=1;$i<=10;$i++) {
if($data['t'.$i] > 0) {
$unit = ($AttackerData['tribe']-1)*10+$i;
$unitdata = $GLOBALS['u'.$unit];
if(in_array($unit,$unitsbytype['cavalry'])) {
$attack_cavalry += $data['t'.$i] * ($unitdata['atk'] + ($unitdata['atk'] + 300 * $unitdata['pop'] / 7) * (pow(1.007,$Blacksmith['b'.$i]) - 1));
} else {
$attack_infantry += $data['t'.$i] * ($unitdata['atk'] + ($unitdata['atk'] + 300 * $unitdata['pop'] / 7) * (pow(1.007,$Blacksmith['b'.$i]) - 1));
}
if(in_array($unit,$unitsbytype['scout'])) {
$attack_scout = $data['t'.$i] * 35 * pow(1.021,$Blacksmith['b'.$i]);
}
if(in_array($unit,$unitsbytype['chief'])) { $UnitChief = $i; }
if(in_array($unit,$unitsbytype['ram'])) { $UnitRam = $i; }
if(in_array($unit,$unitsbytype['catapult'])) { $UnitCatapult = $i; }
}
}
if($data['t11'] == 1 && $data['type'] != 1) {
$heroarrayAttacker = $this->getBattleHero($AttackerData['id']);
if(in_array($heroarrayAttacker['unit'],$unitsbytype['cavalry'])) {
$attack_cavalry += $heroarrayAttacker['atk'];
} else {
$attack_infantry += $heroarrayAttacker['atk'];
}
$attack_infantry *= $heroarrayAttacker['ob'];
$attack_cavalry *= $heroarrayAttacker['ob'];
}
$attack_total = $attack_infantry + $attack_cavalry;
if($attacker_count == 1 && $attack_total < 83 && $data['type'] != 1) {
// kill the single non-scout low level attacker due to basic village defense
}
if ($database->isVillageOases($id) == 0) {
$DefenderData = $database->getVillageBattleData($data['to']);
$DefenderData['pop'] = $database->getPopulation($DefenderData['id']);
$IsOasis = False;
} else {
$OasisData = $database->getOMInfo($data['to']);
$IsOasis = True;
if($OasisData['conqured'] == 0) {
$DefenderData['pop'] = 500;
} else {
$DefenderData['pop'] = $database->getPopulation($OasisData['conqured']);
}
$DefenderData['tribe'] = 4;
$DefenderData['wall'] = 0;
}
$DefenderUnits = $database->getUnit($data['to']);
$DefendersAll = $database->getEnforceVillage($data['to'],0);
array_unshift($DefendersAll,$DefenderUnits);
foreach($DefendersAll as $defenders) {
$definf = $defcav = 0;
if(!empty($Armoury)) { reset($Armoury); }
$Armoury = $defenders['from'] != $defenders['vref'] ? $database->getABTech($defenders['from']) : $database->getABTech($defenders['vref']);
for($i=1;$i<=50;$i++) {
if($defenders['u'.$i] > 0) {
if(!empty($unitdata)) { reset($unitdata); }
$unitdata = $GLOBALS['u'.$i];
$definf += $defenders['u'.$i] * ($unitdata['di'] + ($unitdata['di'] + 300 * $unitdata['pop'] / 7) * (pow(1.007,$Armoury['a'.($i%10)]) - 1));
$defcav += $defenders['u'.$i] * ($unitdata['dc'] + ($unitdata['dc'] + 300 * $unitdata['pop'] / 7) * (pow(1.007,$Armoury['a'.($i%10)]) - 1));
if(in_array($i,$unitsbytype['scout'])) {
$defense_scout += $defenders['u'.$i] * 20 * pow(1.03,$Armoury['a'.($i%10)]);
}
$defender_count += $defenders['u'.$i];
}
}
if($defenders['hero'] == 1 && $data['type'] != 1) {
if(!empty($heroarray)) { reset($heroarray); }
if($defender['vref'] == $data['to']) {
$heroarray = $this->getBattleHero($DefenderData['id']);
} else {
$ReinforcerData = $database->getVillageBattleData($defenders['from']);
$heroarray = $this->getBattleHero($ReinforcerData['id']);
}
$definf = ($definf + $heroarray['di']) * $heroarray['db'];
$defcav = ($defcav + $heroarray['dc']) * $heroarray['db'];
$defense_heros++;
}
$defense_infantry += $definf;
$defense_cavalry += $defcav;
}
if($data['type'] == 1) {
if($attack_scout > $defense_scout) {
$attack_scout_casualties = pow(($defense_scout / $attack_scout),1.5);
// generate scout report and process casualties
} else {
$attack_scout_casualties = 1;
// kill all scouts
}
} else {
$defense_total = $attack_infantry * $defense_infantry / $attack_total + $attack_cavalry * $defense_cavalry / $attack_total;
if($DefenderData['pop'] < $AttackerData['pop']) {
$defense_total *= min(1.5,pow($AttackerData['pop']/$DefenderData['pop'],0.2));
}
$DefenderFields = $database->getResourceLevel($data['to']);
for($i=1;$i<=38;$i++) {
if($DefenderFields['f'.$i] > 0) { $DefenderFieldsArray[] = $i; }
if($DefenderFields['f'.$i.'t'] == 25 || $DefenderFields['f'.$i.'t'] == 26) {
$BonusPalRes = 2 * pow($DefenderFields['f'.$i],2);
$FieldPalRes = $i;
}
if($DefenderFields['f'.$i.'t'] == 34) {
$BonusStoneMason = $DefenderFields['f'.$i] / 10 + 1;
}
if($DefenderFields['f'.$i.'t'] >= 5 && $DefenderFields['f'.$i.'t'] <= 9) {
$ResourceImprovementArray[] = $i;
}
if($DefenderFields['f'.$i.'t'] == 36) {
$TrapperArray[] = $i;
}
if($DefenderFields['f'.$i.'t'] == $data['ctar1'] && $data['ctar1'] != 0) {
$ctarf[1] = $i;
}
if($DefenderFields['f'.$i.'t'] == $data['ctar2'] && $data['ctar2'] != 0 && ($data['ctar1'] != $data['ctar2'] || $data['ctar2'] <= 18)) {
$ctarf[2]= $i;
}
}
$defense_total += $BonusPalRes;
$BonusWall = $DefenderData['tribe'] == 1 ? 1.03 : ($DefenderData['tribe'] == 2 ? 1.02 : 1.025);
$defense_total *= pow($BonusWall,$DefenderData['wall']);
if($attacker_count + $defender_count + $defense_heros > 1000) {
$DiffModifier = 2 * (1.8592 - pow(($attacker_count + $defender_count + $defense_heros),0.015));
} else {
$DiffModifier = 1.5;
}
$attack_casualties = $defense_casualties = 1;
if($attack_total > $defense_total) {
$attack_casualties = pow(($defense_total / $attack_total),$DiffModifier);
if($data['type'] == 4) {
$attack_casualties = $attack_casualties / (1 + $attack_casualties);
$defense_casualties = 1 - $attack_casualties;
}
} else {
$defense_casualties = pow(($attack_total / $defense_total),$DiffModifier);
if($data['type'] == 4) {
$defense_casualties = $defense_casualties / (1 + $defense_casualties);
$attack_casualties = 1 - $defense_casualties;
}
}
if($rams > 0 && $DefenderData['wall'] > 0) {
if($attack_casualties < 1) {
$database->setVillageLevel($data['to'],'f40t',0);
$database->setVillageLevel($data['to'],'f40',0);
} else {
$RequiredRams=array(1=>array(1,2,2,3,4,6,7,10,12,14,17,20,23,27,31,35,39,43,48,53),array(1,4,8,13,19,27,36,46,57,69,83,98,114,132,151,171,192,214,238,263),array(1,2,4,6,8,11,15,19,23,28,34,40,46,53,61,69,77,86,96,106));
$DC = max(1,$BonusStoneMason) * max(1,$BonusPalRes) / (pow(1.015,$Blacksmith['b'.$UnitRam])) ;
$L = $DefenderData['wall'];
$L2 = round(($DefenderData['wall'] - 1) /2);
$DDR = $DC / ( $L*($L+1)/8 + 5 + (24.875 + 0.625*$L2)*$L2/2 );
//calculate damage to wall based on surviving rams
}
$RecountReqd = True;
}
if($catapults > 0 && !$IsOasis) {
$BuildLevelStrength=array(1=>1,2,2,3,4,6,8,10,12,14,17,20,23,27,31,35,39,43,48,53);
$RequiredCatapults = $RequiredCatapultsMax = $BuildingLevelMax = array();
if(!empty($RequiredCatapults)) { reset($RequiredCatapults); }
for($i=1;$i<=2;$i++) {
if($data['ctar'.$i] == 0 || $ctarf[$i] == 0) {
$data['ctar'.$i] = $DefenderFieldsArray[rand(0,count($DefenderFieldsArray)-1)];
if($data['ctar2'] == 0 && $i == 1) { $data['ctar2'] = $data['ctar1']; }
}
$RequiredCatapults[$i] = round((($DefenderData['pop'] < $AttackerData['pop'] ? min(3,pow($AttackerData['pop'] / $DefenderData['pop'],0.3)) : 1) * (pow($DefenderField['f'.$ctarf[$i]],2) + $DefenderField['f'.$ctarf[$i]] + 1) / (8 * (round(200 * pow(1.0205,$Blacksmith['b'.$UnitCatapult])) / 200) / max(1,($data['ctar'.$i]>=18?max(1,$BonusStoneMason + $BonusArtefactDurability):1)))) + 0.5);
$BuildingLevelMax[$i] = 20;
if($DefenderData['capital'] != 1 && $data['ctar'.$i] <= 18 || in_array($data['ctar'.$i],$TrapperArray)) { $BuildingLevelMax[$i] = 10; }
if(in_array($data['ctar'.$i],$ResourceImprovementArray)) { $BuildingLevelMax[$i] = 5; }
$RequiredCatapultsMax[$i] = round((($DefenderData['pop'] < $AttackerData['pop'] ? min(3,pow($AttackerData['pop'] / $DefenderData['pop'],0.3)) : 1) * (pow($BuildingLevelMax[$i],2) + $BuildingLevelMax[$i] + 1) / (8 * (round(200 * pow(1.0205,$Blacksmith['b'.$UnitCatapult])) / 200) / max(1,($data['ctar'.$i]>=18?max(1,$BonusStoneMason + $BonusArtefactDurability):1)))) + 0.5);
}
$CatapultsFiring = pow($attack_total / $defense_total,1.5);
if($CatapultsFiring > 1) {
$CatapultsFiring = 1 - 0.5 / $CatapultsFiring;
} else {
$CatapultsFiring = 0.5 * $CatapultsFiring;
}
$CatapultsFiring *= $data['t'.$UnitCatapult];
for($i=1;$i=($data['ctar1']==$data['ctar2']?1:2);$i++) {
$BuildingLevelOld[$i] = $DefenderField['f'.$data['ctar'.$i]];
if($data['ctar1']!=$data['ctar2'] && $i==1) { $CatapultsFiring /= 2; }
if($CatapultsFiring >= $RequiredCatapults[$i]) {
if($DefenderField['f'.$data['ctar'.$i]] == $FieldPalRes) { $DestroyedPalRes = True; }
if($data['ctar'.$i] >= 19) { $database->setVillageLevel($data['to'],'f'.$data['ctar'.$i].'t',0); }
$database->setVillageLevel($data['to'],'f'.$data['ctar'.$i],0);
$BuildingLevelNow[$i] = 0;
$RecountReqd = True;
} else {
$BuildLevelCount = 0;
for($j=$DefenderField['f'.$data['ctar'.$i]];$j=1;$j--) {
$BuildLevelCount += ($BuildLevelStrength[$j] - $BuildLevelStrength[$j-1]) * $RequiredCatapultsMax[$i] / $BuildLevelStrength[$BuildingLevelMax[$i]];
if($CatapultsFiring < $BuildLevelCount) {
$BuildingLevelNow[$i] = $j;
break;
}
$database->setVillageLevel($data['to'],'f'.$data['ctar'.$i],$BuildingLevelNow[$i]);
$RecountReqd = True;
}
}
}
}
for($i=1;$i<=10;$i++) {
$attack_casualties_array[$i] = round($data['t'.$i] * $attack_casualties);
if(!empty($unitdata)) { reset($unitdata); }
$unitdata = $GLOBALS['u'.(($AttackerData['tribe']-1)*10+$i)];
$ExperienceDefender += $attack_casualties_array[$i] * $unitdata['pop'];
}
if($data['t11'] == 1) {
if($attack_casualties < 0.9) {
if($heroarrayAttacker['health']-100*$attack_casualties > 0) {
$database->modifyHero('health',(100*$attack_casualties),$heroarrayAttacker['heroid'],2);
$database->modifyHero('lastupdate',time(),$heroarrayAttacker['heroid'],0);
} else {
$database->modifyHero('health',0,$heroarrayAttacker['heroid'],0);
$database->modifyHero('dead',1,$heroarrayAttacker['heroid'],0);
$database->modifyHero('lastupdate',time(),$heroarrayAttacker['heroid'],0);
}
} else {
$database->modifyHero('health',0,$heroarrayAttacker['heroid'],0);
$database->modifyHero('dead',1,$heroarrayAttacker['heroid'],0);
$database->modifyHero('lastupdate',time(),$heroarrayAttacker['heroid'],0);
}
if($defence_casualties < 0.9) {
if($heroarrayDefender['health']-100*$defence_casualties > 0) {
$database->modifyHero('health',(100*$defence_casualties),$heroarrayDefender['heroid'],2);
$database->modifyHero('lastupdate',time(),$heroarrayDefender['heroid'],0);
} else {
$database->modifyHero('health',0,$heroarrayDefender['heroid'],0);
$database->modifyHero('dead',1,$heroarrayDefender['heroid'],0);
$database->modifyHero('lastupdate',time(),$heroarrayDefender['heroid'],0);
}
} else {
$database->modifyHero('health',0,$heroarrayDefender['heroid'],0);
$database->modifyHero('dead',1,$heroarrayDefender['heroid'],0);
$database->modifyHero('lastupdate',time(),$heroarrayDefender['heroid'],0);
}
}
// send surviving attackers and hero home, report.
// calculate defensive casualties, hero damage and experience (all heroes), modify units and reinforcements, report.
// damage buildings report
// Chiefing logic including wall and tribal specific building removal
if($IsOasis && $data['t11'] == 1 && $AllDefendersDead) {
$database->modifyOasisLoyalty($data['to']);
if($database->canConquerOasis($data['from'],$data['to'])) {
$database->conquerOasis($data['to'],$data['from'],$AttackerData['id']);
}
}
if($RecountReqd) { $automation->recountPop($data['to']); }
}
}
};
$battle = new Battle;
?>
+741
View File
@@ -0,0 +1,741 @@
<?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();
}
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) {
$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->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) {
if($this->plus == 0) {
return 9;
}
else {
return 3;
}
}
else {
return 2;
}
}
}
else {
if($this->basic == 0) {
return 8;
}
else {
if($session->plus) {
if($this->plus == 0) {
return 9;
}
else {
return 3;
}
}
else {
return 2;
}
}
}
}
else {
if($this->basic == 1) {
if($session->plus && $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)) {
$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'];
}
}
if($database->addBuilding($village->wid,$id,$village->resarray['f'.$id.'t'],$loop,$time+($loop==1?ceil(60/SPEED):0))) {
$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");
}
}
}
}
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 && $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($database->addBuilding($village->wid,$id,$village->resarray['f'.$id.'t'],$loop,$time,0)) {
$logging->addBuildLog($village->wid,$this->procResType($village->resarray['f'.$id.'t']),($village->resarray['f'.$id]-1),2);
header("Location: dorf2.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($database->addBuilding($village->wid,$id,$tid,$loop,$time)) {
$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");
}
}
}
}
private function meetRequirement($id) {
global $village;
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:
return false; //not implemented
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;
}
private function finishAll() {
global $database,$session,$logging,$village,$bid18,$bid10,$bid11,$technology;
foreach($this->buildArray as $jobs) {
$level = $database->getFieldLevel($jobs['wid'],$jobs['field']);
$level = ($level == -1) ? 0 : $level;
if($jobs['type'] != 25 AND $jobs['type'] != 26 AND $jobs['type'] != 40) {
$resource = $this->resourceRequired($jobs['field'],$jobs['type']);
$q = "UPDATE ".TB_PREFIX."fdata set f".$jobs['field']." = f".$jobs['field']." + 1, f".$jobs['field']."t = ".$jobs['type']." where vref = ".$jobs['wid'];
if($database->query($q)) {
$database->modifyPop($jobs['wid'],$resource['pop'],0);
$database->addCP($jobs['wid'],$resource['cp']);
$database->finishDemolition($village->wid);
$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['type'] == 10) {
$max=$database->getVillageField($jobs['wid'],"maxstore");
if($level=='0' && $this->getTypeLevel(10) != 20){ $max-=STORAGE_BASE; }
$max-=$bid10[$level]['attri']*STORAGE_MULTIPLIER;
$max+=$bid10[$level+1]['attri']*STORAGE_MULTIPLIER;
$database->setVillageField($jobs['wid'],"maxstore",$max);
}
if($jobs['type'] == 11) {
$max=$database->getVillageField($jobs['wid'],"maxcrop");
if($level=='0' && $this->getTypeLevel(11) != 20){ $max-=STORAGE_BASE; }
$max-=$bid11[$level]['attri']*STORAGE_MULTIPLIER;
$max+=$bid11[$level+1]['attri']*STORAGE_MULTIPLIER;
$database->setVillageField($jobs['wid'],"maxcrop",$max);
}
if($jobs['type'] == 38) {
$max=$database->getVillageField($jobs['wid'],"maxstore");
if($level=='0' && $this->getTypeLevel(38) != 20){ $max-=STORAGE_BASE; }
$max-=$bid38[$level]['attri']*STORAGE_MULTIPLIER;
$max+=$bid38[$level+1]['attri']*STORAGE_MULTIPLIER;
$database->setVillageField($jobs['wid'],"maxstore",$max);
}
if($jobs['type'] == 39) {
$max=$database->getVillageField($jobs['wid'],"maxcrop");
if($level=='0' && $this->getTypeLevel(39) != 20){ $max-=STORAGE_BASE; }
$max-=$bid39[$level]['attri']*STORAGE_MULTIPLIER;
$max+=$bid39[$level+1]['attri']*STORAGE_MULTIPLIER;
$database->setVillageField($jobs['wid'],"maxcrop",$max);
}
}
if(($jobs['field'] >= 19 && ($session->tribe == 1 || ALLOW_ALL_TRIBE)) || (!ALLOW_ALL_TRIBE && $session->tribe != 1)) { $innertimestamp = $jobs['timestamp']; }
}
}
$technology->finishTech();
$logging->goldFinLog($village->wid);
$database->modifyGold($session->uid,0,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);
}
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);
}
};
?>
+382
View File
@@ -0,0 +1,382 @@
<?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") {
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[]=" + escape(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);
$name = $session->username;
$msg = htmlspecialchars($data[1]);
$id_user = $session->uid;
$alliance = $session->alliance;
$now = time();
$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);
?>
+74
View File
@@ -0,0 +1,74 @@
<?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
//STOPPED ON LEVEL 9! -> http://travian.kirilloid.ru/hero.php#unit=1
$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));
//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,'drinking'=>10);
$u5=array('atk'=>120,'di'=>65,'dc'=>50,'wood'=>550,'clay'=>440,'iron'=>320,'crop'=>100,'pop'=>3,'speed'=>14,'time'=>2640,'cap'=>100,'drinking'=>15);
$u6=array('atk'=>180,'di'=>80,'dc'=>105,'wood'=>550,'clay'=>640,'iron'=>800,'crop'=>180,'pop'=>4,'speed'=>10,'time'=>3520,'cap'=>70,'drinking'=>20);
$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'=>0,'clay'=>0,'iron'=>0,'crop'=>0,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u42=array('atk'=>65,'di'=>30,'dc'=>10,'wood'=>0,'clay'=>0,'iron'=>0,'crop'=>0,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u43=array('atk'=>100,'di'=>90,'dc'=>75,'wood'=>0,'clay'=>0,'iron'=>0,'crop'=>0,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u44=array('atk'=>0,'di'=>10,'dc'=>0,'wood'=>0,'clay'=>0,'iron'=>0,'crop'=>0,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u45=array('atk'=>155,'di'=>80,'dc'=>50,'wood'=>0,'clay'=>0,'iron'=>0,'crop'=>0,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u46=array('atk'=>170,'di'=>140,'dc'=>80,'wood'=>0,'clay'=>0,'iron'=>0,'crop'=>0,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u47=array('atk'=>250,'di'=>120,'dc'=>150,'wood'=>0,'clay'=>0,'iron'=>0,'crop'=>0,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u48=array('atk'=>60,'di'=>45,'dc'=>10,'wood'=>0,'clay'=>0,'iron'=>0,'crop'=>0,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u49=array('atk'=>80,'di'=>50,'dc'=>50,'wood'=>0,'clay'=>0,'iron'=>0,'crop'=>0,'pop'=>0,'speed'=>0,'time'=>0,'cap'=>0);
$u50=array('atk'=>30,'di'=>40,'dc'=>40,'wood'=>0,'clay'=>0,'iron'=>0,'crop'=>0,'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);
// 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);
?>
+24
View File
@@ -0,0 +1,24 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## 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;
}
?>
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");
?>
+161
View File
@@ -0,0 +1,161 @@
<?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) {
$speed = $distance <= TS_THRESHOLD ? $speed : $speed * ( ( TS_THRESHOLD + ( $distance - TS_THRESHOLD ) * $bid14[$building->gettypeLevel(14)]['attri'] / 100 ) / $distance ) ;
}
}
return round(($distance/$speed) * 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;
+356
View File
@@ -0,0 +1,356 @@
<?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!");
//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.");
//COPYRIGHT
define("TRAVIAN_COPYRIGHT","TravianX 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 bid1 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");
//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");
//INDEX.php
define("LOGIN","Login");
define("PLAYERS","Players");
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.");
//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");
?>
+119
View File
@@ -0,0 +1,119 @@
<?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 VillageDestroyCatalog($wid) {
global $database;
if(LOG_GOLD_FIN) {
$log = "Village destroyed";
$q = "Insert into ".TB_PREFIX."destroy_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');
?>
+75
View File
@@ -0,0 +1,75 @@
<?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,
TravianX";
$headers = "From: Mailer@".SERVER_NAME."\n";
//$headers .= 'MIME-Version: 1.0' . "\r\n";
//$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\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.
TravianX
";
$headers = "From: Mailer@".SERVER_NAME."\n";
mail($email, $subject, $message, $headers);
}
};
$mailer = new Mailer;
?>
+264
View File
@@ -0,0 +1,264 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename Market.php ##
## Developed by: Dzoki ##
## 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()) {
if(isset($post['dname']) && $post['dname'] != "") {
$id = $database->getVillageByName($post['dname']);
$coor = $database->getCoor($id);
}
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)) {
$timetaken = $generator->procDistanceTime($coor,$village->coor,$session->tribe,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()+$timetaken);
$logging->addMarketLog($village->wid,1,array($resource[0],$resource[1],$resource[2],$resource[3],$id));
}
}
header("Location: build.php?id=".$post['id']);
} else {}
}
private function addOffer($post) {
global $database,$village,$session;
$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");
}else if($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);
}
}
header("Location: build.php?id=".$post['id']."&t=2");
} else {}
}
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,$mytime+time());
$database->addMovement(0,$infoarray['vref'],$village->wid,$hissendid,$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;
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;
?>
+391
View File
@@ -0,0 +1,391 @@
<?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, $sent, $reading, $reply, $archived, $noticearray, $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['an'],$post['be'],$post['message']);
}else{
$this->sendMessage($post['an'],$post['be'],$post['message']);
}header("Location: nachrichten.php?t=2");
break;
case "m3":
case "m4":
case "m5":
if(isset($post['delmsg_x'])) {
$this->removeMessage($post);
}
if(isset($post['archive_x'])) {
$this->archiveMessage($post);
}
if(isset($post['start_x'])) {
$this->unarchiveMessage($post);
}
break;
case "m6":
$this->createNote($post);
break;
}
}
}
public function noticeType($get) {
global $session, $database;
if(isset($get['t'])) {
if($get['t'] == 1) {
$type = array(8, 15);
}
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'] == 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);
}
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) {
$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->getNotice($session->uid);
$this->noticearray = $this->filter_by_value_except($this->allNotice, "ntype", 9);
$this->totalNotice = count($this->allNotice);
}
private function removeMessage($post) {
global $database;
for($i = 1; $i <= 10; $i++) {
if(isset($post['n' . $i])) {
$database->getMessage($post['n' . $i], 5);
}
}
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);
if($session->plus) {
$this->archived = $database->getMessage($session->uid, 6);
}
$this->totalMessage = count($this->inbox) + count($this->sent);
}
private function sendAMessage($recieve,$topic,$text) {
global $session,$database;
$allmembersQ = mysql_query("SELECT id FROM ".TB_PREFIX."users WHERE alliance='".$session->alliance."'");
$userally = $database->getUserField($recieve,"alliance",1);
$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($permission[opt7]==1){
if ($userally != 0) {
while ($allmembers = mysql_fetch_array($allmembersQ)) {
$database->sendMessage($allmembers[id],$session->uid,$topic,$text,0);
}
}
}
}
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 to multihunter
if($user == "0") {
//make mail server
$database->sendMessage($user, $session->uid, $topic, $text, 0);
} else {
$database->sendMessage($user, $session->uid, $topic, $text, 0);
}
}
//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);
return $database->sendMessage($uid, 0, WEL_TOPIC, $welcomemsg, 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;
}
}
;
+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;
?>
@@ -0,0 +1 @@
es
View File
View File
+142
View File
@@ -0,0 +1,142 @@
<?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) {
if(isset($post['ft'])) {
switch($post['ft']) {
case "p1":
$this->updateProfile($post);
break;
case "p3":
$this->updateAccount($post);
break;
}
}
if(isset($post['s'])) {
switch($post['s']) {
case "4":
$this->gpack($post);
break;
}
}
}
public function procSpecial($get) {
if(isset($get['e'])) {
switch($get['e']) {
case 2:
$this->removeMeSit($get);
break;
case 3:
$this->removeSitter($get);
break;
case 4:
$this->cancelDeleting($get);
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']),$database->RemoveXSS($post['dname'.$i]));
}
header("Location: ?uid=".$post['uid']);
}
private function gpack($post) {
global $database, $session;
$database->gpack($database->RemoveXSS($session->uid),$database->RemoveXSS($post['custom_url']));
header("Location: ?uid=".$session->uid);
}
private function updateAccount($post) {
global $database,$session,$form;
if($post['pw2'] == $post['pw3']) {
if($database->login($session->username,$post['pw1'])) {
$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']) {
if($database->isAllianceOwner($post['uid'])) {
$form->addError("del",ALLI_OWNER);
}
else {
$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($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;
$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;
?>
+24
View File
@@ -0,0 +1,24 @@
<?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);
}
}
$_GET = array_map('mysql_real_escape_string', $_GET);
$_GET = array_map('htmlspecialchars', $_GET);
$_COOKIE = array_map('mysql_real_escape_string', $_COOKIE);
$_COOKIE = array_map('htmlspecialchars', $_COOKIE);
?>
+569
View File
@@ -0,0 +1,569 @@
<?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($username) {
if(INCLUDE_ADMIN==true){
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, (
SELECT SUM( " . TB_PREFIX . "vdata.pop )
FROM " . TB_PREFIX . "vdata
WHERE " . TB_PREFIX . "vdata.owner = userid
)totalpop
FROM " . TB_PREFIX . "users
ORDER BY totalpop DESC, userid ASC";
$result = mysql_query($q);
$i = 1;
$myrank = 0;
while($row = mysql_fetch_array($result)) {
if($row['username'] == $username){
$myrank = $i;
}
$i++;
}
return $myrank;
}else{
$q = "SELECT " . TB_PREFIX . "users.id userid, " . TB_PREFIX . "users.username username, (
SELECT SUM( " . TB_PREFIX . "vdata.pop )
FROM " . TB_PREFIX . "vdata
WHERE " . TB_PREFIX . "vdata.owner = userid
)totalpop
FROM " . TB_PREFIX . "users
WHERE " . TB_PREFIX . "users.id != 0 and id != 1 and id != 2 and id != 3 and id != 4 and id != 5
ORDER BY totalpop DESC, userid ASC";
$result = mysql_query($q);
$i = 1;
$myrank = 0;
while($row = mysql_fetch_array($result)) {
if($row['username'] == $username){
$myrank = $i;
}
$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();
break;
case 11:
$this->procRankRaceArray(1);
break;
case 12:
$this->procRankRaceArray(2);
break;
case 13:
$this->procRankRaceArray(3);
break;
case 31:
$this->procAttRankArray();
break;
case 32:
$this->procDefRankArray();
break;
case 2:
$this->procVRankArray();
$this->getStart($this->searchRank($village->wid, "wref"));
break;
case 4:
$this->procARankArray();
if($session->alliance == 0) {
$this->getStart(1);
} else {
$this->getStart($this->searchRank($session->alliance, "id"));
$oldrank = $this->searchRank($session->alliance, "id");
$ally = $database->getAlliance($session->alliance);
if($ally['oldrank'] > $oldrank) {
$totalpoints = $ally['oldrank'] - $oldrank;
$database->addclimberrankpopAlly($ally['id'], $totalpoints);
$database->updateoldrankAlly($ally['id'], $oldrank);
} else
if($ally['oldrank'] < $oldrank) {
$totalpoints = $oldrank - $ally['oldrank'];
$database->removeclimberrankpopAlly($ally['id'], $totalpoints);
$database->updateoldrankAlly($ally['id'], $oldrank);
}
$database->updateoldrankAlly($ally['id'], $oldrank);
}
break;
case 41:
$this->procAAttRankArray();
if($session->alliance == 0) {
$this->getStart(1);
} else {
$this->getStart($this->searchRank($session->alliance, "id"));
}
break;
case 42:
$this->procADefRankArray();
if($session->alliance == 0) {
$this->getStart(1);
} else {
$this->getStart($this->searchRank($session->alliance, "id"));
}
break;
}
} else {
$this->procRankArray();
$this->getStart($this->searchRank($session->username, "username"));
$oldrank = $this->searchRank($session->username, "username");
if($session->oldrank > $oldrank) {
$totalpoints = $session->oldrank - $oldrank;
$database->addclimberrankpop($session->uid, $totalpoints);
$database->updateoldrank($session->uid, $oldrank);
} else
if($session->oldrank < $oldrank) {
$totalpoints = $oldrank - $session->oldrank;
$database->removeclimberrankpop($session->uid, $session->oldrank);
$database->updateoldrank($session->uid, $oldrank);
}
$database->updateoldrank($session->uid, $oldrank);
}
}
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($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($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)) {
return $name;
break;
}
}
}
}
private function procRankArray() {
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.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.access < " . (INCLUDE_ADMIN ? "10" : "8") . "
ORDER BY totalpop DESC, totalvillages DESC, username ASC";
$result = (mysql_query($q));
while($row = mysql_fetch_assoc($result)) {
$datas[] = $row;
}
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);
}
//$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 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, username ASC";
$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, username ASC";
$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") . "
ORDER BY " . TB_PREFIX . "users.dpall DESC, pop DESC, username ASC";
$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;
}
private 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;
?>
+195
View File
@@ -0,0 +1,195 @@
<?php
#################################################################################
## -= 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')) {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 ("Automation.php");
include ("Lang/" . LANG . ".php");
include ("Logging.php");
include ("Message.php");
include ("Multisort.php");
include ("Ranking.php");
include ("Alliance.php");
include ("Profile.php");
include ("Protection.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'])) {
if(!$database->checkActiveSession($_SESSION['username'], $_SESSION['sessid'])) {
$this->Logout();
return false;
} else {
//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->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->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;
?>
+626
View File
@@ -0,0 +1,626 @@
<?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 {
private $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,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,41,42,43,44);
$greatbarracks = array(61,62,63,71,72,73,84,81,82,91,92,93,94,101,102,103,104);
$stables = array(4,5,6,15,16,23,24,25,26,35,36,45,46);
$greatstables = array(64,65,66,75,76,83,84,85,86,95,96,105,106);
$workshop = array(7,8,17,18,27,28,37,38,47,48);
$greatworkshop = array(67,68,77,78,87,88,97,98,107,108);
$residence = array(9,10,19,20,29,30,39,40,49,50);
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);
}
}
}
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)));
$cropcalc = floor($res['crop'] / ($unitarray['crop'] * ($great?3:1)));
$popcalc = floor($village->getProd("crop")/$unitarray['pop']);
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) {
global $database;
$ownunit = $database->getUnit($base);
$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(!$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);
}
}
header("Location: build.php?id=".$post['id']);
}else{
header("Location: banned.php");
}
}
public function getUpkeep($array,$type,$vid=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++) {
$hdt = 0;
if($i>=4 && $i<=6) {
for($j=19;$j<=38;$j++) {
if($buildarray['f'.$j.'t'] == 41) {
$hdt = 1;
}
}
}
$unit = "u".$i;
global $$unit;
$dataarray = $$unit;
$upkeep += ($dataarray['pop'] - $hdt) * $array[$unit];
}
// $unit = "hero";
// global $$unit;
// $dataarray = $$unit;
$upkeep += $array['hero'] * 6;
return $upkeep;
}
private function trainUnit($unit,$amt,$great=false) {
global $session,$database,${'u'.$unit},$building,$village,$bid19,$bid20,$bid21,$bid25,$bid26,$bid29,$bid30,$bid41,$bid42;
if($this->getTech($unit) || $unit%10 <= 1) {
$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);
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($unit%10 == 0 || $unit%10 == 9) {
$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($this->maxUnit($unit,$great) <= $amt) {
$amt = $this->maxUnit($unit,$great);
}
}
$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;
if($database->modifyResource($village->wid,$wood,$clay,$iron,$crop,0)) {
$database->trainUnit($village->wid,$unit+($great?60:0),$amt,${'u'.$unit}['pop'],$each,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) >= 5 && $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;
?>
+425
View File
@@ -0,0 +1,425 @@
<?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){
$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){
$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['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<10; $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:
$villageOwner = $database->getVillageField($id,'owner');
$userAccess = $database->getUserField($villageOwner,'access',0);
if($userAccess == '0'){
$form->addError("error","Player is Banned. You can't attack him");
//break;
}
//check if admin:
$villageOwner = $database->getVillageField($id,'owner');
$userAccess = $database->getUserField($villageOwner,'access',0);
if($userAccess == '9'){
$form->addError("error","Player is Admin. 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 = "Unoccupied Oasis";
$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->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'];
}
}
$time = $generator->procDistanceTime($from,$to,min($speeds),1);
if (isset($post['ctar1'])){$post['ctar1'] = $post['ctar1'];}else{ $post['ctar1'] = 0;}
if (isset($post['ctar2'])){$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']);
$database->addMovement(3,$village->wid,$data['to_vid'],$reference,($time+time()));
if($form->returnErrors() > 0) {
$_SESSION['errorarray'] = $form->getErrors();
$_SESSION['valuearray'] = $_POST;
header("Location: a2b.php");
}
header("Location: build.php?id=39");
}}
private function sendTroopsBack($post) {
global $form, $database, $village, $generator, $session, $technology;
$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($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++;
}
//get cord
$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';
}
}
$time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1);
$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'],0,2,0,0,0,0);
$database->addMovement(4,$village->wid,$enforce['from'],$reference,($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");
}
}
}
public function Settlers($post) {
global $form, $database, $village, $session;
$mode = CP;
$total = count($database->getProfileVillages($session->uid));
$need_cps = ${'cp'.$mode}[$total];
$cps = $session->cp;
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,$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");
}
}
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;
?>
+293
View File
@@ -0,0 +1,293 @@
<?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;
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->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'];
//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;
}
?>
+11
View File
@@ -0,0 +1,11 @@
Title : README
Author : Advocaite
TravianX Brought to you by Advocaite & donn
This clone has seen many authors allkori,dzoki,dixxie PLus many more
the install process is fairly easy to do just make sure
GameEngine/Config.php Dose not exsist if it dose exsist delete it
Then run server in localhost you should be directed to a install page
folow instructions then play and enjoy.
thankyou for you time
+1
View File
@@ -0,0 +1 @@
deny from all
+24
View File
@@ -0,0 +1,24 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename 404.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<div style="margin-top: 50px;">
<center>
<h1>404 - File not found</h1>
This system is not finished yet or page does not exist.<br>
<br>
</center>
</div>
+311
View File
@@ -0,0 +1,311 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename addTroops.tpl ##
## Developed by: Dzoki & Advocatie ##
## License: TravianX Project ##
## Thanks to: Dzoki & itay2277(Edit troops) ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
include("../GameEngine/Lang/".LANG.".php");
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
$id = $_GET['did'];
if(isset($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']);
?>
<form action="../GameEngine/Admin/Mods/addTroops.php" method="POST">
<input type="hidden" name="id" id="id" value="<?php echo $id; ?>">
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
<table id="member">
<thead>
<tr>
<th colspan="2">Edit troops</th>
<?php if($user['tribe'] == 1){ ?>
</tr></thead><tbody>
<tr>
<td class="addTroops"><img src="../img/un/u/1.gif"></img> <?php echo U1; ?></td>
<td class="addTroops"><input class="addTroops" name="u1" id="u1" value="<?php echo $units['u1']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u1']; ?></b><font></td>
</tr>
<tr>
<td><img src="../img/un/u/2.gif"></img> <?php echo U2; ?></td>
<td><input class="addTroops" name="u2" id="u2" value="<?php echo $units['u2']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u2']; ?></b><font></td>
</tr>
<tr>
<td><img src="../img/un/u/3.gif"></img> <?php echo U3; ?></td>
<td><input class="addTroops" name="u3" id="u3" value="<?php echo $units['u3']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u3']; ?></b><font></td>
</tr>
<tr>
<td><img src="../img/un/u/4.gif"></img> <?php echo U4; ?></td>
<td><input class="addTroops" name="u4" id="u4" value="<?php echo $units['u4']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u4']; ?></b><font></td>
</tr>
<tr>
<td><img src="../img/un/u/5.gif"></img> <?php echo U5; ?></td>
<td><input class="addTroops" name="u5" id="u5" value="<?php echo $units['u5']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u5']; ?></b><font></td>
</tr>
<tr>
<td><img src="../img/un/u/6.gif"></img> <?php echo U6; ?></td>
<td><input class="addTroops" name="u6" id="u6" value="<?php echo $units['u6']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u6']; ?></b><font></td>
</tr>
<tr>
<td><img src="../img/un/u/7.gif"></img> <?php echo U7; ?></td>
<td><input class="addTroops" name="u7" id="u7" value="<?php echo $units['u7']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u7']; ?></b><font></td>
</tr>
<tr>
<td><img src="../img/un/u/8.gif"></img> <?php echo U8; ?></td>
<td><input class="addTroops" name="u8" id="u8" value="<?php echo $units['u8']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u8']; ?></b><font></td>
</tr>
<tr>
<td><img src="../img/un/u/9.gif"></img> <?php echo U9; ?></td>
<td><input class="addTroops" name="u9" id="u9" value="<?php echo $units['u9']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u9']; ?></b><font></td>
</tr>
<tr>
<td><img src="../img/un/u/10.gif"></img> <?php echo U10; ?></td>
<td><input class="addTroops" name="u10" id="u10" value="<?php echo $units['u10']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u10']; ?></b><font></td>
</tr>
<?php }
else if($user['tribe'] == 2){ ?>
</tr></thead><tbody>
<tr>
<td class="addTroops"><img src="../img/un/u/11.gif"></img> <?php echo U11; ?></td>
<td class="addTroops"><input class="addTroops" name="u11" id="u11" value="<?php echo $units['u11']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u11']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/12.gif"></img> <?php echo U12; ?></td>
<td><input class="addTroops" name="u12" id="u12" value="<?php echo $units['u12']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u12']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/13.gif"></img> <?php echo U13; ?></td>
<td><input class="addTroops" name="u13" id="u13" value="<?php echo $units['u13']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u13']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/14.gif"></img> <?php echo U14; ?></td>
<td><input class="addTroops" name="u14" id="u14" value="<?php echo $units['u14']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u14']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/15.gif"></img> <?php echo U15; ?></td>
<td><input class="addTroops" name="u15" id="u15" value="<?php echo $units['u15']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u15']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/16.gif"></img> <?php echo U16; ?></td>
<td><input class="addTroops" name="u16" id="u16" value="<?php echo $units['u16']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u16']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/17.gif"></img> <?php echo U17; ?></td>
<td><input class="addTroops" name="u17" id="u17" value="<?php echo $units['u17']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u17']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/18.gif"></img> <?php echo U18; ?></td>
<td><input class="addTroops" name="u18" id="u18" value="<?php echo $units['u18']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u18']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/19.gif"></img> <?php echo U19; ?></td>
<td><input class="addTroops" name="u19" id="u19" value="<?php echo $units['u19']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u19']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/20.gif"></img> <?php echo U20; ?></td>
<td><input class="addTroops" name="u20" id="u20" value="<?php echo $units['u20']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u20']; ?></td>
</tr>
<?php }
else if($user['tribe'] == 3){ ?>
</tr></thead><tbody>
<tr>
<td class="addTroops"><img src="../img/un/u/21.gif"></img> <?php echo U21; ?></td>
<td class="addTroops"><input class="addTroops" name="u21" id="u21" value="<?php echo $units['u21']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u21']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/22.gif"></img> <?php echo U22; ?></td>
<td><input class="addTroops" name="u22" id="u22" value="<?php echo $units['u22']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u22']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/23.gif"></img> <?php echo U23; ?></td>
<td><input class="addTroops" name="u23" id="u23" value="<?php echo $units['u23']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u23']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/24.gif"></img> <?php echo U24; ?></td>
<td><input class="addTroops" name="u24" id="u24" value="<?php echo $units['u24']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u24']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/25.gif"></img> <?php echo U25; ?></td>
<td><input class="addTroops" name="u25" id="u25" value="<?php echo $units['u25']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u25']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/26.gif"></img> <?php echo U26; ?></td>
<td><input class="addTroops" name="u26" id="u26" value="<?php echo $units['u26']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u26']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/27.gif"></img> <?php echo U27; ?></td>
<td><input class="addTroops" name="u27" id="u27" value="<?php echo $units['u27']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u27']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/28.gif"></img> <?php echo U28; ?></td>
<td><input class="addTroops" name="u28" id="u28" value="<?php echo $units['u28']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u28']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/29.gif"></img> <?php echo U29; ?></td>
<td><input class="addTroops" name="u29" id="u29" value="<?php echo $units['u29']; ?>"" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u29']; ?></td>
</tr>
<tr>
<td><img src="../img/un/u/30.gif"></img> <?php echo U30; ?></td>
<td><input class="addTroops" name="u30" id="u30" value="<?php echo $units['u30']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u30']; ?></td>
</tr>
<?php }
else if($user['tribe'] == 4){ ?>
</tr></thead><tbody>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/31.gif"></img> <?php echo U31; ?></td>
<td class="addTroops"><input class="addTroops" name="u31" id="u31" value="<?php echo $units['u31']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u31']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/32.gif"></img> <?php echo U32; ?></td>
<td><input class="addTroops" name="u32" id="u32" value="<?php echo $units['u32']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u32']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/33.gif"></img> <?php echo U33; ?></td>
<td><input class="addTroops" name="u33" id="u33" value="<?php echo $units['u33']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u33']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/34.gif"></img> <?php echo U34; ?></td>
<td><input class="addTroops" name="u34" id="u34" value="<?php echo $units['u34']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u34']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/35.gif"></img> <?php echo U35; ?></td>
<td><input class="addTroops" name="u35" id="u35" value="<?php echo $units['u35']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u35']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/36.gif"></img> <?php echo U36; ?></td>
<td><input class="addTroops" name="u36" id="u36" value="<?php echo $units['u36']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u36']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/37.gif"></img> <?php echo U37; ?></td>
<td><input class="addTroops" name="u37" id="u37" value="<?php echo $units['u37']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u37']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/38.gif"></img> <?php echo U38; ?></td>
<td><input class="addTroops" name="u38" id="u38" value="<?php echo $units['u38']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u38']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/39.gif"></img> <?php echo U39; ?></td>
<td><input class="addTroops" name="u39" id="u39" value="<?php echo $units['u39']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u39']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/40.gif"></img> <?php echo U40; ?></td>
<td><input class="addTroops" name="u40" id="u40" value="<?php echo $units['u40']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u40']; ?></td>
</tr>
<?php }
else if($user['tribe'] == 5){ ?>
</tr></thead><tbody>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/41.gif"></img> <?php echo U41; ?></td>
<td class="addTroops"><input class="addTroops" name="u41" id="u41" value="<?php echo $units['u41']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u41']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/42.gif"></img> <?php echo U42; ?></td>
<td><input class="addTroops" name="u42" id="u42" value="<?php echo $units['u42']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u42']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/43.gif"></img> <?php echo U43; ?></td>
<td><input class="addTroops" name="u43" id="u43" value="<?php echo $units['u43']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u43']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/44.gif"></img> <?php echo U44; ?></td>
<td><input class="addTroops" name="u44" id="u44" value="<?php echo $units['u44']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u44']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/45.gif"></img> <?php echo U45; ?></td>
<td><input class="addTroops" name="u45" id="u45" value="<?php echo $units['u45']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u45']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/46.gif"></img> <?php echo U46; ?></td>
<td><input class="addTroops" name="u46" id="u46" value="<?php echo $units['u46']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u46']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/47.gif"></img> <?php echo U47; ?></td>
<td><input class="addTroops" name="u47" id="u47" value="<?php echo $units['u47']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u47']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/48.gif"></img> <?php echo U48; ?></td>
<td><input class="addTroops" name="u48" id="u48" value="<?php echo $units['u48']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u48']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/49.gif"></img> <?php echo U49; ?></td>
<td><input class="addTroops" name="u49" id="u49" value="<?php echo $units['u49']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u49']; ?></td>
</tr>
<tr>
<td class="addTroops"><img src="../gpack/travian_default/img/u/50.gif"></img> <?php echo U50; ?></td>
<td><input class="addTroops" name="u50" id="u50" value="<?php echo $units['u50']; ?>" maxlength="10">&nbsp;&nbsp;&nbsp;<font color="#bcbcbc" size="1">Currently: <b><?php echo $units['u50']; ?></td>
</tr>
<?php } ?>
</tbody></table>
<br />
<div align="right"><input type="image" border="0" src="../img/admin/b/ok1.gif">
</form>
<?php } ?>
<br /><br /><div align="right"><?php if(isset($_GET['d'])) { echo '<font color="Red"><b>Troops edited</font></b>';
} ?>
+44
View File
@@ -0,0 +1,44 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename add_village.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<style>
.del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
</style>
<form method="post" action="admin.php">
<input name="action" type="hidden" value="addVillage">
<input name="uid" type="hidden" value="<?php echo $user['id'];?>">
<table id="member" style="width: 225px;">
<thead>
<tr>
<th colspan="2">Add Village</th>
</tr>
</thead>
<tr>
<td colspan="2"><center>Coordinates (<b>X</b>|<b>Y</b>)</center></td>
</tr>
<tr>
<td>X:</td>
<td><input name="x" class="fm" value="" type="input" <?php if($_SESSION['access'] == ADMIN){ echo ''; } else if($_SESSION['access'] == MULTIHUNTER){ echo 'disabled="disabled"'; } ?>></td>
</tr>
<tr>
<td>Y:</td>
<td><input name="y" class="fm" value="" type="input" <?php if($_SESSION['access'] == ADMIN){ echo ''; } else if($_SESSION['access'] == MULTIHUNTER){ echo 'disabled="disabled"'; } ?>></td>
</tr>
<tr>
<td colspan="2"><center><input value="Add Village" type="submit" <?php if($_SESSION['access'] == ADMIN){ echo ''; } else if($_SESSION['access'] == MULTIHUNTER){ echo 'disabled="disabled"'; } ?>></center></td>
</tr>
</table>
</form>
+56
View File
@@ -0,0 +1,56 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
<link REL="shortcut icon" HREF="favicon.ico"/>
<title><?php if($_SESSION['access'] == ADMIN){ echo 'Admin Control Panel - TravianX'; } else if($_SESSION['access'] == MULTIHUNTER){ echo 'Multihunter 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>
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename admin_log.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!"); ?>
<?php
$no = count($database->getAdminLog());
$log = $database->getAdminLog();
for($i=0;$i<$no;$i++) {
$admid = $log[$i]['user']?>
------------------------------------<br>
<b>Log ID:</b> <?php echo $log[$i]['id']; ?><br />
<b>Admin:</b> <?php $user = $database->getUserField($admid,"username",0);
if($user == 'Multihunter') {
echo '<b>CONTROL PANEL</b>';
} else { echo '<a href="admin.php?p=player&uid='.$admid.'">'.$user.'</a>'; }
?><br />
<b>Log:</b> <?php echo $log[$i]['log']; ?><br />
<b>Date:</b> <?php echo date("d.m.Y H:i:s",$log[$i]['time']+3600*2); ?><br />
<?php } ?>
+140
View File
@@ -0,0 +1,140 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename alliance.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
if($_GET['aid']){
$alidata = $database->getAlliance($_GET['aid']);
$aliusers = $database->getAllMember($_GET['aid']);
if($alidata and $aliusers){
foreach($aliusers as $member) {
$totalpop += $database->getVSumField($member['id'],"pop");
}
?>
<br>
<table id="profile" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="2">Alliance <a href="?p=alliance&aid=<?php echo $alidata['id'];?>"><?php echo $alidata['name'];?></a></th>
</tr>
<tr>
<td>Details</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr><td class="empty"></td><td class="empty"></td></tr>
<tr>
<td class="details">
<table cellpadding="0" cellspacing="0">
<tbody><tr>
<th>Tag</th>
<td><?php echo $alidata['tag']; ?></td>
</tr>
<tr>
<th>Name</th>
<td><?php echo $alidata['name']; ?></td>
</tr>
<tr>
<td colspan="2" class="empty"></td>
</tr>
<tr>
<th>Rank</th>
<td>???</td>
</tr>
<tr>
<th>Points</th>
<td><?php echo $totalpop; ?></td>
</tr>
<tr>
<th>Members</th>
<td><?php echo count($aliusers); ?></td>
</tr>
<tr>
<td colspan="2" class="empty"></td>
</tr>
<tr>
<th>alliance founder</th>
<td><a href="?p=player&uid=<?php echo $alidata['leader']; ?>"><?php echo $database->getUserField($alidata['leader'],"username",0); ?></a></td>
</tr>
<tr>
<td colspan="2">
<a href="?p=editAli&aid=<?php echo $alidata['id'];?>">» Edit Alliance</a>
</td>
</tr>
<tr>
<td colspan="2">
<a href="?p=DelAli&aid=<?php echo $alidata['id'];?>">» Delete Alliance</a>
</td>
</tr>
<tr>
<td colspan="2" class="emmty"></td>
</tr>
<tr>
<td class="desc2" colspan="2"> bb </td>
</tr>
</tbody></table>
</td>
<td class="desc1">aa </td>
</tr>
</tbody>
</table><table id="member" cellpadding="1" cellspacing="1"><thead>
<tr>
<th>&nbsp;</th>
<th>Player</th>
<th>Population</th>
<th>Villages</th>
<th>&nbsp;</th></tr>
</thead>
<tbody>
<?php
foreach($aliusers as $user) {
$rank++;
$TotalUserPop = $database->getVSumField($user['id'],"pop");
$TotalVillages = $database->getProfileVillages($user['id']);
echo " <tr>";
echo " <td class=ra>".$rank.".</td>";
echo " <td class=pla><a href=spieler.php?uid=".$user['id'].">".$user['username']."</a></td>";
echo " <td class=hab>".$TotalUserPop."</td>";
echo " <td class=vil>".count($TotalVillages)."</td>";
if($aid == $session->alliance){
if ((time()-600) < $user['timestamp']){ // 0 Min - 10 Min
echo " <td class=on><img class=online1 src=img/x.gif title=now online alt=now online /></td>";
}elseif ((time()-86400) < $user['timestamp'] && (time()-600) > $user['timestamp']){ // 10 Min - 1 Days
echo " <td class=on><img class=online2 src=img/x.gif title=now online alt=now online /></td>";
}elseif ((time()-259200) < $user['timestamp'] && (time()-86400) > $user['timestamp']){ // 1-3 Days
echo " <td class=on><img class=online3 src=img/x.gif title=now online alt=now online /></td>";
}elseif ((time()-604800) < $user['timestamp'] && (time()-259200) > $user['timestamp']){
echo " <td class=on><img class=online4 src=img/x.gif title=now online alt=now online /></td>";
}else{
echo " <td class=on><img class=online5 src=img/x.gif title=now online alt=now online /></td>";
}
}
echo " </tr>";
}
?>
</tbody>
</table>
<?php
}else{
echo "Not found...<a href=\"javascript: history.go(-1)\">Back</a>";
}
}
?>
+8
View File
@@ -0,0 +1,8 @@
<p>
<a href="admin.php">Homepage</a>
<a href="?page=1">Configuration</a>
<a href="?page=2">Search</a>
<a href="?page=5">Online players</a>
<a href="?page=6">Bug report</a>
</p>
+39
View File
@@ -0,0 +1,39 @@
<?php
$database->BugReportSetViewed();
?>
<table cellpadding="1" cellspacing="1" id="player">
<thead>
<tr>
<th colspan="10">Bug report</th>
</tr>
<tr><td></td><td>Player</td><td>Page</td><td>Report</td><td>Time</td><td>IP</td><td></td></tr>
</thead><tbody>
<?php
$bug = $database->BugReport();
if(count($bug)>0) {
for ($i = 0; $i < count($bug); $i++) {
if($bug[$i]==0){
$del = "<td></td>";
}else{
$del = '<td ><a href="?delete='.$bug[$i]['id'].'&where=bug_report"><img src="img/x.gif" class="del" title="cancel" alt="cancel"></a></td>';
}
$id = $i+1;
echo "<tr><td class=\"ra \" >".$id.".</td>";
echo "<td><a href=\"?uid=".$bug[$i]['user']."\">".$database->getUserField($bug[$i]['user'],'username',0)."</a></td>";
echo "<td>".$bug[$i]['page']."</td>";
echo "<td>".$bug[$i]['report']."</td>";
echo "<td class=\"vil\">".date("H:i d.m.y",$bug[$i]['time'])."</td>";
echo "<td>".$bug[$i]['ip']."</td>";
echo $del;
echo "</tr>";
}
}
else {
echo "<tr><td class=\"none\" colspan=\"7\">No bug report</td></tr>";
}
?>
</tbody>
</table>
+138
View File
@@ -0,0 +1,138 @@
<?
if($_POST){
$database->update_config($_POST);
$database->reload('admin.php?page=1');
}
?>
<form action="" method="post">
<table id="del_acc" class="account" cellpadding="1" cellspacing="1"><thead>
<tr>
<th colspan="2">Server Settings</th>
</tr>
</thead><tbody>
<tr>
<th>Title name:</th>
<td><input class="text" name="SERVER_NAME" value="<?php echo SERVER_NAME;?>" maxlength="20" type="text"></td>
</tr>
<tr>
<th>Language:</th>
<td>
<select class="dropdown" name="LANG"">
<?php
$handle=opendir('GameEngine/lang');
while (false!==($file = readdir($handle)))
{
if (similar_text(".",$file)<1)
{
if(LANG==$file){$sel = "selected";}else{$sel = "";}
echo '<option value="'.$file.'"'.$sel.'>'.$file.'</option>\n';
}
}
closedir($handle);
?>
</select>
</td>
</tr>
<tr>
<th>Speed</th>
<td class="speed">
<input class="radio" name="SPEED" value="1" <?php if(SPEED==1){echo 'checked';}?> type="radio"> 1x
<input class="radio" name="SPEED" value="2" <?php if(SPEED==2){echo 'checked';}?> type="radio"> 2x
<input class="radio" name="SPEED" value="3" <?php if(SPEED==3){echo 'checked';}?> type="radio"> 3x
<input class="radio" name="SPEED" value="5" <?php if(SPEED==5){echo 'checked';}?> type="radio"> 5x
<input class="radio" name="SPEED" value="10" <?php if(SPEED==10){echo 'checked';}?> type="radio"> 10x
</td>
</tr>
<tr>
<th>Graphic pack:</th>
<td>
<input type="radio" name="GP_ENABLE" <?php if(GP_ENABLE==1){echo 'checked';}?> value="1"> On
<input type="radio" name="GP_ENABLE" <?php if(GP_ENABLE==0){echo 'checked';}?> value="0"> Off
</td>
</tr>
<tr>
<th>Server online:</th>
<td>
<input class="checkbox" name="active" value="1" <?php if(active==1){echo 'checked';}?> type="radio"> On
<input class="checkbox" name="active" value="0" <?php if(active==0){echo 'checked';}?> type="radio"> Off
</td>
</tr>
<tr>
<th>Censored:</th>
<td>
<input class="checkbox" name="WORD_CENSOR" value="1" <?php if(WORD_CENSOR==1){echo 'checked';}?> type="radio"> On
<input class="checkbox" name="WORD_CENSOR" value="0" <?php if(WORD_CENSOR==0){echo 'checked';}?> type="radio"> Off
</td>
</tr>
<tr>
<th>Censored words:</th>
<td><textarea class="text" name="CENSORED" maxlength="100"><?php echo CENSORED;?></textarea></td>
</tr>
<tr>
<th>Log build:</th>
<td>
<input class="radio" name="LOG_BUILD" value="1" <?php if(LOG_BUILD==1){echo 'checked';}?> type="radio"> On
<input class="radio" name="LOG_BUILD" value="0" <?php if(LOG_BUILD==0){echo 'checked';}?> type="radio"> Off
</td>
</tr>
<tr>
<th>Log Technology:</th>
<td>
<input class="radio" name="LOG_TECH" value="1" <?php if(LOG_TECH==1){echo 'checked';}?> type="radio"> On
<input class="radio" name="LOG_TECH" value="0" <?php if(LOG_TECH==0){echo 'checked';}?> type="radio"> Off
</td>
</tr>
<tr>
<th>Log Login:</th>
<td>
<input class="radio" name="LOG_LOGIN" value="1" <?php if(LOG_LOGIN==1){echo 'checked';}?> type="radio"> On
<input class="radio" name="LOG_LOGIN" value="0" <?php if(LOG_LOGIN==0){echo 'checked';}?> type="radio"> Off
</td>
</tr>
<tr>
<th>Log Gold:</th>
<td>
<input class="radio" name="LOG_GOLD_FIN" value="1" <?php if(LOG_GOLD_FIN==1){echo 'checked';}?> type="radio"> On
<input class="radio" name="LOG_GOLD_FIN" value="0" <?php if(LOG_GOLD_FIN==0){echo 'checked';}?> type="radio"> Off
</td>
</tr>
<tr>
<th>Log Admin:</th>
<td>
<input class="radio" name="LOG_ADMIN" value="1" <?php if(LOG_ADMIN==1){echo 'checked';}?> type="radio"> On
<input class="radio" name="LOG_ADMIN" value="0" <?php if(LOG_ADMIN==0){echo 'checked';}?> type="radio"> Off
</td>
</tr>
<tr>
<th>Log War:</th>
<td>
<input class="radio" name="LOG_WAR" value="1" <?php if(LOG_WAR==1){echo 'checked';}?> type="radio"> On
<input class="radio" name="LOG_WAR" value="0" <?php if(LOG_WAR==0){echo 'checked';}?> type="radio"> Off
</td>
</tr>
<tr>
<th>Log Market:</th>
<td>
<input class="radio" name="LOG_MARKET" value="1" <?php if(LOG_MARKET==1){echo 'checked';}?> type="radio"> On
<input class="radio" name="LOG_MARKET" value="0" <?php if(LOG_MARKET==0){echo 'checked';}?> type="radio"> Off
</td>
</tr>
<tr>
<th>Log Illegal:</th>
<td>
<input class="checkbox" name="LOG_ILLEGAL" value="1" <?php if(LOG_ILLEGAL==1){echo 'checked';}?> type="radio"> On
<input class="checkbox" name="LOG_ILLEGAL" value="0" <?php if(LOG_ILLEGAL==0){echo 'checked';}?> type="radio"> Off
</td>
</tr>
<tr>
<th>Bug Report:</th>
<td>
<input class="checkbox" name="BUG_REPORT" value="1" <?php if(BUG_REPORT==1){echo 'checked';}?> type="radio"> On
<input class="checkbox" name="BUG_REPORT" value="0" <?php if(BUG_REPORT==0){echo 'checked';}?> type="radio"> Off
</td>
</tr>
</tbody></table>
<input type="submit">
</form>
+47
View File
@@ -0,0 +1,47 @@
<?php
if(!is_numeric($_SESSION['search'])) {
echo "<p class=\"error\">The user <b>".$_SESSION['search']."</b> does not exist.</p>";
$search = 0;
}
else {
$search = $_SESSION['search'];
}
?>
<table cellpadding="1" cellspacing="1" id="player">
<thead>
<tr>
<th colspan="10">Online players</th>
</tr>
<tr><td></td><td>Player</td><td>Access</td><td>Gold</td><td>Email</td><td>Alliance</td><td>Population</td><td>Villages</td><td>Tribe</td></tr>
</thead><tbody>
<?php
$users = $database->getUsersAll();
for ($i = 0; $i < count($users); $i++) {
if(count($users)>0) {
$users[$i]['totalvillage'] = count($database->getVillagesID($users[$i]['id']));
$users[$i]['totalpop'] = $database->getVSumField($users[$i]['id'],"pop");
$users[$i]['aname'] = $database->getAllianceName($users[$i]['alliance']);
$id = $i+1;
echo "<tr><td class=\"ra \" >".$id.".</td>";
echo "<td class=\"pla \" ><a href=\"spieler.php?uid=".$users[$i]['id']."\">".$users[$i]['username']."</a> [".$users[$i]['id']."]</td>";
echo "<td class=\"pla \" >".$users[$i]['access']."</td>";
echo "<td class=\"pla \" >".$users[$i]['gold']."</td>";
echo "<td class=\"pla \" >".$users[$i]['email']."</td>";
echo "<td class=\"al \" ><a href=\"allianz.php?aid=".$users[$i]['alliance']."\">".$users[$i]['aname']."</a></td>";
echo "<td class=\"pop \" >".$users[$i]['totalpop']."</td><td class=\"vil\">".$users[$i]['totalvillage']."</td><td class=\"vil\">".$users[$i]['tribe']."</td></tr>";
}
else {
echo "<td class=\"none\" colspan=\"5\">No users found</td>";
}
}
?>
</tbody>
</table>
+75
View File
@@ -0,0 +1,75 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename editUser.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
$uid = $_GET['uid'];
$user = $database->getUser($uid);
if($_POST){
$profile->updateProfil($_POST);
$database->reload('?uid='.$uid);
}
?>
<div id="content" class="player" style="width:100%">
<form action="" method="POST">
<input type="hidden" name="ft" value="p1" />
<input type="hidden" name="uid" value="<?php echo $uid; ?>" />
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<table cellpadding="1" cellspacing="1" id="edit" ><thead>
<tr>
<th colspan="3">Player <?php echo $user['username']; ?> </th>
</tr>
<tr>
<td colspan="2">Details</td>
<td>Description</td>
</tr>
</thead>
<tbody>
<tr>
<td colspan="2" class="empty"></td><td class="empty"></td></tr>
<tr>
<?php
if($user['birthday'] != 0) {
$bday = explode("-",$user['birthday']);
}
else {
$bday = array('','','');
}
?>
<th>Birthday</th><td class="birth"><input tabindex="1" class="text day" type="text" name="tag" value="<?php echo $bday[2]; ?>" maxlength="2" /> <select tabindex="2" name="monat" size="" class="dropdown">
<option value="0"></option><option value="1" <?php if($bday[1] == 1) { echo "selected"; } ?>>Jan</option><option value="2"<?php if($bday[1] == 2) { echo "selected"; } ?>>Feb</option><option value="3"<?php if($bday[1] == 3) { echo "selected"; } ?>>Mar</option><option value="4"<?php if($bday[1] == 4) { echo "selected"; } ?>>Apr</option><option value="5"<?php if($bday[1] == 5) { echo "selected"; } ?>>May</option><option value="6"<?php if($bday[1] == 6) { echo "selected"; } ?>>June</option><option value="7"<?php if($bday[1] == 7) { echo "selected"; } ?>>July</option><option value="8"<?php if($bday[1] == 8) { echo "selected"; } ?>>Aug</option><option value="9"<?php if($bday[1] == 9) { echo "selected"; } ?>>Sep</option><option value="10"<?php if($bday[1] == 10) { echo "selected"; } ?>>Oct</option><option value="11"<?php if($bday[1] == 11) { echo "selected"; } ?>>Nov</option><option value="12"<?php if($bday[1] == 12) { echo "selected"; } ?>>Dec</option></select> <input tabindex="3" type="text" name="jahr" value="<?php echo $bday[0]; ?>" maxlength="4" class="text year"></td>
<td rowspan="100" class="desc1"><textarea tabindex="7" name="be1"><?php echo $user['desc2']; ?></textarea></td></tr>
<tr><th>Gender</th>
<td class="gend">
<label><input class="radio" type="radio" name="mw" value="0" <?php if($user['gender'] == 0) { echo "checked"; } ?> tabindex="4">n/a</label>
<label><input class="radio" type="radio" name="mw" value="1" <?php if($user['gender'] == 1) { echo "checked"; } ?> >m</label>
<label><input class="radio" type="radio" name="mw" value="2" <?php if($user['gender'] == 2) { echo "checked"; } ?> >f</label>
</td></tr>
<tr><th>Location</th><td><input tabindex="5" type="text" name="ort" value="<?php echo $user['location']; ?>" maxlength="30" class="text"></td></tr>
<tr><td colspan="2" class="empty"></td></tr>
<?php
$varray = $database->getProfileVillages($uid);
for($i=0;$i<=count($varray)-1;$i++) {
echo "<tr><th>Village name</th><td><input tabindex=\"6\" type=\"text\" name=\"dname$i\" value=\"".$varray[$i]['name']."\" maxlength=\"20\" class=\"text\"></td></tr>";
}
?>
<tr><td colspan="2" class="empty"></td></tr>
<tr><td colspan="2" class="desc2"><textarea tabindex="8" name="be2"><?php echo $user['desc1']; ?></textarea></td></tr>
</table><p class="btn"><input type="image" value="" tabindex="9" name="s1" id="btn_ok" class="dynamic_img" src="img/x.gif" alt="OK" /></p>
</form>
+3
View File
@@ -0,0 +1,3 @@
<h1>Welcome to admin</h1>
heloo
+61
View File
@@ -0,0 +1,61 @@
<?php
$ranking->procRankReq($_GET);
$ranking->procRank($_POST);
if(!is_numeric($_SESSION['search'])) {
echo "<p class=\"error\">The user <b>".$_SESSION['search']."</b> does not exist.</p>";
$search = 0;
}
else {
$search = $_SESSION['search'];
}
?>
<table cellpadding="1" cellspacing="1" id="player">
<thead>
<tr>
<th colspan="10">Online players</th>
</tr>
<tr><td></td><td>Player</td><td>Access</td><td>Gold</td><td>Email</td><td>Alliance</td><td>Population</td><td>Villages</td><td>Tribe</td></tr>
</thead><tbody>
<?php
$users = $database->getUsersAll();
$holder = array();
foreach($users as $value) {
$value['totalvillage'] = count($database->getVillagesID($value['id']));
$value['totalpop'] = $database->getVSumField($value['id'],"pop");
$value['aname'] = $database->getAllianceName($value['alliance']);
array_push($holder,$value);
}
$users = $multisort->sorte($holder, "'totalvillage'", false, 2, "'totalpop'", false, 2);
for ($i = 0; $i < count($users); $i++) {
if(count($users)>0) {
/*
$users[$i]['totalvillage'] = count($database->getVillagesID($users[$i]['id']));
$users[$i]['totalpop'] = $database->getVSumField($users[$i]['id'],"pop");
$users[$i]['aname'] = $database->getAllianceName($users[$i]['alliance']);
*/
$id = $i+1;
echo "<tr><td class=\"ra \" >".$id.".</td>";
echo "<td class=\"pla \" ><a href=\"?uid=".$users[$i]['id']."\">".$users[$i]['username']."</a> [".$users[$i]['id']."]</td>";
echo "<td class=\"pla \" >".$users[$i]['access']."</td>";
echo "<td class=\"pla \" >".$users[$i]['gold']."</td>";
echo "<td class=\"pla \" >".$users[$i]['email']."</td>";
echo "<td class=\"al \" ><a href=\"?aid=".$users[$i]['alliance']."\">".$users[$i]['aname']."</a></td>";
echo "<td class=\"pop \" >".$users[$i]['totalpop']."</td><td class=\"vil\">".$users[$i]['totalvillage']."</td><td class=\"vil\">".$users[$i]['tribe']."</td></tr>";
}
else {
echo "<td class=\"none\" colspan=\"5\">No users found</td>";
}
}
?>
</tbody>
</table>
@@ -0,0 +1,70 @@
<table id="player" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="15">Results in <?php echo $_POST['search_in'];?></th>
</tr>
</thead><tbody>
<?php
if($_POST['search_in']=="player"){
echo '<tr><td></td><td>Player</td><td>Access</td><td>Gold</td><td>Email</td><td>Alliance</td><td>Population</td>
<td>Villages</td><td>Tribe</td><td>Last activity</td><td></td></tr>';
for ($i = 0; $i <= count($search)-1; $i++) {
$search[$i]['totalvillage'] = count($database->getVillagesID($search[$i]['id']));
$search[$i]['totalpop'] = $database->getVSumField($search[$i]['id'],"pop");
$search[$i]['aname'] = $database->getAllianceName($search[$i]['alliance']);
if($search[$i]['id']==0 or $search[$i]['id']==1){
$del = "<td></td>";
}else{
$del = '<td ><a href="?delete='.$search[$i]['id'].'"><img src="img/x.gif" class="del" title="cancel" alt="cancel"></a></td>';
}
echo' <tr>
<td class="ra fc">'.($i+1).'.</td>
<td class="pla "><a href="?uid='.$search[$i]['id'].'">'.$search[$i]['username'].'</a></td>
<td class="vil">'.$search[$i]['access'].'</td>
<td class="vil">'.$search[$i]['gold'].'</td>
<td class="vil">'.$search[$i]['email'].'</td>
<td class="al "><a href="?aid='.$search[$i]['alliance'].'">'.$search[$i]['aname'].'</a></td>
<td class="pop ">'.$search[$i]['totalpop'].'</td>
<td class="vil">'.$search[$i]['totalvillage'].'</td>
<td class="vil">'.$search[$i]['tribe'].'</td>
<td class="vil">'.date("H:m d.m.y",$search[$i]['timestamp']).'</td>
'.$del.'
</tr>
';
}
}
if($_POST['search_in']=="village"){
echo '<tr><td></td><td>Village</td><td>Owner</td><td><img src="img/x.gif" class="r1">Wood</td><td><img src="img/x.gif" class="r2">Clay</td><td><img src="img/x.gif" class="r3">Iron</td><td>Max store</td><td><img src="img/x.gif" class="r4">Crop</td><td>Max Crop</td><td>Pop</td><td>Capital</td></tr>';
for ($i = 0; $i <= count($search)-1; $i++) {
$owner = $database->getUserField($search[$i]['owner'],'username',0);
echo '<tr>
<td class="fc">'.($i+1).'.</td>
<td class="vil"><a href="?uid='.$search[$i]['wref'].'">'.$search[$i]['name'].'</a></td>
<td class="vil"><a href="?uid='.$search[$i]['owner'].'">'.$owner.'</td>
<td class="vil">'.$search[$i]['wood'].'</td>
<td class="vil">'.$search[$i]['clay'].'</td>
<td class="vil">'.$search[$i]['iron'].'</td>
<td class="vil">'.$search[$i]['maxstore'].'</td>
<td class="vil">'.$search[$i]['crop'].'</td>
<td class="vil">'.$search[$i]['maxcrop'].'</td>
<td class="vil">'.$search[$i]['pop'].'</td>
<td class="vil">'.$search[$i]['capital'].'</td>
</tr>';
//echo $search[$i]['name'].$search[$i]['owner']."<br>";
}
}
?>
</tbody>
</table>
+104
View File
@@ -0,0 +1,104 @@
<table id="player" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="15">Results in <?php echo $_GET['search_in'];?></th>
</tr>
</thead><tbody>
<?php
if($_GET['search_in']=="player"){
echo '<tr><td></td><td>Player</td><td>Access</td><td>Gold</td><td>Email</td><td>Alliance</td><td>Population</td>
<td>Villages</td><td>Tribe</td><td>Last activity</td><td></td></tr>';
$holder = array();
foreach($search as $value) {
$value['totalvillage'] = count($database->getVillagesID($value['id']));
$value['totalpop'] = $database->getVSumField($value['id'],"pop");
$value['aname'] = $database->getAllianceName($value['alliance']);
array_push($holder,$value);
}
$search = $multisort->sorte($holder, "'totalvillage'", false, 2, "'totalpop'", false, 2);
for ($i = 0; $i <= count($search)-1; $i++) {
if($search[$i]['id']==0 or $search[$i]['id']==1){
$del = "<td></td>";
}else{
$del = '<td ><a href="?delete='.$search[$i]['id'].'&where=user"><img src="img/x.gif" class="del" title="cancel" alt="cancel"></a></td>';
}
echo'<tr>
<td class="ra fc">'.($i+1).'.</td>
<td class="pla "><a href="?uid='.$search[$i]['id'].'">'.$search[$i]['username'].'</a></td>
<td class="vil">'.$search[$i]['access'].'</td>
<td class="vil">'.$search[$i]['gold'].'</td>
<td class="vil">'.$search[$i]['email'].'</td>
<td class="al "><a href="?aid='.$search[$i]['alliance'].'">'.$search[$i]['aname'].'</a></td>
<td class="pop ">'.$search[$i]['totalpop'].'</td>
<td class="vil">'.$search[$i]['totalvillage'].'</td>
<td class="vil">'.$search[$i]['tribe'].'</td>
<td class="pla">'.date("H:i d.m.y",$search[$i]['timestamp']).'</td>
'.$del.'
</tr>
';
}
}
if($_GET['search_in']=="village"){
foreach ($_GET as $value=>$el) {
if($value!="sort"){
$page .= $value."=".$el."&";
}
}
echo '<tr><td></td>
<td><a class="rn3" href="?'.$page.'sort=name">Village</a></td>
<td><a class="rn3" href="?'.$page.'sort=owner">Owner</a></td>
<td><a class="rn3" href="?'.$page.'sort=wood"><img src="img/x.gif" class="r1"> Wood</a></td>
<td><a class="rn3" href="?'.$page.'sort=clay"><img src="img/x.gif" class="r2"> Clay</a></td>
<td><a class="rn3" href="?'.$page.'sort=iron"><img src="img/x.gif" class="r3"> Iron</a></td>
<td><a class="rn3" href="?'.$page.'sort=maxstore">Max store</a></td>
<td><a class="rn3" href="?'.$page.'sort=crop"><img src="img/x.gif" class="r4"> Crop</a></td>
<td><a class="rn3" href="?'.$page.'sort=maxcrop">Max Crop</a></td>
<td><a class="rn3" href="?'.$page.'sort=pop">Pop</a></td>
<td><a class="rn3" href="?'.$page.'sort=capital">Capital</a></td>
</tr>
<tr><td colspan="15"></td></tr>';
$sort = $_GET['sort'];
if(!$sort){
$search = $multisort->sorte($search, "'pop'", false, 2);
}
else{
$search = $multisort->sorte($search, "'$sort'", true, 2);
}
for ($i = 0; $i <= count($search)-1; $i++) {
$owner = $database->getUserField($search[$i]['owner'],'username',0);
$owner_id = $database->getUserField($search[$i]['owner'],'id',0);
echo '<tr>
<td>'.($i+1).'.</td>
<td><a href="?wref='.$search[$i]['wref'].'">'.$search[$i]['name'].'</a></td>
<td><a href="?uid='.$search[$i]['owner'].'">'.$owner.'</a></td>
<td>'.$search[$i]['wood'].'</td>
<td>'.$search[$i]['clay'].'</td>
<td>'.$search[$i]['iron'].'</td>
<td>'.$search[$i]['maxstore'].'</td>
<td>'.$search[$i]['crop'].'</td>
<td>'.$search[$i]['maxcrop'].'</td>
<td>'.$search[$i]['pop'].'</td>
<td>'.$search[$i]['capital'].'</td>
</tr>';
}
}
?>
</tbody>
</table>
+46
View File
@@ -0,0 +1,46 @@
<?php
if($_GET['search_in']){
if(!$_GET['sort']){$sort = $_GET['search_in'];}
else{
$sort = $_GET['sort'];
}
$search = $database->search($_GET['search'],$_GET['search_in'],$sort);
}
?>
<form action="" method="get">
<input type="hidden" name="page" value="2">
<table id="member" >
<thead>
<tr><th colspan="3">
Search
</th></tr>
</thead>
<tbody>
<tr>
<td>
<select class="dropdown" name="search_in">
<option value="player" <?php if($_GET['search_in']=="player"){echo "selected";}?>>Search player</option>
<option value="village" <?php if($_GET['search_in']=="village"){echo "selected";}?>>Search villages</option>
<option value="alliance" <?php if($_GET['search_in']=="alliance"){echo "selected";}?>>Search alliances</option>
<option value="email" <?php if($_GET['search_in']=="email"){echo "selected";}?>>Search E-Mail addresses</option>
<option value="ip" <?php if($_GET['search_in']=="ip"){echo "selected";}?>>Search Ips</option>
<option value="del_players" <?php if($_GET['search_in']=="del_players"){echo "selected";}?>>Search deleted players</option>
</select>
</td>
<td>
<input type="text" class="text" name="search" value="<?php echo $_GET['search'];?>">
</td>
<td>
<input class="text" type="submit" value="Search">
</td>
</tr>
</tbody>
</table>
</form>
<br>
<?php
if($_GET['search'] or $_GET['search_in']){
include('templates/admin/results.tpl');
}
?>
+141
View File
@@ -0,0 +1,141 @@
<?php
$ranking->procRankReq($_GET);
$displayarray = $database->getUserArray($_GET['uid'],1);
$varray = $database->getProfileVillages($_GET['uid']);
$totalpop = 0;
foreach($varray as $vil) {
$totalpop += $vil['pop'];
}
?>
<div id="content" class="player" style="width:100%">
<table id="profile" cellpadding="1" cellspacing="1" >
<thead>
<tr>
<th colspan="2">Player <?php echo $displayarray['username']; ?> </th>
</tr>
<tr>
<td>Details</td>
<td>Description</td>
</tr>
</thead><tbody>
<tr>
<td class="empty"></td><td class="empty"></td>
</tr>
<tr>
<td class="details">
<table cellpadding="0" cellspacing="0">
<tr>
<th>Rank</th>
<td><?php echo $ranking->searchRank($displayarray['username'],"username"); ?></td>
</tr>
<tr>
<th>Tribe</th>
<td><?php
if($displayarray['tribe'] == 1) {
echo "Roman";
}
else if($displayarray['tribe'] == 2) {
echo "Teutons";
}
else if($displayarray['tribe'] == 3) {
echo "Gauls";
} ?></td>
</tr>
<tr>
<th>Alliance</th>
<td><?php if($displayarray['alliance'] == 0) {
echo "-";
}
else {
$displayalliance = $database->getAllianceName($displayarray['alliance']);
echo "<a href=\"?aid=".$displayarray['alliance']."\">".$displayalliance."</a>";
} ?></td>
</tr>
<tr>
<th>Villages</th>
<td><?php echo count($varray);?></td>
</tr>
<tr>
<th>Population</th>
<td><?php echo $totalpop; ?></td>
</tr>
<?php
if(isset($displayarray['birthday']) && $displayarray['birthday'] != 0) {
$age = date("Y")-substr($displayarray['birthday'],0,4);
echo "<tr><th>Age</th><td>$age</td></tr>";
}
if(isset($displayarray['gender']) && $displayarray['gender'] != 0) {
$gender = ($displayarray['gender']== 1)? "Male" : "Female";
echo "<tr><th>Gender</th><td>".$gender."</td></tr>";
}
if($displayarray['location'] != "") {
echo "<tr><th>Location</th><td>".$displayarray['location']."</td></tr>";
}
?>
<tr>
<td colspan="2" class="empty"></td>
</tr>
<tr>
<td colspan="2"> <a href="?edit=user&uid=<?php echo $_GET['uid'];?>">&raquo; Change profile</a></td>
</tr>
<tr>
<td colspan="2"> <a href="?action=message&amp;id=<?php echo $_GET['uid'];?>">&raquo; Write message</a></td>
</tr>
<tr>
<td colspan="2"> <a href="?uid=<?php echo $_GET['uid'];?>&delete=<?php echo $_GET['uid'];?>&where=user">&raquo; Delete player</a></td>
</tr>
<tr>
<td colspan="2"> <a href="?log_login=<?php echo $_GET['uid'];?>">&raquo; Login Log</a></td>
</tr>
<tr>
<td colspan="2" class="desc2">
<div class="desc2div"><?php echo $displayarray['desc1']; ?></div>
</td>
</tr>
</table>
</td>
<td class="desc1" >
<?php echo $displayarray['desc2']; ?>
</td>
</tr>
</tbody>
</table>
<br>
<table cellpadding="1" cellspacing="1" id="villages">
<thead>
<tr>
<th colspan="3">Villages</th>
</tr>
<tr>
<td>Name</td>
<td>Inhabitants</td>
<td>Coordinates</td>
</tr>
</thead><tbody>
<?php
if(count($varray)>0){
foreach($varray as $vil) {
$coor = $database->getCoor($vil['wref']);
echo "<tr><td class=\"nam\"><a href=\"?wref=".$vil['wref']."\">".$vil['name']."</a>";
if($vil['capital'] == 1) {
echo "<span class=\"none3\"> (capital)</span>";
}
echo "</td>";
echo "<td class=\"hab\">".$vil['pop']."</td><td class=\"aligned_coords\">";
echo "<div class=\"cox\">(".$coor['x']."</div><div class=\"pi\">|</div><div class=\"coy\">".$coor['y'].")</div></td></tr>";
}
}
else{
echo "<tr><td colspan=\"3\" class=\"none\">No village</td></tr>";
}
?>
</tbody></table>
+136
View File
@@ -0,0 +1,136 @@
<?php
$village = $database->getVillage($_GET['wref']);
?>
<div id="content" class="player" style="width:100%">
<table id="profile" cellpadding="1" cellspacing="1" >
<thead>
<tr>
<th colspan="2">Village: <a href="?wref=<?php echo $village['wref']; ?>"><?php echo $village['name']; ?></a> - user '<?php echo $village['owner']; ?>'</th>
</tr>
<tr>
<td>Details</td>
<td>Description</td>
</tr>
</thead><tbody>
<tr>
<td class="empty"></td><td class="empty"></td>
</tr>
<tr>
<td class="details">
<table cellpadding="0" cellspacing="0">
<tr>
<th>Wood</th>
<td><?php echo $village['wood']; ?></td>
</tr>
<tr>
<th>Clay</th>
<td><?php echo $village['clay']; ?></td>
</tr>
<tr>
<th>Iron</th>
<td><?php echo $village['iron']; ?></td>
</tr>
<tr>
<th>Max store</th>
<td><?php echo $village['maxstore']; ?></td>
</tr>
<tr>
<th>Crop</th>
<td><?php echo $village['crop']; ?></td>
</tr>
<tr>
<th>Max store</th>
<td><?php echo $village['maxcrop']; ?></td>
</tr>
<tr>
<th>Population</th>
<td><?php echo $village['pop']; ?></td>
</tr>
<tr>
<td colspan="2" class="empty"></td>
</tr>
<tr>
<td colspan="2"> <a href="?edit=user&uid=<?php echo $_GET['uid'];?>">&raquo; Change profile</a></td>
</tr>
<tr>
<td colspan="2"> <a href="?action=message&amp;id=<?php echo $_GET['uid'];?>">&raquo; Write message</a></td>
</tr>
<tr>
<td colspan="2"> <a href="#?uid=<?php echo $_GET['uid'];?>&delete=<?php echo $_GET['uid'];?>&where=user">&raquo; Delete player</a></td>
</tr>
</table>
</td>
<td class="details">
<table cellpadding="0" cellspacing="0">
<tr>
<th>Capital</th>
<td><?php echo $village['capital']; ?></td>
</tr>
<tr>
<th>Clay</th>
<td><?php echo $village['clay']; ?></td>
</tr>
<tr>
<th>Iron</th>
<td><?php echo $village['iron']; ?></td>
</tr>
<tr>
<th>Max store</th>
<td><?php echo $village['maxstore']; ?></td>
</tr>
<tr>
<th>Crop</th>
<td><?php echo $village['crop']; ?></td>
</tr>
<tr>
<th>Max store</th>
<td><?php echo $village['maxcrop']; ?></td>
</tr>
<tr>
<th>Population</th>
<td><?php echo $village['pop']; ?></td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<br>
<table id="villages" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="3">Villages:</th>
</tr>
<tr>
<td>Name</td>
<td>Inhabitants</td>
<td>Coordinates</td>
</tr>
</thead><tbody>
<?php
$villages = $database->getProfileVillages($village['owner']);
foreach($villages as $vil){
$coor = $database->getCoor($vil['wref']);
if($vil['capital']==1) {$cap = '<span class="none3">(capital)</span>';} else{$cap = "";}
echo '
<tr>
<td class="nam"><a href="?wref='.$vil['wref'].'">'.$vil['name'].'</a> '.$cap.'</td>
<td class="hab">'.$vil['pop'].'</td>
<td class="aligned_coords">
<div class="cox">('.$coor['x'].'</div>
<div class="pi">|</div>
<div class="coy">'.$coor['y'].')</div>
</td>
</tr>'; }
?>
</tbody></table>
+35
View File
@@ -0,0 +1,35 @@
<?php
$log = $database->getUser_log($_GET['log_login']);
?>
<table cellpadding="1" cellspacing="1" id="player">
<thead>
<tr>
<th colspan="10">User id <?php echo $_GET['log_login'];?> login log</th>
</tr>
<tr><td></td><td>Player</td><td>IP</td><td>Time</td><td></td></tr>
</thead><tbody>
<?php
if(count($log)>0) {
for ($i = 0; $i < count($log); $i++) {
//$del = '<td class="vil"><a href="?delete='.$log[$i]['id'].'&where=login_log"><img src="img/x.gif" class="del" title="cancel" alt="cancel"></a></td>';
if(!$del){$del = '<td></td>';}
$id = $i+1;
echo "<tr><td class=\"ra \" >".$id.".</td>";
echo "<td><a href=\"?uid=".$log[$i]['id']."\">".$database->getUserField($log[$i]['uid'],'username',0)."</a></td>";
echo "<td>".$log[$i]['ip']."</td>";
echo "<td>".date("d.m.y H:i:s",$log[$i]['time'])."</td>";
echo $del;
echo "</tr>";
}
}
else {
echo "<tr><td class=\"none\" colspan=\"7\">No logs</td></tr>";
}
?>
</tbody>
</table>
+217
View File
@@ -0,0 +1,217 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename ban.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<style>
.del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
</style>
<form action="" method="get">
<input name="action" type="hidden" value="addBan">
<table id="member" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="6">Ban</th>
</tr>
</thead>
<tr>
<td>User ID</td>
<td>
<input type="text" class="fm" name="uid" value="<?php echo $_GET['uid'];?>">
</td>
</tr>
<tr>
<td>Reason</td>
<td>
<select name="reason" class="fm">
<?php
$arr = array('Pushing','Cheat','Hack','Bug','Bad Name','Multi Account','Swearing');
foreach($arr as $r){
echo '<option value="'.$r.'">'.$r.'</option>';
}
?>
</select>
</td>
</tr>
<tr>
<td>Time</td>
<td>
<select name="time" class="fm">
<?php
$arr = array(1,2,5,10,12);
foreach($arr as $r){
echo '<option value="'.($r*3600).'">'.$r.' hour/s</option>';
}
$arr2 = array(1,2,5,10,30,50,90);
foreach($arr2 as $r){
echo '<option value="'.($r*3600*24).'">'.$r.' day/s</option>';
}
echo '<option value="">Forever</option>';
?>
</select>
</td>
</tr>
<tr>
<td colspan="2" class="on"><input type="submit" value="Save"></td>
</tr>
</table>
</form>
<?php
$bannedUsers = $admin->search_banned();
?>
<br>
<table id="member" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th colspan="6">Ban List</th>
</tr>
</thead><tbody>
<tr>
<td><b>Username</b></td>
<td><b>Length (from/to)</b></td>
<td><b>Reason</b></td>
<td></td>
</tr>
<?php
if($bannedUsers){
for ($i = 0; $i <= count($bannedUsers)-1; $i++) {
if($database->getUserField($bannedUsers[$i]['uid'],'username',0)==''){
$name = $bannedUsers[$i]['name'];
$link = "<span class=\"c b\">[".$name."]</span>";
}else{
$name = $database->getUserField($bannedUsers[$i]['uid'],'username',0);
$link = '<a href="?p=player&uid='.$bannedUsers[$i]['uid'].'">'.$name.'<a/>';
}
if($bannedUsers[$i]['end']){$end = date("d.m.y H:i",$bannedUsers[$i]['end']);}else{$end = '*';}
echo '
<tr>
<td>'.$link.'</td>
<td ><span class="f7">'.date("d.m.y H:i",$bannedUsers[$i]['time']).' - '.$end.'</td>
<td>'.$bannedUsers[$i]['reason'].'</td>
<td class="on"><a href="?action=delBan&uid='.$bannedUsers[$i]['uid'].'&id='.$bannedUsers[$i]['id'].'" onClick="return del(\'unban\',\''.$name.'\')"><img src="../img/Admin/del.gif" class="del" title="cancel" alt="cancel"></img></a></td>
</tr>
';
}
}else{
echo '<tr><td colspan="6" class="on">No results...</td></tr>';
}
?>
</tbody>
</table>
+38
View File
@@ -0,0 +1,38 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename ban_msq.tpl ##
## Developed by: yi12345 ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
$ban = mysql_query("SELECT * FROM ".TB_PREFIX."banlist WHERE `uid` = '".$session->uid."'");
$ban1 = mysql_fetch_array($ban);
?>
<p></br>
Hello <?php echo $ban1['name']; ?>!
You have been banned due to a violation of the rules.
</br><?php
if ($ban1['reason']=='Pushing') {
echo "Every player may only own and play one account on each server."; }
if ($ban1['reason']=='Cheat') {
echo "Every player may only own and play one account on each server."; }
if ($ban1['reason']=='Hack') {
echo "Every player may only own and play one account on each server."; }
if ($ban1['reason']=='Bug') {
echo "Every player may only own and play one account on each server."; }
if ($ban1['reason']=='Bad Name') {
echo "Every player may only own and play one account on each server."; }
if ($ban1['reason']=='Multi Account') {
echo "Every player may only own and play one account on each server."; }
if ($ban1['reason']=='Swearing') {
echo "Every player may only own and play one account on each server."; }
?>
</br></br> To ensure that you won't get banned again in the future, you shuold read the rules carefully:
</br></br> <?php echo "<a class=\"rules\" href=\"rules.php\">» Game rules"; ?>
</br></br></br>
</p>
+506
View File
@@ -0,0 +1,506 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename config.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
mysql_connect(SQL_SERVER, SQL_USER, SQL_PASS);
mysql_select_db(SQL_DB);
if ($_SESSON['access'] == MULTIHUNTER) die("<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><b><font color='Red'><center>Access Denied: You are not admin</b></font></center>");
?>
<style>
.del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
</style>
<h2><center>Made by Dzoki</center></h2>
<table id="member">
<thead>
<tr>
<th>~ Server Settings ~</th>
</tr>
</thead>
</table>
<table id="profile">
<tr>
<td class="b">Variable</td>
<td class="b">Value</td>
</tr>
<tr>
<td>Server Name</td>
<td><?php echo SERVER_NAME;?></td>
</tr>
<tr>
<td>Server Started</td>
<td><?php echo date("d.m.y H:i",COMMENCE);?></td>
</tr>
<tr>
<td>Language</td>
<td><?php if(LANG == en){
echo "English";
} ?></td>
</tr>
<tr>
<td>Server Speed</td>
<td><?php echo ''.SPEED.'x';?></td>
</tr>
<tr>
<td>Map Size</td>
<td><?php echo WORLD_MAX;?>x<?php echo WORLD_MAX;?></td>
</tr>
<tr>
<td>Troop Speed</td>
<td><?php echo INCREASE_SPEED;?>x</td>
</tr>
<tr>
<td>Village Expanding Speed</td>
<td><?php if(CP == 0){
echo "Fast";
}
else if(CP == 1){
echo "Slow";
} ?></td>
</tr>
<tr>
<td>Beginners Protection</td>
<td><?php echo (PROTECTION/3600);?> hour/s</td>
</tr>
<tr>
<td>Activation Mail</td>
<td><?php if(AUTH_EMAIL == true) {
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(AUTH_EMAIL == false){
echo "<b><font color='Red'>Disabled</font></b>";
}
?></td>
</tr>
<tr>
<td>Quest</td>
<td><?php
if(QUEST == true) {
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(QUEST == false) {
echo "<b><font color='Red'>Disabled</font></b>";
} ?></td>
</tr>
<tr>
<td>Demolish - Level required</td>
<td><?php echo DEMOLISH_LEVEL_REQ; ?></td>
</tr>
<tr>
<td>World Wonder - Statistics</td>
<td><?php
if(WW == true) {
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(WW == false) {
echo "<b><font color='Red'>Disabled</font></b>";
} ?></td>
</tr>
<tr>
<td><b><font color='#71D000'>P</font><font color='#FF6F0F'>l</font><font color='#71D000'>u</font><font color='#FF6F0F'>s</font></b> account duration</td>
<td><?php if(PLUS_TIME >= 86400){
echo ''.(PLUS_TIME/86400).' Days';
} else if(PLUS_TIME < 86400){
echo ''.(PLUS_TIME/3600).' Hours';
} ?></td>
</tr>
<tr>
<td>+25% production duration</td>
<td><?php if(PLUS_PRODUCTION >= 86400){
echo ''.(PLUS_PRODUCTION/86400).' Days';
} else if(PLUS_PRODUCTION < 86400){
echo ''.(PLUS_PRODUCTION/3600).' Hours';
} ?></td>
</tr>
</table>
<table id="member">
<thead>
<tr>
<th>~ Log Settings ~</th>
</tr>
</thead>
</table>
<table id="profile">
<tr>
<td class="b">Variable</td>
<td class="b">Value</td>
</tr>
<tr>
<td>Log Build</td>
<td><?php if(LOG_BUILD == true) {
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(LOG_BUILD == false){
echo "<b><font color='Red'>Disabled</font></b>";
}
?></td>
</tr>
<tr>
<td>Log Technology</td>
<td><?php if(LOG_TECH == true) {
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(LOG_TECH == false){
echo "<b><font color='Red'>Disabled</font></b>";
}
?></td>
</tr>
<tr>
<td>Log Login</td>
<td><?php if(LOG_LOGIN == true) {
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(LOG_LOGIN == false){
echo "<b><font color='Red'>Disabled</font></b>";
}
?></td>
</tr>
<tr>
<td>Log Gold</td>
<td><?php if(LOG_GOLD_FIN == true) {
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(ALOG_GOLD_FIN == false){
echo "<b><font color='Red'>Disabled</font></b>";
}
?></td>
</tr>
<tr>
<td>Log Admin</td>
<td><?php if(LOG_ADMIN == true) {
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(LOG_ADMIN == false){
echo "<b><font color='Red'>Disabled</font></b>";
}
?></td>
</tr>
<tr>
<td>Log War</td>
<td><?php if(LOG_WAR == true) {
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(LOG_WAR == false){
echo "<b><font color='Red'>Disabled</font></b>";
}
?></td>
</tr>
<tr>
<td>Log Market</td>
<td><?php if(LOG_MARKET == true) {
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(LOG_MARKET == false){
echo "<b><font color='Red'>Disabled</font></b>";
}
?></td>
</tr>
<tr>
<td>Log Illegal</td>
<td><?php if(LOG_ILLEGAL == true) {
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(LOG_ILLEGAL == false){
echo "<b><font color='Red'>Disabled</font></b>";
}
?></td>
</tr>
</table>
<table id="member">
<thead>
<tr>
<th>~ Newsbox Settings ~</th>
</tr>
</thead>
</table>
<table id="profile">
<tr>
<td class="b">Variable</td>
<td class="b">Value</td>
</tr>
<tr>
<td>Newsbox 1</td>
<td><?php if(NEWSBOX1 == true){
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(NEWSBOX1 == false){
echo "<b><font color='Red'>Disabled</font></b>";
} ?> </td>
</tr>
<tr>
<td>Newsbox 2</td>
<td><?php if(NEWSBOX2 == true){
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(NEWSBOX2 == false){
echo "<b><font color='Red'>Disabled</font></b>";
} ?> </td>
</tr>
<tr>
<td>Newsbox 3</td>
<td><?php if(NEWSBOX3 == true){
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(NEWSBOX3 == false){
echo "<b><font color='Red'>Disabled</font></b>";
} ?> </td>
</tr>
<td>Home 1</td>
<td><?php if(HOME1 == true){
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(HOME1 == false){
echo "<b><font color='Red'>Disabled</font></b>";
} ?> </td>
</tr>
<td>Home 2</td>
<td><?php if(HOME2 == true){
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(HOME2 == false){
echo "<b><font color='Red'>Disabled</font></b>";
} ?> </td>
</tr>
<td>Home 3</td>
<td><?php if(HOME3 == true){
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(HOME3 == false){
echo "<b><font color='Red'>Disabled</font></b>";
} ?> </td>
</tr>
</table>
<table id="member">
<thead>
<tr>
<th>~ SQL Settings ~</th>
</tr>
</thead>
<table id="profile">
<tr>
<td class="b">Variable</td>
<td class="b">Value</td>
</tr>
<tr>
<td>Hostname</td>
<td><?php echo SQL_SERVER;?></td>
</tr>
<tr>
<td>DB Username</td>
<td><?php echo SQL_USER;?></td>
</tr>
<tr>
<td>DB Password</td>
<td>*********</td>
</tr>
<tr>
<td>DB Name</td>
<td><?php echo SQL_DB;?></td>
</tr>
<tr>
<td>Table Prefix</td>
<td><?php echo TB_PREFIX;?></td>
</tr>
<tr>
<td>DB Type</td>
<td><?php
if(DB_TYPE == 0) {
echo "MYSQL";
}
else if(DB_TYPE == 1) {
echo "MYSQLi";
} ?></td>
</tr>
</table>
<table id="member">
<thead>
<tr>
<th>~ Extra Settings ~</th>
</tr>
</thead>
<table id="profile">
<tr>
<td class="b">Variable</td>
<td class="b">Value</td>
</tr>
<tr>
<td>Limit Mailbox</td>
<td><?php if(LIMIT_MAILBOX == true){
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(LIMIT_MAILBOX == false){
echo "<b><font color='Red'>Disabled</font></b>";
} ?></td>
</tr>
<tr>
<td>Max number of mails</td>
<td><?php if(LIMIT_MAILBOX == true){
echo MAX_MAIL;
}
else if(LIMIT_MAILBOX == false){
echo "<font color='Gray'>Limit mailbox disabled</font>";
} ?></td>
</tr>
<tr>
<td>Include Admin in rank</td>
<td><?php if(INCLUDE_ADMIN == true){
echo "<b><font color='Green'>Enabled</font></b>";
}
else if(INCLUDE_ADMIN == false){
echo "<b><font color='Red'>Disabled</font></b>";
} ?></td>
</tr>
</table>
<table id="member">
<thead>
<tr>
<th>~ Admin Information ~</th>
</tr>
</thead>
<table id="profile">
<tr>
<td class="b">Variable</td>
<td class="b">Value</td>
</tr>
<tr>
<td>Admin Email</td>
<td><?php if(ADMIN_EMAIL == ''){
echo "<b><font color='Red'>No admin email defined!</b></font>";
}
else if(ADMIN_EMAIL != ''){
echo ADMIN_EMAIL;
} ?></td>
</tr>
<tr>
<td>Admin Name</td>
<td><?php if(ADMIN_NAME == ''){
echo "<b><font color='Red'>No admin name defined!</b></font>";
}
else if(ADMIN_NAME != ''){
echo ADMIN_NAME;
} ?></td>
</tr>
</table>
<?php
function define_array( $array, $keys = NULL )
{
foreach( $array as $key => $value )
{
$keyname = ($keys ? $keys . "_" : "") . $key;
if( is_array( $array[$key] ) )
define_array( $array[$key], $keyname );
else
define( $keyname, $value );
}
}
//define_array($array);
?>
+114
View File
@@ -0,0 +1,114 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletion.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<style>
.del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
</style>
<?php
if($_GET['uid']){
$user = $database->getUserArray($_GET['uid'],1);
$varray = $database->getProfileVillages($_GET['uid']);
if($user){
$totalpop = 0;
foreach($varray as $vil) {
$totalpop += $vil['pop'];
}
?>
<form action="" method="post">
<input type="hidden" name="action" value="DelPlayer">
<input type="hidden" name="uid" value="<?php echo $user['id'];?>">
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
<table id="member">
<thead>
<tr>
<th colspan="4">Delete player</th>
</tr>
</thead>
<tr>
<td>Name:</td>
<td><a href="?p=player&uid=<?php echo $user['id'];?>"><?php echo $user['username'];?></a></td>
<td>Gold:</td>
<td><?php echo $user['gold'];?></td>
</tr>
<tr>
<td>Rank:</td>
<td>???.</td>
<td>Population:</td>
<td><?php echo $totalpop;?></td>
</tr>
<tr>
<td>Villages:</td>
<td><?php
$result = mysql_query("SELECT SQL_CACHE * FROM ".TB_PREFIX."vdata WHERE owner = ".$user['id']."");
$num_rows = mysql_num_rows($result);
echo $num_rows;
?></td>
<td><b><font color='#71D000'>P</font><font color='#FF6F0F'>l</font><font color='#71D000'>u</font><font color='#FF6F0F'>s</font></b>:</td>
<td><?php
$plus = date('d.m.Y H:i',$user['plus']);
echo $plus;?></td>
</tr>
<tr>
<td>Alliance:</td>
<td><?php echo $database->getAllianceName($user['alliance']);?></td>
<td>Status:</td>
<td>-</td>
</tr>
<tr>
<td colspan="4" class="empty"></td>
</tr>
<tr>
<td>Password:</td>
<td><input type="text" name="pass"></td>
<td colspan="2"><input type="submit" class="c5" value="Delete player"></td>
</tr>
</table>
<br /><br /><font color="Red"><b>NOTICE: DELETE ALL PLAYER VILLAGES BELLOW BEFORE DELETING PLAYER!</font></b><br /><br />
<table id="profile">
<tr>
<td>Name</td>
<td>Population</td>
<td>Coordinates</td>
<td></td>
</tr>
<?php
for ($i = 0; $i <= count($varray)-1; $i++) {
$coorproc = $database->getCoor($varray[$i]['wref']);
if($varray[$i]['capital']){
$capital = '<span class="c">(Capital)</span>';
$delLink = '<a href="?action=delVil&did='.$varray[$i]['wref'].'" onClick="return del(\'did\','.$varray[$i]['wref'].');"><img src="../img/Admin/del.gif" class="del"></a>';
}else{
$capital = '';
$delLink = '<a href="?action=delVil&did='.$varray[$i]['wref'].'" onClick="return del(\'did\','.$varray[$i]['wref'].');"><img src="../img/Admin/del.gif" class="del"></a>';
}
echo '
<tr>
<td><a href="?p=village&did='.$varray[$i]['wref'].'">'.$varray[$i]['name'].'</a> '.$capital.'</td>
<td>'.$varray[$i]['pop'].' <a href="?action=recountPop&did='.$varray[$i]['wref'].'">Check<a/></td>
<td>('.$coorproc['x'].'|'.$coorproc['y'].')</td>
<td>'.$delLink.' </td>
</tr>
';
}
?>
</form>
<?php
}
}
?>
+125
View File
@@ -0,0 +1,125 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename deletion.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
$id = $_GET['uid'];
if(isset($id)){
$user = $database->getUserArray($id,1);
$varray = $database->getProfileVillages($id);
$varmedal = $database->getProfileMedal($id);
?>
<br />
<form action="../GameEngine/Admin/Mods/editUser.php" method="POST">
<input type="hidden" name="uid" value="<?php echo $uid; ?>" />
<input type="hidden" name="id" value="<?php echo $id; ?>" />
<table id="profile" cellpadding="1" cellspacing="1" >
<thead>
<tr>
<th colspan="2">Player <a href="admin.php?p=player&uid=<?php echo $user['id'];?>"><?php echo $user['username'];?></a></th>
</tr>
<tr>
<td>Details</td>
<td>Description</td>
</tr>
</thead><tbody>
<tr>
<td class="empty"></td><td class="empty"></td>
</tr>
<tr>
<td class="details">
<table cellpadding="0" cellspacing="0">
<tr><th>Tribe</th>
<td><select name="tribe">
<option value="1" <?php if($user['tribe'] == 1) { echo "selected='selected'"; } else { echo ''; } ?>>Roman</option>
<option value="2" <?php if($user['tribe'] == 2) { echo "selected='selected'"; } else { echo ''; } ?>>Teuton</option>
<option value="3" <?php if($user['tribe'] == 3) { echo "selected='selected'"; } else { echo ''; } ?>>Gaul</option>
</select></td>
</tr>
<?php
echo "<tr><th>Location</th><td><input class=\"fm\" name=\"location\" value=\"".$user['location']."\"></td></tr>";
echo "<tr><th>Email</th><td><input class=\"fm\" name=\"email\" value=\"".$user['email']."\"></td></tr>";
echo '<tr><td colspan="2" class="empty"></td></tr>';
echo '<tr><td colspan="2"><a href="?p=player&uid='.$user['id'].'"><span class="rn2" >&raquo;</span> Go back</a></td></tr>';
echo '<tr><td colspan="2" class="empty"></td></tr>';
echo '<tr><td colspan="2" class="desc2"><textarea cols="25" rows="14" tabindex="1" name="desc1">'.nl2br($user['desc1']).'</textarea></td></tr>';
?>
</table>
</td>
<td class="desc1">
<textarea tabindex="8" cols="30" rows="20" name="desc2"><?php echo nl2br($user['desc2']); ?></textarea>
</td>
</tr>
<tr><td colspan="2" class="empty"></td></tr>
</tbody>
</table>
<p>
<table cellspacing="1" cellpadding="2" class="tbg">
<tr><td class="rbg" colspan="4">Medals</td></tr>
<tr>
<td>Category</td>
<td>Rang</td>
<td>Week</td>
<td>BB-Code</td>
</tr>
<?php
/******************************
INDELING CATEGORIEEN:
===============================
== 1. Aanvallers top 10 ==
== 2. Defence top 10 ==
== 3. Klimmers top 10 ==
== 4. Overvallers top 10 ==
== 5. In att en def tegelijk ==
== 6. in top 3 - aanval ==
== 7. in top 3 - verdediging ==
== 8. in top 3 - klimmers ==
== 9. in top 3 - overval ==
******************************/
foreach($varmedal as $medal) {
$titel="Bonus";
switch ($medal['categorie']) {
case "1":
$titel="Attacker of the Week";
break;
case "2":
$titel="Defender of the Week";
break;
case "3":
$titel="Climber of the week";
break;
case "4":
$titel="Robber of the week";
break;
}
echo"<tr>
<td> ".$titel."</td>
<td>".$medal['plaats']."</td>
<td>".$medal['week']."</td>
<td>[#".$medal['id']."]</td>
</tr>";
} ?>
<tr>
<td>Beginners Protection</td>
<td></td>
<td></td>
<td>[#0]</td>
</tr>
</table></p>
<center><button>OK</button></p>
</center></form>
<?php } ?>
+26
View File
@@ -0,0 +1,26 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename gold.php ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
?>
<?php $id = $_SESSION['id']; ?>
<form action="../GameEngine/Admin/Mods/gold.php" method="POST">
<input type="hidden" name="id" id="id" value="<?php echo $id; ?>">
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<center><b>How much gold do you want to give to the users?</b></center>
<center><br /><input class="give_gold" name="gold" id="gold" value="20" maxlength="4">&nbsp;<img src="../img/admin/gold.gif" class="gold" alt="Gold" title="Gold"/>&nbsp;&nbsp;<font color="gray" size="1">insert number and press 'enter'</center></form>
<?php
if(isset($_GET['g'])) {
echo '<br /><br /><font color="Red"><b>Gold Added</font></b>';
}
?>
+29
View File
@@ -0,0 +1,29 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename home.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<br />
<font size="3"><b><center>
WELCOME TO <?php if($_SESSION['access'] == MULTIHUNTER) { echo 'MULTIHUNTER';
} else if($_SESSION['access'] == ADMIN){ echo 'ADMINISTRATOR'; } ?> CONTROL PANEL
</center></b></font>
<br /><br /><br /><br />
Hello <b><?php echo $_SESSION['username']; ?></b>,<br /><br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;You are logged in as: <?php if($_SESSION['access'] == MULTIHUNTER) { echo '<b><font color="Blue">Multihunter</font></b>';
} else if($_SESSION['access'] == ADMIN){ echo '<b><font color="Red">Administrator</font></b>'; } ?></center>
<br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></b>
<font color="#c5c5c5" size="1">Credits: Akakori & Elmar<br />
Fixed, remade and new features added by <b>Dzoki</b>
</font>
+53
View File
@@ -0,0 +1,53 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename login.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<div align="center"><img src="../img/admin/admin.gif" width="468" height="60" border="0"></div>
<p>Login to control panel:</p>
<form method="post" action="admin.php">
<input type="hidden" name="action" value="login">
<p class="old_p1">
<table width="100%" cellspacing="1" cellpadding="0">
<tr><td><label>Username:</label>
<input class="fm fm110" type="text" name="name" value="<?php echo $_SESSION['username']?>" maxlength="15"> <span class="e f7"></span>
</td></tr>
<tr><td><label>Password:</label>
<input class="fm fm110" type="password" name="pw" value="" maxlength="20"> <span class="e f7"></span>
</td></tr>
</table>
</p>
<p align="center"><input type="image" border="0" src="../img/admin/b/l1.gif" width="80" height="20">
<img align="right" src="../img/admin/senator_roemer.png" width="450" height="620">
</form>
+76
View File
@@ -0,0 +1,76 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<head>
<link REL="shortcut icon" HREF="favicon.ico"/>
<title><?php
if($_SESSION['access'] == ADMIN) {
echo 'Admin Control Panel - TravianX';
} else
if($_SESSION['access'] == MULTIHUNTER) {
echo 'Multihunter 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>
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename login_log.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
?>
<br>
<table cellpadding="1" cellspacing="1" id="member">
<thead>
<tr>
<th colspan="4">User login log</th>
</tr>
<tr><td>ID</td><td>Username</td><td>IP</td><td>Time</td></tr>
</thead><tbody>
<?php
$no = count($database->getLoginLog());
$log = $database->getLoginLog();
for ($i = 0; $i < $no; $i++) {
$userid = $log[$i]['uid'];
$username = $database->getUserField($userid, "username", 0);
echo "<tr>";
echo "<td>".$log[$i]['id']."</td>";
echo "<td><a href=\"admin.php?p=player&uid=".$userid."\">".$username."</a>";
echo "<td>".$log[$i]['ip']."</td>";
echo "<td>".date("d.m.Y H:i", $log[$i]['time'])."</td>";
echo "</tr>";
}
echo "</tbody></table>\n";
?>
+44
View File
@@ -0,0 +1,44 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename map.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
comming soon
<div>
<img style="border: 1px solid blue;" src="img/x.gif" usemap="#mymap" alt="imagemap" border="0" height="525 width="525">
</div>
<map name="mymap">
<?php
function line($x,$W){
$a = 0;
for ($i = 0; $i <= $x; $i++) {
$X = $W.'-'.$i;
$c += 25;
$d = $W*25+25;
$b = 25*($W-1);
echo '<area shape="rect" coords="'.$a.','.$b.','.$c.','.$d.'" href="?x='.$W.'&y='.$i.'" alt="frames">';
$a += 25;
}
}
function map($x,$y){
for ($i = 0; $i <= $y; $i++) {
line($x,$i);
}
}
map(20,20);
?>
</map>
+67
View File
@@ -0,0 +1,67 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename message.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<style>
.del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
</style>
<table id="member" style="width:225px">
<thead>
<tr>
<th colspan="2">IGM/Reports</th>
</tr>
</thead>
<tr>
<td>IGM ID</td>
<td><form action="" method="get"><input type="hidden" name="p" value="message"><input type="text" class="fm" name="nid" value="<?php echo $_GET['nid'];?>"> <input type="submit" value="ok"></form></td>
</tr>
<tr>
<td>Report ID</td>
<td><form action="" method="get"><input type="hidden" name="p" value="message"><input type="text" class="fm" name="bid" value="<?php echo $_GET['bid'];?>"> <input type="submit" value="ok"></form></td>
</tr>
</table><br>
<?php
error_reporting(0);
if($_GET['nid'] and ereg('^[0-9]', $_GET['nid'])){
include('msg.tpl');
}elseif($_GET['bid'] and ereg('^[0-9]', $_GET['bid'])){
include('report.tpl');
}
?>
+42
View File
@@ -0,0 +1,42 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename msg.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
$msg = $database->getMessage($_GET['nid'],3);;
if($msg){
?>
<div id="content" class="messages">
<h1>Messages</h1>
<div id="read_head" class="msg_head"></div>
<div id="read_content" class="msg_content">
<img src="img/x.gif" id="label" class="read" alt="">
<div id="heading">
<div><span class="b">From</span>: <?php echo $database->getUserField($msg[0]['owner'],'username',0);?></div>
<div><span class="b">To</span>: <?php echo $database->getUserField($msg[0]['target'],'username',0);?></div>
<div><span class="b">Topic</span>: <?php echo $msg[0]['topic'];?>
<div style="float:right;"><?php echo date('d.m.y H:i',$msg[0]['time']);?></div>
</div>
</div>
<div class="clear"></div>
<div id="line"></div>
<div class="message" style="margin-top: 10px;">
<?php echo $msg[0]['message'];?>
</div>
</div>
<div id="read_foot" class="msg_foot"></div>
</form>
</div>
<?php
}else{
echo "Message id ".$_GET['nid']." wasn´t found.";
}
?>
+51
View File
@@ -0,0 +1,51 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename natarstart.php ##
## Developed by: advocaite ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
if($_SESSION['access'] < ADMIN) die("Access Denied: You are not Admin!");
?>
<?php $id = $_SESSION['id']; ?>
<form action="../GameEngine/Admin/Mods/natarend.php" method="POST">
<input type="hidden" name="id" id="id" value="<?php echo $id; ?>">
<br /><br /><br /><br /><br /><br /><br /><br /><br />
<center><b>Create World Wonder villages?</b></center>
<center><br /><input class="give_gold" name="vill_amount" id="vill_amount" value="10" maxlength="4">&nbsp;<img src="http://forum.ragezone.com/f583/img/admin/gold.gif" class="gold" alt="gold" title="gold"/>&nbsp;&nbsp;<font color="gray" size="1">insert number of Wonders and press 'enter'</center></form>
<?php
if(isset($_GET['g'])) {
echo '<br /><br /><font color="Red"><b>World Wonders Added</font></b>';
}
?>
+67
View File
@@ -0,0 +1,67 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename online.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
$active = $admin->getUserActive();
?>
<style>
.del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
</style>
<table id="member">
<thead>
<tr>
<th colspan="6">Online users (<?php echo count($active);?>)</th>
</tr>
</thead>
<tr>
<td>Name [access]</td>
<td>Time</td>
<td>Tribe</td>
<td>Pop</td>
<td>Villages</td>
<td>Gold</td>
</tr>
<?php
if($active){
for ($i = 0; $i <= count($active)-1; $i++) {
$uid = $database->getUserField($active[$i]['username'],'id',1);
$varray = $database->getProfileVillages($uid);
$totalpop = 0;
foreach($varray as $vil) {
$totalpop += $vil['pop'];
}
if($active[$i]['tribe'] == 1){
$tribe = "Roman";
} else if($active[$i]['tribe'] == 2){
$tribe = "Teuton";
} else if($active[$i]['tribe'] == 3){
$tribe = "Gaul";
}
echo '
<tr>
<td><a href="?p=player&uid='.$uid.'">'.$active[$i]['username'].' ['.$active[$i]['access'].']</a></td>
<td>'.date("d.m.y H:i:s",$active[$i]['timestamp']).'</td>
<td>'.$tribe.'</td>
<td>'.$totalpop.'</td>
<td>'.count($varray).'</td>
<td><img src="../img/admin/gold.gif" class="gold" alt="Gold" title="This user has: '.$active[$i]['gold'].' gold"/> '.$active[$i]['gold'].'</td>
</tr>
';
}
}else{
echo '<tr><td colspan="6" class="hab">No online users</td></tr>';
}
?>
</table>
+377
View File
@@ -0,0 +1,377 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename player.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
$id = $_GET['uid'];
if(isset($id)){
$user = $database->getUserArray($id,1);
$varray = $database->getProfileVillages($id);
if($user){
$totalpop = 0;
foreach($varray as $vil) {
$totalpop += $vil['pop'];
}
include('search2.tpl');
?>
<?php
$deletion = false;
if($deletion){
?>
<table id="member" cellpadding="1" cellspacing="1">
<tr>
<td>The account will be deleted in <span class="c2">79:56:11</span>
<a href="?action=StopDel&uid=<?php echo $user['id'];?>" onClick="return del('stopDel','<?php echo $user['username'];?>');"><img src="img/x.gif" class="del"></a>
</td>
</tr>
</table>
<?php
}
?>
<br>
<table id="profile" cellpadding="1" cellspacing="1" >
<thead>
<tr>
<th colspan="2">Player <a href="admin.php?p=player&uid=<?php echo $user['id'];?>"><?php echo $user['username'];?></a></th>
</tr>
<tr>
<td>Details</td>
<td>Description</td>
</tr>
</thead><tbody>
<tr>
<td class="empty"></td><td class="empty"></td>
</tr>
<tr>
<td class="details">
<table cellpadding="0" cellspacing="0">
<tr>
<th>Rank</th>
<td><?php //echo $ranking->searchRank($displayarray['username'],"username"); ?></td>
</tr>
<tr>
<th>Tribe</th>
<td><?php
if($user['tribe'] == 1) {
echo "Roman";
}
else if($user['tribe'] == 2) {
echo "Teutons";
}
else if($user['tribe'] == 3) {
echo "Gauls";
}
else if($user['tribe'] == 4) {
echo "Natars";
} ?></td>
</tr>
<tr>
<th>Alliance</th>
<td>
<?php if($user['alliance'] == 0) {
echo "-";
}
else {
echo "<a href=\"?p=alliance&aid=".$user['alliance']."\">".$database->getAllianceName($user['alliance'])."</a>";
} ?>
</td>
</tr>
<tr>
<th>Villages</th>
<td><?php echo count($varray);?></td>
</tr>
<tr>
<th>Population</th>
<td><?php echo $totalpop;?> <a href="?action=recountPopUsr&uid=<?php echo $user['id'];?>">Recount</a></td>
</tr>
<?php
if(isset($user['birthday']) && $user['birthday'] != 0) {
$age = date("Y")-substr($user['birthday'],0,4);
echo "<tr><th>Age</th><td>$age</td></tr>";
}
if(isset($user['gender']) && $user['gender'] != 0) {
$gender = ($user['gender']== 1)? "Male" : "Female";
echo "<tr><th>Gender</th><td>".$gender."</td></tr>";
}
echo "<tr><th>Location</th><td><input disabled class=\"fm\" name=\"location\" value=\"".$user['location']."\"></td></tr>";
echo "<tr><th><b><font color='#71D000'>P</font><font color='#FF6F0F'>l</font><font color='#71D000'>u</font><font color='#FF6F0F'>s</font></b></th><td>";
if(date('d.m.Y H:i',$user['plus']) == '01.01.1970 00:00') {
echo "Not enabled!</tr></th>";
} else { echo "".date('d.m.Y H:i',$user['plus']+3600*2)."</tr></th>"; }
echo "<tr><th>Email</th><td><input disabled class=\"fm\" name=\"email\" value=\"".$user['email']."\"></td></tr>";
echo '<tr><td colspan="2" class="empty"></td></tr>';
if($_SESSION['access'] == ADMIN){
echo '<tr><td colspan="2"><a href="?p=editUser&uid='.$user['id'].'">&raquo; Change profile</a></td></tr>';
} else if($_SESSION['access'] == MULTIHUNTER){
echo '';
}
echo '<tr><td colspan="2"> <a href="?p=Newmessage&uid='.$user['id'].'">&raquo; Write message</a></td></tr>';
if($_SESSION['access'] == ADMIN){
echo '<tr><td colspan="2"> <a class="rn3" href="?p=deletion&uid='.$user['id'].'">&raquo; Delete player</a></td></tr>';
} else if($_SESSION['access'] == MULTIHUNTER){
echo '';
}
echo '<tr><td colspan="2"> <a href="?p=ban&uid='.$user['id'].'">&raquo; Ban</a></td></tr>';
echo '<tr><td colspan="2" class="desc2"><div class="desc2div"><center>'.nl2br($user['desc1']).'</center></div></td></tr>';
?>
</table>
</td>
<td class="desc1">
<center><?php echo nl2br($user['desc2']); ?></center>
</td>
</tr>
</tbody>
</table>
<!-- ADDITIONAL USER INFORMATION -->
<table id="member">
<thead>
<tr>
<th colspan="2">Additional Information</th>
</tr>
</thead>
<tr>
<td>Access</td>
<td><?php
if($user['access'] == 0){
echo "Banned";
}
else if($user['access'] == 2){
echo "Normal user";
}
else if($user['access'] == 8){
echo "<b><font color=\"Blue\">Multihunter</font></b>";
}
else if($user['access'] == 9){
echo "<b><font color=\"Red\">Administrator</font></b>";
}?></td>
</tr>
<tr>
<td>Remaining gold</td>
<td><?php
if($user['gold'] == 0){ ?>
This user has no gold! (<img src='../img/admin/gold_g.gif' class='gold' alt='Gold' title='This user has: <?php echo $user['gold']; ?> gold'/> <?php echo $user['gold']; ?>) <?php if($_SESSION['access'] == ADMIN){ ?><a href='admin.php?p=player&uid=<?php echo $id; ?>&g'>Give gold <?php } ?></a>
<?php }
else if($user['gold'] > 0){ ?>
<img src='../img/admin/gold.gif' class='gold' alt='Gold' title='This user has: <?php echo $user['gold']; ?> gold'/> <?php echo $user['gold']; ?> <?php if($_SESSION['access'] == ADMIN){ ?><a href='admin.php?p=player&uid=<?php echo $id; ?>&g'><img src='../img/admin/edit.gif' title='Give Gold'><?php } ?></a></td>
<?php }
?>
</tr>
<?php
if($_SESSION['access'] == ADMIN){
if($_GET['g'] == 'ok'){
echo '';
} else {
if(isset($_GET['g'])){ ?>
<form action="../GameEngine/Admin/Mods/gold_1.php" method="POST">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
<tr>
<td>Insert number and press 'enter'</td>
<td><input class="give_gold" name="gold" value="0"> <a href="admin.php?p=player&uid=<?php echo $id; ?>"><img src="../img/admin/del.gif" title="Cancel"></a></td>
</tr></form>
<?php } } }?>
<tr><td></td><td></td></tr>
<tr>
<td>Sitter 1</td>
<td><?php
if($user['sit1'] >= 1){
echo '<a href="admin.php?p=player&uid='.$user['sit1'].'">'.$database->getUserField($user['sit1'],"username",0).'</a>';
}
else if($user['sit1'] == 0){
echo 'No sitter';
}
?>
</tr>
<tr>
<td>Sitter 2</td>
<td><?php
if($user['sit2'] >= 1){
echo '<a href="admin.php?p=player&uid='.$user['sit2'].'">'.$database->getUserField($user['sit2'],"username",0).'</a>';
}
else if($user['sit2'] == 0){
echo 'No sitter';
}
?>
</tr>
<tr><td></td><td></td></tr>
<tr>
<td>Beginners Protection</td>
<td><?php
echo ''.date('d.m.Y H:i',$user['protect']+3600*2).'';
?>
</tr>
<tr>
<td>Cultural Points</td>
<td><?php echo $user['cp'];?> <?php if($_SESSION['access'] == ADMIN){ ?><a href='admin.php?p=player&uid=<?php echo $id; ?>&cp'><img src='../img/admin/edit.gif' title='Give Gold'><?php } ?>
</tr>
<?php if($_SESSION['access'] == ADMIN){
if($_GET['cp'] == 'ok'){
echo '';
} else {
if(isset($_GET['cp'])){ ?>
<form action="../GameEngine/Admin/Mods/cp.php" method="POST">
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
<input type="hidden" name="id" value="<?php echo $id; ?>">
<tr>
<td>Insert number and press 'enter'</td>
<td><input class="give_gold" name="cp" value="0"> <a href="admin.php?p=player&uid=<?php echo $id; ?>"><img src="../img/admin/del.gif" title="Cancel"></a></td>
</tr></form>
<?php } } }?>
<tr>
<td>Last activity</td>
<td><?php
echo ''.date('d.m.Y H:i',$user['timestamp']+3600*2).'';
?>
</tr>
</table>
<center><?php include ('punish.tpl'); ?></center>
<?php
include ('villages.tpl');
include ('add_village.tpl');
}else{
echo "Not found...<a href=\"javascript: history.go(-1)\">Back</a>";
}
}
?>
+82
View File
@@ -0,0 +1,82 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename punish.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
$active = $admin->getUserActive();
?>
<style>
.del {width:12px; height:12px; background-image: url(img/admin/icon/del.gif);}
</style>
<form method="post" action="admin.php">
<input name="action" type="hidden" value="punish">
<input name="uid" type="hidden" value="<?php echo $user['id'];?>">
<input type="hidden" name="admid" id="admid" value="<?php echo $_SESSION['id']; ?>">
<table id="member" style="width: 200px;">
<thead>
<tr>
<th colspan="2">Punish Player</th>
</tr>
</thead>
<tr>
<td><center /><select name="punish">
<option name="punish" value="10" selected="selected">10%
<option name="punish" value="20">20%
<option name="punish" value="30">30%
<option name="punish" value="40">40%
<option name="punish" value="50">50%
<option name="punish" value="60" <?php if($_SESSION['access'] == ADMIN){ echo ''; } else if($_SESSION['access'] == MULTIHUNTER){ echo 'disabled="disabled"'; } ?>>60%
<option name="punish" value="70" <?php if($_SESSION['access'] == ADMIN){ echo ''; } else if($_SESSION['access'] == MULTIHUNTER){ echo 'disabled="disabled"'; } ?>>70%
<option name="punish" value="80" <?php if($_SESSION['access'] == ADMIN){ echo ''; } else if($_SESSION['access'] == MULTIHUNTER){ echo 'disabled="disabled"'; } ?>>80%
<option name="punish" value="90" <?php if($_SESSION['access'] == ADMIN){ echo ''; } else if($_SESSION['access'] == MULTIHUNTER){ echo 'disabled="disabled"'; } ?>>90%
<option name="punish" value="100" <?php if($_SESSION['access'] == ADMIN){ echo ''; } else if($_SESSION['access'] == MULTIHUNTER){ echo 'disabled="disabled"'; } ?>>100%</option></td>
<td rowspan="1"><center /><input value="OK" type="submit"></td>
</tr>
<!--<tr>
<td colspan="1" style="text-align: center;">
<input type="checkbox" name="del_troop" value="1"> Delete troops
</td>
</tr>
<tr>
<td colspan="1" style="text-align: center;">
<input type="checkbox" name="clean_ware" value="1"> Empty warehouses
</td>
</tr> -->
</table>
</form>
+12
View File
@@ -0,0 +1,12 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename report.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
comming soon
+51
View File
@@ -0,0 +1,51 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename results_alliances.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
$result = $admin->search_alliance($_POST['s']);
?>
<table id="member">
<thead>
<tr>
<th class="dtbl"><a href="">1 «</a></th><th>Found alliances (<?php echo count($result);?>)</th><th class="dtbl"><a href="">» 100</a></th>
</tr>
</thead>
</table>
<table id="profile">
<tr>
<td class="b">AID</td>
<td class="b">Name</td>
<td class="b">Tag</td>
<td class="b">Founder</td>
</tr>
<?php
if($result){
for ($i = 0; $i <= count($result)-1; $i++) {
echo '
<tr>
<td>'.$result[$i]["id"].'</td>
<td><a href="?p=alliance&aid='.$result[$i]["id"].'">'.$result[$i]["name"].'</a></td>
<td><a href="?p=alliance&aid='.$result[$i]["id"].'">'.$result[$i]["tag"].'</a></td>
<td><a href="?p=player&uid='.$result[$i]["id"].'">'.$database->getUserField($result[$i]["leader"],'username',0).'</a></td>
</tr>
';
}}
else{
echo '
<tr>
<td colspan="4">No results</td>
</tr>
';
}
?>
</table>
+49
View File
@@ -0,0 +1,49 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename resutls_email.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
$result = $admin->search_email($_POST['s']);
?>
<table id="member">
<thead>
<tr>
<th class="dtbl"><a href="">1 «</a></th><th>Found emails (<?php echo count($result);?>)</th><th class="dtbl"><a href="">» 100</a></th>
</tr>
</thead>
</table>
<table id="profile">
<tr>
<td class="b">UID</td>
<td class="b">Name</td>
<td class="b">Email</td>
</tr>
<?php
if($result){
for ($i = 0; $i <= count($result)-1; $i++) {
echo '
<tr>
<td>'.$result[$i]["id"].'</td>
<td><a href="?p=player&uid='.$result[$i]["id"].'">'.$database->getUserField($result[$i]["id"],'username',0).'</a></td>
<td>'.$result[$i]["email"].'</td>
</tr>
';
}}
else{
echo '
<tr>
<td colspan="4">No results</td>
</tr>
';
}
?>
</table>
+63
View File
@@ -0,0 +1,63 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename results_ip.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
$result = $admin->search_ip($_POST['s']);
$newArray = array();
function arr($arr,$el){
global $newArray;
for ($i = 0; $i <= count($arr)-1; $i++) {
if(in_array($el,$newArray)){
return false;
}else{
array_push($newArray,$el);
return true;
}
}
}
?>
<table id="member">
<thead>
<tr>
<th class="dtbl"><a href="">1 «</a></th><th>Found IPs (<?php echo count($newArray);?>)</th><th class="dtbl"><a href="">» 100</a></th>
</tr>
</thead>
</table>
<table id="profile">
<tr>
<td class="b">IP</td>
<td class="b">Name</td>
</tr>
<?php
if($result){
for ($i = 0; $i <= count($result)-1; $i++) {
if(arr($result,$result[$i]["ip"].$result[$i]["uid"])){
echo '
<tr>
<td>'.$result[$i]["ip"].'</td>
<td><a href="?p=player&uid='.$result[$i]["uid"].'">'.$database->getUserField($result[$i]["uid"],'username',0).'</a></td>
</tr>
';
}
}
}
else{
echo '
<tr>
<td colspan="4">No results</td>
</tr>
';
}
?>
</table>
+56
View File
@@ -0,0 +1,56 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename results_player.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
$result = $admin->search_player($_POST['s']);
?>
<table id="member">
<thead>
<tr>
<th class="dtbl"><a href="">1 «</a></th><th>Found player (<?php echo count($result);?>)</th><th class="dtbl"><a href="">» 100</a></th>
</tr>
</thead>
</table>
<table id="profile">
<tr>
<td class="b">UID</td>
<td class="b">Player</td>
<td class="b">Villages</td>
<td class="b">Pop</td>
</tr>
<?php
if($result){
for ($i = 0; $i <= count($result)-1; $i++) {
$varray = $database->getProfileVillages($result[$i]["id"]);
$totalpop = 0;
foreach($varray as $vil) {
$totalpop += $vil['pop'];
}
echo '
<tr>
<td>'.$result[$i]["id"].'</td>
<td><a href="?p=player&uid='.$result[$i]["id"].'">'.$result[$i]["username"].'</a></td>
<td>'.count($varray).'</td>
<td>'.$totalpop.'</td>
</tr>
';
}}
else{
echo '
<tr>
<td colspan="4">No results</td>
</tr>
';
}
?>
</table>
+58
View File
@@ -0,0 +1,58 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename results_villages.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<?php
$result = $admin->search_village($_POST['s']);
?>
<table id="member">
<thead>
<tr>
<th class="dtbl"><a href="">1 «</a></th><th>Found villages (<?php echo count($result);?>)</th><th class="dtbl"><a href="">» 100</a></th>
</tr>
</thead>
</table>
<table id="profile">
<tr>
<td class="b">ID</td>
<td class="b">Name</td>
<td class="b">Owner</td>
<td class="b">Pop</td>
<td></td>
</tr>
<?php
if($result){
for ($i = 0; $i <= count($result)-1; $i++) {
if($_SESSION['access'] == ADMIN){
$delLink = '<a href="?action=delVil&did='.$varray[$i]['wref'].'" onClick="return del(\'did\','.$varray[$i]['wref'].');"><img src="../img/Admin/del.gif" class="del"></a>';
}else if($_SESSION['access'] == MULTIHUNTER){
$delLink = '<a href="#"><img src="../img/Admin/del_g.gif" class="del"></a>';
}
echo '
<tr>
<td>'.$result[$i]["wref"].'</td>
<td><a href="?p=village&did='.$result[$i]["wref"].'">'.$result[$i]["name"].'</a></td>
<td><a href="?p=player&uid='.$result[$i]["owner"].'">'.$database->getUserField($result[$i]["owner"],'username',0).'</a></td>
<td>'.$result[$i]["pop"].'</td>
<td>'.$delLink.'</td>
</tr>
';
}}
else{
echo '
<tr>
<td colspan="4">No results</td>
</tr>
';
}
?>
</table>
+90
View File
@@ -0,0 +1,90 @@
<?php
#################################################################################
## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
## --------------------------------------------------------------------------- ##
## Filename search.tpl ##
## Developed by: Dzoki ##
## License: TravianX Project ##
## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
## ##
#################################################################################
?>
<form action="" method="post">
<table id="member">
<thead>
<tr>
<th colspan="3">Search v1.0</th>
</tr>
</thead>
<tr class="slr3">
<td>
<select name="p" size="1" class="slr3">
<option value="player" <?php if($_POST['p']=='player'){echo "selected";}?>>Search player</option>
<option value="alliances" <?php if($_POST['p']=='alliances'){echo "selected";}?>>Search alliances</option>
<option value="villages" <?php if($_POST['p']=='villages'){echo "selected";}?>>Search villages</option>
<option value="email" <?php if($_POST['p']=='email'){echo "selected";}?>>Search E-mail</option>
<option value="ip" <?php if($_POST['p']=='ip'){echo "selected";}?>>Search IPs</option>
<option value="deleted_players" <?php if($_POST['p']=='deleted_players'){echo "selected";}?>>Search deleted players</option>
</select>
</td>
<td>
<input name="s" value="<?php echo $_POST['s'];?>">
</td>
<td>
<input type=submit value=Search class="slr3">
</td>
</tr>
</table>
</form>
<?php
if($_GET['msg']){
echo '<div style="margin-top: 50px;" class="b"><center>';
if($_GET['msg'] == 'ursdel'){
echo "User was deleted.";
}
echo '</center></div>';
}
?>

Some files were not shown because too many files have changed in this diff Show More