PageRenderTime 101ms CodeModel.GetById 4ms app.highlight 75ms RepoModel.GetById 2ms app.codeStats 3ms

/Templates/Ajax/quest_core.tpl

https://github.com/DEVVELO/TravianZ-By-Shadowss
Smarty Template | 1327 lines | 1092 code | 235 blank | 0 comment | 232 complexity | 6627b6d487a84e638fed84c1c1716e87 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1<?php
  2
  3#################################################################################
  4##              -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =-                 ##
  5## --------------------------------------------------------------------------- ##
  6##  Project:       TravianZ      					       ##
  7##  Version:       01.09.2013 						       ##
  8##  Filename       quest_core.tpl                                              ##
  9##  Developed by:  DesPlus and Marvin                                          ##
 10##  Fixed by:      Shadow / Skype : cata7007 and Armando                       ##
 11##  Revision by:   noonn                                 		       ##
 12##  License:       TravianZ Project                                            ##
 13##  Copyright:     TravianZ (c) 2010-2013. All rights reserved.                ##
 14##  URLs:          http://travian.shadowss.ro 				       ##
 15##  Source code:   http://github.com/Shadowss/TravianZ-by-Shadow/	       ##
 16##                                                                             ##
 17#################################################################################
 18
 19include("GameEngine/Village.php");
 20include("GameEngine/Data/cp.php");
 21
 22$uArray = $database->getUserArray($_SESSION['username'],0);
 23$check_quest=$database->getUserField($_SESSION['username'],'quest','username');
 24
 25if($message->unread && !$message->nunread) { $messagelol = "i2"; }
 26else if(!$message->unread && $message->nunread) { $messagelol = "i3"; }
 27else if($message->unread && $message->nunread) { $messagelol = "i1"; }
 28else { $messagelol = "i4"; }
 29
 30//set $skipp_time. Use the SPEED. standard (1x) = 10 hours. 
 31if(SPEED == '1'){ 
 32	$skipp_time="43200"; 
 33} else if(SPEED == '2'){ 
 34	$skipp_time="21600"; 
 35} else if(SPEED == '3'){ 
 36	$skipp_time="11988"; 
 37} else if(SPEED <= '5'){
 38	$skipp_time="7200"; 
 39} else if(SPEED > '5'){ 
 40	$skipp_time="3600"; 
 41} 
 42$_SESSION['qst_time'] = $uArray['quest_time'];
 43if (isset($qact)){
 44	if ($check_quest==$qact) {
 45		//avoid hacking gold, resources or reward -- added by Ronix
 46	}else {
 47		switch($qact) {
 48		case 'enter':
 49			$database->updateUserField($_SESSION['username'],'quest','1',0);
 50			$_SESSION['qst']= 1;
 51			break;
 52	
 53	
 54			//user does not follow the quest. 
 55			//Get reward: Resources: Every 24 hours (1 speed)  24/speed=hours
 56			//Gold: 25 gold
 57		case 'skip':
 58			$database->updateUserField($_SESSION['username'],'quest','90',0);
 59			$_SESSION['qst']= 90;
 60			break;
 61
 62		case '2':
 63			$database->updateUserField($_SESSION['username'],'quest','2',0);		
 64			$_SESSION['qst']= 2;	
 65			//Give Reward
 66			$database->FinishWoodcutter($session->villages[0]);	
 67			break;
 68
 69		case '3':
 70			$database->updateUserField($_SESSION['username'],'quest','3',0);
 71			$_SESSION['qst']= 3;
 72			//Give Reward
 73			if(!$session->plus){
 74				mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error());
 75			} else {
 76				$plus=$database->getUserField($_SESSION['username'],'plus','username');
 77				$plus+=86400;
 78				$database->updateUserField($_SESSION['username'],'plus',$plus,0);
 79			}
 80			break;
 81
 82		case '4':
 83			$database->updateUserField($_SESSION['username'],'quest','4',0);
 84			$_SESSION['qst']= 4;
 85			//Give Reward
 86			$database->modifyResource($session->villages[0],30,60,30,20,1);		
 87			break;
 88	
 89		case 'rank':
 90			$rSubmited=$qact2;
 91			break;
 92	
 93		case '5':
 94			$database->updateUserField($_SESSION['username'],'quest','5',0);
 95			$_SESSION['qst']= 5;
 96			//Give Reward
 97			$database->modifyResource($session->villages[0],40,30,20,30,1);	
 98			break;
 99
100		case '6':
101			$database->updateUserField($_SESSION['username'],'quest','6',0);
102			$_SESSION['qst']= 6;
103			$Subject="Message From The Taskmaster";
104			$Subject=Q6_SUBJECT;
105			$Message=Q6_MESSAGE;
106			$RB=true;
107			//Give Reward
108			$database->modifyResource($session->villages[0],50,60,30,30,1);	
109			break;
110	
111		case '7':
112			$database->updateUserField($_SESSION['username'],'quest','7',0);
113			$_SESSION['qst']= 7;
114			//Give Reward
115			$gold=$database->getUserField($_SESSION['username'],'gold','username');
116			$gold+=20;
117			$database->updateUserField($_SESSION['username'],'gold',$gold,0);
118			break;
119			
120		case '8':
121			$database->updateUserField($_SESSION['username'],'quest','8',0);
122			$_SESSION['qst']= 8;
123			//Give Reward
124			$database->modifyResource($session->villages[0],75,80,30,50,1);
125			break;
126	
127		case '9':
128			$crop = round($village->acrop);
129			if ($crop>=200){
130				$database->updateUserField($_SESSION['username'],'quest','9',0);
131				//Get 200 Crop	
132				$database->modifyResource($session->villages[0],0,0,0,-200,1);		
133				//Give Reward
134				$attack = $database->addAttack(0,1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,0,0);
135				$database->addMovement(3,0,$session->villages[0],$attack,time(),time()+43200/INCREASE_SPEED);
136			} else{
137				$NoCrop=Q8_NOCROP;
138			}
139			$_SESSION['qst']= 9;	
140			break;
141	
142		case '10':
143			$database->updateUserField($_SESSION['username'],'quest','10',0);
144			$_SESSION['qst']= 10;
145			//Give Reward
146			$database->modifyResource($session->villages[0],75,90,30,50,1);
147			break;
148	
149		case '11':
150			$database->updateUserField($_SESSION['username'],'quest','11',0);
151			$_SESSION['qst']= 11;
152			//Give Reward
153			if(!$session->plus){
154				mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysql_error());
155			} else {
156				$plus=$database->getUserField($_SESSION['username'],'plus','username');
157				$plus+=172800;
158				$database->updateUserField($_SESSION['username'],'plus',$plus,0);
159			}
160			break;
161	
162		case 'coor':
163			$x=$qact2;
164			$y=$qact3;
165			break;
166	
167		case '12':
168			$database->updateUserField($_SESSION['username'],'quest','12',0);
169			$_SESSION['qst']= 12;
170			//Give Reward
171			$database->modifyResource($session->villages[0],60,30,40,90,1);	
172			break;
173		
174		case '13':
175			$database->updateUserField($_SESSION['username'],'quest','13',0);
176			$_SESSION['qst']= 13;
177			//Give Reward
178			$database->modifyResource($session->villages[0],150,180,30,130,1);
179			break;
180	
181		case '14':
182			$database->updateUserField($_SESSION['username'],'quest','14',0);
183			$_SESSION['qst']= 14;
184			//Give Reward
185			$database->modifyResource($session->villages[0],60,50,40,30,1);
186			break;
187	
188		case 'lumber':
189			$lSubmited=$qact2;
190			break;
191	
192		case '15':
193			$database->updateUserField($_SESSION['username'],'quest','15',0);
194			$_SESSION['qst']= 15;
195			//Give Reward
196			$database->modifyResource($session->villages[0],50,30,60,20,1);
197			break;
198	
199		case '16':
200			$database->updateUserField($_SESSION['username'],'quest','16',0);
201			$_SESSION['qst']= 16;
202			//Give Reward
203			$database->modifyResource($session->villages[0],75,75,40,40,1);
204			break;
205	
206		case '17':
207			$database->updateUserField($_SESSION['username'],'quest','17',0);
208			$_SESSION['qst']= 17;
209			//Give Reward
210			$database->modifyResource($session->villages[0],100,90,100,60,1);
211			break;
212	
213		case '18':
214			$database->updateUserField($_SESSION['username'],'quest','18',0);
215			$_SESSION['qst']= 18;			
216			break;
217	
218		case '19':
219			$database->updateUserField($_SESSION['username'],'quest','19',0);
220			$_SESSION['qst']= 19;
221			//Give Reward
222			$database->modifyResource($session->villages[0],80,90,60,40,1);
223			break;
224	
225		case '20':
226			$database->updateUserField($_SESSION['username'],'quest','20',0);
227			$_SESSION['qst']= 20;
228			//Give Reward
229			$database->modifyResource($session->villages[0],70,120,90,50,1);
230			break;
231
232		case '21':
233			$database->updateUserField($_SESSION['username'],'quest','21',0);
234			$_SESSION['qst']= 21;			
235			break;
236	
237		case '22':
238			$database->updateUserField($_SESSION['username'],'quest','22',0);
239			$_SESSION['qst']= 22;
240			//Give Reward
241			$database->modifyResource($session->villages[0],200,200,700,450,1);
242			break;
243	
244		case '23':
245			$database->updateUserField($_SESSION['username'],'quest','23',0);
246			$_SESSION['qst']= 23;
247			break;
248	
249		case '24':
250			$database->updateUserField($_SESSION['username'],'quest','24',0);
251			$_SESSION['qst']= 24;
252			//Give Reward
253			$database->modifyResource($session->villages[0],300,320,360,570,1);
254			break;
255	
256		case '28':
257			$dataarray[3] = 1;
258			$database->updateUserField($_SESSION['username'],'quest','28',0);
259			$_SESSION['qst']= 28;
260			//Give Reward
261			$gold=$database->getUserField($_SESSION['username'],'gold','username');
262			$gold+=15;
263			$database->updateUserField($_SESSION['username'],'gold',$gold,0);
264			break;
265	
266		case '29':
267			$dataarray[4] = 1;
268			$database->updateUserField($_SESSION['username'],'quest','29',0);
269			$_SESSION['qst']= 29;
270			//Give Reward
271			$database->modifyResource($session->villages[0],240,280,180,100,1);
272			break;
273    
274		case '30':
275			$dataarray[5] = 1;
276			$database->updateUserField($_SESSION['username'],'quest','30',0);
277			$_SESSION['qst']= 30;
278			//Give Reward
279			$database->modifyResource($session->villages[0],600,750,600,300,1);
280			break;
281    
282		case '31':
283			$dataarray[6] = 1;
284			$database->updateUserField($_SESSION['username'],'quest','31',0);
285			$_SESSION['qst']= 31;
286			//Give Reward
287			$database->modifyResource($session->villages[0],900,850,600,300,1);
288			break;
289    
290		case '32':
291			$dataarray[7] = 1;
292			$database->updateUserField($_SESSION['username'],'quest','32',0);
293			$_SESSION['qst']= 32;
294			//Give Reward
295			$database->modifyResource($session->villages[0],1800,2000,1650,800,1);
296			break;
297    
298		case '33':
299			$dataarray[8] = 1;
300			$database->updateUserField($_SESSION['username'],'quest','33',0);
301			$_SESSION['qst']= 33;
302			//Give Reward
303			$database->modifyResource($session->villages[0],1600,1800,1950,1200,1);
304			break;
305    
306		case '34':
307			$dataarray[9] = 1;
308			$database->updateUserField($_SESSION['username'],'quest','34',0);
309			$_SESSION['qst']= 34;
310			//Give Reward
311			$database->modifyResource($session->villages[0],3400,2800,3600,2200,1);
312			break;
313    
314		case '35':
315			$dataarray[10] = 1;
316			$database->updateUserField($_SESSION['username'],'quest','35',0);
317			$_SESSION['qst']= 35;
318			//Give Reward
319			$database->modifyResource($session->villages[0],1050,800,900,750,1);
320			break;
321    
322		case '36':
323			$database->updateUserField($_SESSION['username'],'quest','36',0);
324			$_SESSION['qst']= 36;
325			//Give Reward
326			$database->modifyResource($session->villages[0],1600,2000,1800,1300,1);
327			break;
328	
329		case '37':
330			$database->updateUserField($_SESSION['username'],'quest','37',0);
331			$_SESSION['qst']= 37;
332			break;
333	
334		case '91':
335			$database->updateUserField($_SESSION['username'],'quest','91',0);
336			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
337			$_SESSION['qst']= 91;
338			$_SESSION['qst_time'] = time()+$skipp_time;
339			//Give Reward
340			if(!$session->plus){
341				mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+86400 where `username`='".$_SESSION['username']."'") or die(mysql_error());
342			} else {
343				$plus=$database->getUserField($_SESSION['username'],'plus','username');
344				$plus+=86400;
345				$database->updateUserField($_SESSION['username'],'plus',$plus,0);
346			}
347			$gold=$database->getUserField($_SESSION['username'],'gold','username');
348			$gold+=15;
349			$database->updateUserField($_SESSION['username'],'gold',$gold,0);
350			break;
351		
352		case '92':
353			$database->updateUserField($_SESSION['username'],'quest','92',0);
354			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
355			$_SESSION['qst']= 92;
356			$_SESSION['qst_time'] = time()+$skipp_time;
357			//Give Reward
358			$database->modifyResource($session->villages[0],217,247,177,207,1);
359			break;	
360	
361		case '93':
362			$database->updateUserField($_SESSION['username'],'quest','93',0);
363			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
364			$_SESSION['qst']= 93;
365			$_SESSION['qst_time'] = time()+$skipp_time;
366			//Give Reward
367			$database->modifyResource($session->villages[0],217,247,177,207,1);
368			break;	
369	
370		case '94':
371			$database->updateUserField($_SESSION['username'],'quest','94',0);
372			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
373			$_SESSION['qst']= 94;
374			$_SESSION['qst_time'] = time()+$skipp_time;
375			//Give Reward
376			$database->modifyResource($session->villages[0],217,247,177,207,1);
377			break;	
378	
379		case '95':
380			$database->updateUserField($_SESSION['username'],'quest','95',0);
381			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
382			$_SESSION['qst']= 95;
383			$_SESSION['qst_time'] = time()+$skipp_time;
384			//Give Reward
385			$database->modifyResource($session->villages[0],217,247,177,207,1);
386			break;	
387	
388		case '96':
389			$database->updateUserField($_SESSION['username'],'quest','96',0);
390			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
391			$_SESSION['qst']= 96;
392			$_SESSION['qst_time'] = time()+$skipp_time;
393			//Give Reward
394			$database->modifyResource($session->villages[0],217,247,177,207,1);
395			break;	
396	
397		case '97':
398			$database->updateUserField($_SESSION['username'],'quest','97',0);
399			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()).'',0);
400			$_SESSION['qst_time'] = time();
401			$_SESSION['qst']= 97;
402			//Give Reward 20 gold + 2 days plus
403			if(!$session->plus){
404				mysql_query("UPDATE ".TB_PREFIX."users set plus = ('".mktime(date("H"),date("i"), date("s"),date("m") , date("d"), date("Y"))."')+172800 where `username`='".$_SESSION['username']."'") or die(mysql_error());
405			} else {
406				$plus=$database->getUserField($_SESSION['username'],'plus','username');
407				$plus+=172800;
408				$database->updateUserField($_SESSION['username'],'plus',$plus,0);
409			}
410			$gold=$database->getUserField($_SESSION['username'],'gold','username');
411			$gold+=20;
412			$database->updateUserField($_SESSION['username'],'gold',$gold,0);
413			break;
414		}	
415	}
416}
417
418header("Content-Type: application/json;");
419if($session->access!=BANNED){
420      if($_SESSION['qst']== 0){
421	  ?>
422
423{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q0; ?> <?php echo SERVER_NAME; ?>!<\/h1><br \/><i>&rdquo;<?php echo Q0_DESC; ?>&rdquo;<\/i><br \/><br \/><span id=\"qst_accpt\"><a class=\"qle\" href=\"javascript: qst_next('','enter'); \"><?php echo Q0_OPT1; ?><\/a><a class=\"qri\" href=\"javascript: qst_fhandle();\"><?php echo Q0_OPT2; ?><\/a><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><br \/><br \/><br \/><a class=\"qri\" href=\"javascript: qst_next('','skip');\"><?php echo Q0_OPT3; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"intro\"><\/div>\n\t\t","number":null,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":1}
424
425<?php } elseif($_SESSION['qst']== 1){
426
427//Check one of Woodcutters is level 1 or upper 
428$tRes = $database->getResourceLevel($session->villages[0]);
429$woodL=$tRes['f1']+$tRes['f3']+$tRes['f14']+$tRes['f17'];
430	//check if you are building a woodcutter to level 1
431	foreach($building->buildArray as $jobs) {
432			if($jobs['type']==1){
433				$woodL="99";
434			}	
435      	}
436if ($woodL<1){?>
437{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q1; ?><\/h1><br \/><i>&rdquo;<?php echo Q1_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q1_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"wood\"><\/div>\n\t\t","number":"-1","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
438<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
439{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q1; ?><\/h1><br \/><i>&rdquo;<?php echo Q1_RESP; ?>&rdquo;<\/i><br \/><br \/><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q1_REWARD; ?><br \/><\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','2');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"wood\"><\/div>\n\t\t","number":"-1","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
440<?php }?>
441
442<?php } elseif($_SESSION['qst']== 2){ 
443
444//Check one of Croplands is level 1 or upper 
445$tRes = $database->getResourceLevel($session->villages[0]);
446$cropL=$tRes['f2']+$tRes['f8']+$tRes['f9']+$tRes['f12']+$tRes['f13']+$tRes['f15'];
447if ($cropL<1){?>
448{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q2; ?><\/h1><br \/><i>&rdquo;<?php echo Q2_DESC; ?>.&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q2_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"farm\"><\/div>\n\t\t","number":"-2","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
449<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
450{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q2; ?><\/h1><br \/><i>&rdquo;<?php echo Q2_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q2_REWARD; ?> <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></b><\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','3');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"farm\"><\/div>\n\t\t","number":2,"reward":{"plus":1},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
451<?php }?>
452
453<?php } elseif($_SESSION['qst']== 3){ 
454
455//Check the village name is changed or is default name
456
457$vName=$village->vname;
458if ($vName==$session->userinfo['username']."'s village"){?>
459{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/><?php echo Q3; ?><\/h1><br \/><i>&rdquo;<?php echo Q3_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q3_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"village_name\"><\/div>\n\t\t","number":"-3","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
460<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
461{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/><?php echo Q3; ?><\/h1><br \/><i>&rdquo;<?php echo Q3_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>30&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>60&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>30&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>20&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','4');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"village_name\"><\/div>\n\t\t","number":3,"reward":{"wood":30,"clay":60,"iron":30,"crop":20},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
462<?php }?>
463
464<?php } elseif($_SESSION['qst']== 4){
465
466// Compare real player rank with submited rank
467$temp['uid']=$session->userinfo['id'];
468$ranking->procRankReq($temp);
469$displayarray = $database->getUserArray($temp['uid'],1);
470$rRes=$ranking->searchRank($displayarray['username'],"username");
471if ($rRes!=$rSubmited){?>
472{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/><?php echo Q4; ?><\/h1><br \/><i>&rdquo;<?php echo Q4_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q4_ORDER; ?><\/div><br \/><input id=\"qst_val\" class=\"text\" type=\"text\" name=\"qstin\" \/> <input onclick=\"qst_next('','rank',document.getElementById('qst_val').value)\" type=\"button\" value=\"<?php echo Q4_BUTN; ?>\"\/><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"rank\"><\/div>\n\t\t","number":-4,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
473<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
474{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/><?php echo Q4; ?><\/h1><br \/><i>&rdquo;<?php echo Q4_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>40&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>30&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>20&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>30&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','5');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t","number":4,"reward":{"wood":40,"clay":30,"iron":20,"crop":30},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
475<?php }?>
476
477<?php } elseif($_SESSION['qst']== 5){ 
478
479//Check one of Iron Mines and one of Clay Pites are level 1 or upper 
480$tRes = $database->getResourceLevel($session->villages[0]);
481$ironL=$tRes['f4']+$tRes['f7']+$tRes['f10']+$tRes['f11'];
482$clayL=$tRes['f5']+$tRes['f6']+$tRes['f16']+$tRes['f18'];
483if ($ironL<1 || $clayL<1){?>
484{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/><?php echo Q5; ?><\/h1><br \/><i>&rdquo;<?php echo Q5_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q5_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"clay_iron\"><\/div>\n\t\t","number":-5,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
485<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
486{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/><?php echo Q5; ?><\/h1><br \/><i>&rdquo;<?php echo Q5_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>50&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>60&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>30&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>30&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','6');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"clay_iron\"><\/div>\n\t\t","number":5,"reward":{"wood":50,"clay":60,"iron":30,"crop":30},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
487<?php }?>
488
489<?php } elseif($_SESSION['qst']== 6){ 
490
491//Check message is viewed or no
492if ($message->unread || $RB==true){?>
493{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q6; ?><\/h1><br \/><i>&rdquo;<?php echo Q6_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q6_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"msg\"><\/div>\n\t\t","number":"-6","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"i2","altstep":99}
494<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
495{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q6; ?><\/h1><br \/><i>&rdquo;<?php echo Q6_RESP; ?><b><font color=\"#71D000\">P<\/font><font color=\"#FF6F0F\">l<\/font><font color=\"#71D000\">u<\/font><font color=\"#FF6F0F\">s<\/font><\/b><?php echo Q6_RESP1; ?><a href=\"plus.php?id=3\"><font color=\"#000000\"><?php echo SERVER_NAME; ?><\/font> <b><font color=\"#71D000\">P<\/font><font color=\"#FF6F0F\">l<\/font><font color=\"#71D000\">u<\/font><font color=\"#FF6F0F\">s<\/font><\/b><\/a> <?php echo Q6_RESP2; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p>20 Gold<br \/><\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','7');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"msg\"><\/div>\n\t\t","number":6,"reward":{"gold":20},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
496<?php }?>
497
498<?php } elseif($_SESSION['qst']== 7){
499
500//Check additional of each resource upgraded to lvl1 or upper
501$tRes = $database->getResourceLevel($session->villages[0]);
502$ironL=0;$clayL=0;$woodL=0;$cropL=0;
503if($tRes['f4']>0){$ironL++;};if($tRes['f7']>0){$ironL++;};if($tRes['f10']>0){$ironL++;};if($tRes['f11']>0){$ironL++;}
504if($tRes['f5']>0){$clayL++;};if($tRes['f6']>0){$clayL++;};if($tRes['f16']>0){$clayL++;};if($tRes['f18']>0){$clayL++;}
505if($tRes['f1']>0){$woodL++;};if($tRes['f3']>0){$woodL++;};if($tRes['f14']>0){$woodL++;};if($tRes['f17']>0){$woodL++;}
506if($tRes['f2']>0){$cropL++;};if($tRes['f8']>0){$cropL++;};if($tRes['f9']>0){$cropL++;};if($tRes['f12']>0){$cropL++;};if($tRes['f13']>0){$cropL++;};if($tRes['f15']>0){$cropL++;}
507
508if ($ironL<2 || $clayL<2 || $woodL<2 || $cropL<2){?>
509{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/><?php echo $questc->q;?><?php echo Q7; ?><\/h1><br \/><i>&rdquo;<?php echo Q7_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q7_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"allres\"><\/div>\n\t\t","number":-7,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
510<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
511{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q7; ?><\/h1><br \/><i>&rdquo;<?php echo Q7_RESP; ?>&rdquo;\r\n<br \/><br \/>\r\n<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>75&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>80&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>30&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>50&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','8');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"allres\"><\/div>\n\t\t","number":7,"reward":{"wood":75,"clay":80,"iron":30,"crop":50},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
512<?php }?>
513
514<?php } elseif($_SESSION['qst']== 8){?>
515{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q8; ?><\/h1><br \/><i>&rdquo;<?php echo Q8_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q8_ORDER; ?><\/div><br \/><img class=\"r4\" src=\"img\/x.gif\" title=\"Crop\" alt=\"Crop\" \/>200 <input type=\"hidden\" id=\"qst_val\" value=\"set\" \/><input onclick=\"javascript: qst_next('','9');\" name=\"qstin\" type=\"button\" value=\"<?php echo Q8_BUTN; ?>\" \/><br \/><font color='#FF0000'><?php if(isset($NoCrop)){echo $NoCrop;}?><font\/><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"army\"><\/div>\n\t\t","number":-8,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
516
517<?php } elseif($_SESSION['qst']== 9){
518
519//Check additional of each resource upgraded to lvl1 or upper
520$tRes = $database->getResourceLevel($session->villages[0]);
521$ironL=0;$clayL=0;$woodL=0;$cropL=0;
522if($tRes['f4']>0){$ironL++;};if($tRes['f7']>0){$ironL++;};if($tRes['f10']>0){$ironL++;};if($tRes['f11']>0){$ironL++;}
523if($tRes['f5']>0){$clayL++;};if($tRes['f6']>0){$clayL++;};if($tRes['f16']>0){$clayL++;};if($tRes['f18']>0){$clayL++;}
524if($tRes['f1']>0){$woodL++;};if($tRes['f3']>0){$woodL++;};if($tRes['f14']>0){$woodL++;};if($tRes['f17']>0){$woodL++;}
525if($tRes['f2']>0){$cropL++;};if($tRes['f8']>0){$cropL++;};if($tRes['f9']>0){$cropL++;};if($tRes['f12']>0){$cropL++;};if($tRes['f13']>0){$cropL++;};if($tRes['f15']>0){$cropL++;}
526if ($ironL<4 || $clayL<4 || $woodL<4 || $cropL<6){?>
527{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/><?php echo $questc->q;?> <?php echo Q9; ?><\/h1><br \/><i>&rdquo;<?php echo Q9_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q9_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"allres\"><\/div>\n\t\t","number":-9,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
528<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
529{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q9; ?><\/h1><br \/><i>&rdquo;<?php echo Q9_RESP; ?>.&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>75&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>80&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>30&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>50&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','10');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"allres\"><\/div>\n\t\t","number":9,"reward":{"wood":75,"clay":80,"iron":30,"crop":50},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
530<?php }?>
531
532<?php } elseif($_SESSION['qst']== 10){ 
533
534//Check player Descriptions for [#0]
535$Dave= strrpos ($uArray['desc1'],'[#0]');
536$Dave2=strrpos ($uArray['desc2'],'[#0]');
537if (!is_numeric($Dave) and !is_numeric($Dave2)){?>
538{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q10; ?><\/h1><br \/><i>&rdquo;<?php echo Q10_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q10_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"medal\"><\/div>\n\t\t","number":"-10","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
539<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
540{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q10; ?><\/h1><br \/><i>&rdquo;<?php echo Q10_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q10_REWARD; ?> <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></b><\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','11');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"medal\"><\/div>\n\t\t","number":10,"reward":{"plus":2},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
541<?php }?>
542
543<?php } elseif($_SESSION['qst']== 11){
544
545$getvID = $database->getVillageID($session->uid);
546$nvillage = $database->getFieldDistance($getvID);
547$ncoor = $database->getCoor($nvillage);
548$nvillagename = $database->getVillageField($nvillage,"name");
549if ($x!=$ncoor['x'] or $y!=$ncoor['y']){?>
550{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q11; ?></h1><br><i>&rdquo;<?php echo Q11_DESC; ?> <b><?php echo $nvillagename; ?></b>. <?php echo Q11_DESC1; ?>&rdquo;</i><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q11_ORDER; ?> <b><?php echo $nvillagename; ?></b> <?php echo Q11_ORDER1; ?></div><div id=\"map_coords\"><span>X </span><input class=\"text\" value=\"\" maxlength=\"4\" id=\"qst_val_x\" name=\"xp\"><span> Y </span><input class=\"text\" value=\"\" maxlength=\"4\" id=\"qst_val_y\" name=\"xy\"> <input type=\"button\" value=\"<?php echo Q11_BUTN; ?>\" onclick=\"qst_next2('1','coor',document.getElementById('qst_val_x').value,document.getElementById('qst_val_y').value)\"></div></div><span id=\"qst_accpt\"><\/span><\/div><\/div>\n\t\t<div id=\"qstbg\" class=\"neighbour\"><\/div>\n\t\t","number":-11,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":0}
551<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
552{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q11; ?><\/h1><br \/><i>&rdquo;<?php echo Q11_RESP; ?> <b> <?php echo $nvillagename;?> <\/b> <?php echo Q11_RESP1; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>60&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>30&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>40&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>90&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','12');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"neighbour\"><\/div>\n\t\t","number":11,"reward":{"wood":60,"clay":30,"iron":40,"crop":90},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
553<?php }?>
554
555<?php } elseif($_SESSION['qst']== 12){
556
557//Check cranny builded or no
558$cranny = $building->getTypeLevel(23);
559if ($cranny == 0){?>
560{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q12; ?><\/h1><br \/><i>&rdquo;<?php echo Q12_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q12_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"hide\"><\/div>\n\t\t","number":-12,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
561<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
562{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q12; ?><\/h1><br \/><i>&rdquo;<?php echo Q12_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>150&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>180&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>30&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>130&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','13');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"hide\"><\/div>\n\t\t","number":12,"reward":{"wood":150,"clay":180,"iron":30,"crop":130},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
563<?php }?>
564
565<?php } elseif($_SESSION['qst']== 13){
566
567//Check one of each resource is lvl2 or upper
568$tRes = $database->getResourceLevel($session->villages[0]);
569$ironL=0;$clayL=0;$woodL=0;$cropL=0;
570if($tRes['f4']>1){$ironL++;};if($tRes['f7']>1){$ironL++;};if($tRes['f10']>1){$ironL++;};if($tRes['f11']>1){$ironL++;}
571if($tRes['f5']>1){$clayL++;};if($tRes['f6']>1){$clayL++;};if($tRes['f16']>1){$clayL++;};if($tRes['f18']>1){$clayL++;}
572if($tRes['f1']>1){$woodL++;};if($tRes['f3']>1){$woodL++;};if($tRes['f14']>1){$woodL++;};if($tRes['f17']>1){$woodL++;}
573if($tRes['f2']>1){$cropL++;};if($tRes['f8']>1){$cropL++;};if($tRes['f9']>1){$cropL++;};if($tRes['f12']>1){$cropL++;};if($tRes['f13']>1){$cropL++;};if($tRes['f15']>1){$cropL++;}
574if ($ironL<1 || $clayL<1 || $woodL<1 || $cropL<1){?>
575{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q13; ?><\/h1><br \/><i>&rdquo;<?php echo Q13_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q13_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"allres\"><\/div>\n\t\t","number":"-13","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
576<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
577{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q13; ?><\/h1><br \/><i>&rdquo;<?php echo Q13_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>60&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>50&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>40&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>30&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','14');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"allres\"><\/div>\n\t\t","number":13,"reward":{"wood":60,"clay":50,"iron":40,"crop":30},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
578<?php }?>
579
580<?php } elseif($_SESSION['qst']== 14){ 
581
582//Check player submited number Barracks cost lumber
583if ($lSubmited!=210){?>
584{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q14; ?><\/h1><br \/><i>&rdquo;<?php echo Q14_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q14_ORDER; ?><\/div><br \/><input id=\"qst_val\" class=\"text\" type=\"text\" name=\"qstin\" \/> <input onclick=\"qst_next('','lumber',document.getElementById('qst_val').value)\" type=\"button\" value=\"<?php echo Q14_BUTN; ?>\"\/><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"cost\"><\/div>\n\t\t","number":"-14","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
585<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
586{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q14; ?><\/h1><br \/><i>&rdquo;<?php echo Q14_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>50&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>30&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>60&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>20&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','15');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t","number":14,"reward":{"wood":50,"clay":30,"iron":60,"crop":20},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
587<?php }?>
588
589<?php } elseif($_SESSION['qst']== 15){
590
591//Check main building lvl is 3 or upper
592$mainbuilding = $building->getTypeLevel(15);
593if ($mainbuilding<3){?>
594{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q15; ?><\/h1><br \/><i>&rdquo;<?php echo Q15_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q15_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"main\"><\/div>\n\t\t","number":-15,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":0}
595<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
596{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q15; ?><\/h1><br \/><i>&rdquo;<?php echo Q15_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>75&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>75&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>40&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>40&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','16');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"main\"><\/div>\n\t\t","number":15,"reward":{"wood":75,"clay":75,"iron":40,"crop":40},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":0}
597<?php }?>
598
599<?php } elseif($_SESSION['qst']== 16){
600
601// Compare real player rank with submited rank
602$temp['uid']=$session->userinfo['id'];
603$ranking->procRankReq($temp);
604$displayarray = $database->getUserArray($temp['uid'],1);
605$rRes=$ranking->searchRank($displayarray['username'],"username");
606if ($rRes!=$rSubmited){ ?>
607{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q16; ?><\/h1><br \/><i>&rdquo;<?php echo Q16_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q16_ORDER; ?><\/div><br \/><input id=\"qst_val\" class=\"text\" type=\"text\" name=\"qstin\" \/> <input onclick=\"qst_next('','rank',document.getElementById('qst_val').value)\" type=\"button\" value=\"<?php echo Q_BUTN; ?>\"\/><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"rank\"><\/div>\n\t\t","number":"-16","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
608<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
609{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q16; ?><\/h1><br \/><i>&rdquo;<?php echo Q16_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\">100&nbsp;&nbsp;<img src=\"img/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\">90&nbsp;&nbsp;<img src=\"img/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\">100&nbsp;&nbsp;<img src=\"img/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\">60&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','17');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"allres\"><\/div>\n\t\t","number":16,"reward":{"wood":100,"clay":90,"iron":100,"crop":60},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
610<?php }?>
611
612<?php } elseif($_SESSION['qst']== 17){
613
614// Ask from plyer ?>
615{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q17; ?><\/h1><br \/><i>&rdquo;<?php echo Q17_DESC; ?>&rdquo;<\/i><br \/><br \/><input type=\"hidden\" id=\"qst_val\" value=\"\" \/><input onclick=\"javascript: qst_next('','21');\" type=\"button\" value=\"<?php echo Q17_BUTN; ?>\" class=\"qb1\"\/><input onclick=\"javascript: qst_next('','18');\" type=\"button\" value=\"<?php echo Q17_BUTN1; ?>\" class=\"qb2\" \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"granary_rally\"><\/div>\n\t\t","number":"-17","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
616
617<?php } elseif($_SESSION['qst']== 18){
618
619// Checking rollypoint builded or no
620$rallypoint = $building->getTypeLevel(16);
621if ($rallypoint==0){ ?>
622{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q18; ?><\/h1><br \/><i>&rdquo; <?php echo Q18_DESC; ?> <a href=\"build.php?id=39\"><?php echo Q18_DESC1; ?><\/a> <?php echo Q18_DESC2; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q18_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"granary_rally\"><\/div>\n\t\t","number":"-18","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
623<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
624{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q18; ?><\/h1><br \/><i>&rdquo; <?php echo Q18_RESP; ?> &rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>80&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>90&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>60&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>40&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','19');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"granary_rally\"><\/div>\n\t\t","number":18,"reward":{"wood":80,"clay":90,"iron":60,"crop":40},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
625<?php } ?>
626
627<?php } elseif($_SESSION['qst']==19){
628
629// Checking barrack builded or no
630$barrack = $building->getTypeLevel(19);
631if ($barrack==0){ ?>
632{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q19; ?><\/h1><br \/><i>&rdquo;<?php echo Q19_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q19_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"barracks\"><\/div>\n\t\t","number":"-19","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
633<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
634{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q19; ?><\/h1><br \/><i>&rdquo;<?php echo Q19_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q_REWARD; ?><\/p><img src=\"img\/x.gif\" class=\"r1\" alt=\"Lumber\" title=\"Lumber\" \/>70&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>100&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>90&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r4\" alt=\"Crop\" title=\"Crop\" \/>100&nbsp;&nbsp;<\/div><br \/><span id=\"qst_accpt\"><a href=\"javascript: qst_next('','20');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"barracks\"><\/div>\n\t\t","number":19,"reward":{"wood":70,"clay":100,"iron":90,"crop":100},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
635<?php } ?>
636
637<?php } elseif($_SESSION['qst']== 20){
638
639// Checking 2 warrior trained or no
640$units = $village->unitall;
641$unarray=array("",U1,U11,U21);
642$unarray2=array("","u1", "u11","u21");
643if ($units[$unarray2[$session->userinfo['tribe']]]<2){ ?>
644{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q20; ?><\/h1><br \/><i>&rdquo;<?php echo Q20_DESC; ?> <?php echo $unarray[$session->userinfo['tribe']];?>.&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q20_ORDER; ?> <?php echo $unarray[$session->userinfo['tribe']];?>.<\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"units\"><\/div>\n\t\t","number":"-20","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
645<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
646{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q20; ?><\/h1><br \/><i>&rdquo;<?php echo Q20_RESP; ?> <a href=\"warsim.php\"><?php echo Q20_RESP1; ?><\/a>  <?php echo Q20_RESP2; ?> &rdquo;<\/i><br \/><br \/><

Large files files are truncated, but you can click here to view the full file