Added Donns Fix for gain mill and bakery
[travianx.git] / celebration.php
blob76a8170d6c16f73f4c5041db246d3a064c60a001
1 <?php
3 #################################################################################
4 ## -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =- ##
5 ## --------------------------------------------------------------------------- ##
6 ## Filename celebration.php ##
7 ## Developed by: Dzoki ##
8 ## License: TravianX Project ##
9 ## Copyright: TravianX (c) 2010-2011. All rights reserved. ##
10 ## ##
11 #################################################################################
14 include("GameEngine/Village.php");
16 if(isset($_GET['newdid'])) {
17 $_SESSION['wid'] = $_GET['newdid'];
18 header("Location: ".$_SERVER['PHP_SELF']);
20 $bla = 0;
21 $id= 0;
22 $type= 0;
23 $town = 0;
24 $vil = 0;
25 $woodold = 0;
26 $clayold = 0;
27 $ironold = 0;
28 $cropold = 0;
29 $feld = 0;
30 $level = 0;
31 $time = 0;
33 $id=$_GET['id'];
34 $type=$_GET['type'];
35 $town = $database->getVillageField($village->wid, 'wref');
36 $vil = $database->getResourceLevel($village->wid);
37 $woodold = $database->getVillageField($village->wid, 'wood');
38 $clayold = $database->getVillageField($village->wid, 'clay');
39 $ironold = $database->getVillageField($village->wid, 'iron');
40 $cropold = $database->getVillageField($village->wid, 'crop');
44 $feld = $vil['f'.$id.'t'];
45 $level = $vil['f'.$id];
46 $time = Time();
47 if($feld == 24)
49 if($type == 1)
51 if(6400 < $woodold|| 6650 < $clayold || 5940 < $ironold || 1340 < $cropold) {
52 $endtime = ($sc[$level]/ SPEED) + $time;
53 $wood = 6400;
54 $clay = 6650;
55 $iron = 5940;
56 $crop = 1340;
58 $database->modifyResource($town,$wood,$clay,$iron,$crop,$mode);
59 $database->addCel($town,$endtime,$type);
63 else if($type == 2)
65 if(29700 < $woodold || 33250 < $clayold || 32000 < $ironold || 6700 < $cropold) {
67 $endtime = ($gc[$level]/ SPEED) + $time;
68 $wood= 29700;
69 $clay= 33250;
70 $iron= 32000;
71 $crop= 6700;
72 $database->modifyResource($town,$wood,$clay,$iron,$crop,$mode);
73 $database->addCel($town,$endtime,$type);
80 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
81 <html>
82 <head>
83 <title><?php echo SERVER_NAME ?></title>
84 <link REL="shortcut icon" HREF="favicon.ico"/>
85 <meta http-equiv="cache-control" content="max-age=0" />
86 <meta http-equiv="pragma" content="no-cache" />
87 <meta http-equiv="expires" content="0" />
88 <meta http-equiv="imagetoolbar" content="no" />
89 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
90 <meta http-equiv="refresh" content="0; URL=dorf2.php">
91 <script src="mt-full.js?ebe79" type="text/javascript"></script>
92 <script src="unx.js?ebe79" type="text/javascript"></script>
93 <script src="new.js?ebe79" type="text/javascript"></script>
94 <link href="<?php echo GP_LOCATE; ?>lang/en/lang.css?f4b7c" rel="stylesheet" type="text/css" />
95 <link href="<?php echo GP_LOCATE; ?>lang/en/compact.css?f4b7c" rel="stylesheet" type="text/css" />
96 <?php
97 if($session->gpack == null || GP_ENABLE == false) {
98 echo "
99 <link href='".GP_LOCATE."travian.css?e21d2' rel='stylesheet' type='text/css' />
100 <link href='".GP_LOCATE."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
101 } else {
102 echo "
103 <link href='".$session->gpack."travian.css?e21d2' rel='stylesheet' type='text/css' />
104 <link href='".$session->gpack."lang/en/lang.css?e21d2' rel='stylesheet' type='text/css' />";
107 <script type="text/javascript">
109 window.addEvent('domready', start);
110 </script>
111 </head>
113 </html>