PageRenderTime 56ms CodeModel.GetById 7ms app.highlight 35ms RepoModel.GetById 1ms app.codeStats 2ms

/Templates/Ajax/quest_core25.tpl

https://github.com/DEVVELO/TravianZ-By-Shadowss
Smarty Template | 1213 lines | 1030 code | 183 blank | 0 comment | 198 complexity | 7f5ab473e536f7cff1cd5cdf0e38a3e9 MD5 | raw file

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

  1<?php
  2#################################################################################
  3##              -= YOU MAY NOT REMOVE OR CHANGE THIS NOTICE =-                 ##
  4## --------------------------------------------------------------------------- ##
  5##  Project:       TravianZ      					                           ##
  6##  Version:       01.09.2013 						                           ##
  7##  Filename       quest_core25.tpl                                            ##
  8##  Developed by:  DesPlus and Marvin                                          ##
  9##  Fixed by:      Shadow / Skype : cata7007 and Armando                       ##
 10##  Revision by:   noonn                                 		               ##
 11##  Official Quest by: ronix                                                   ## 
 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#################################################################################
 18if (!isset($_SESSION)) {
 19 session_start();
 20}
 21include_once("GameEngine/Village.php");
 22include_once("GameEngine/Data/cp.php");
 23
 24$uArray = $database->getUserArray($_SESSION['username'],0);
 25$check_quest=$uArray['quest'];
 26$_SESSION['qst_time'] = $uArray['quest_time'];
 27
 28if($message->unread && !$message->nunread) { $messagelol = "i2"; }
 29else if(!$message->unread && $message->nunread) { $messagelol = "i3"; }
 30else if($message->unread && $message->nunread) { $messagelol = "i1"; }
 31else { $messagelol = "i4"; }
 32
 33//set $skipp_time. Use the SPEED. standard (1x) = 10 hours. 
 34if(SPEED == '1'){ 
 35	$skipp_time="43200"; 
 36} else if(SPEED == '2'){ 
 37	$skipp_time="21600"; 
 38} else if(SPEED == '3'){ 
 39	$skipp_time="11988"; 
 40} else if(SPEED <= '5'){
 41	$skipp_time="7200"; 
 42} else if(SPEED > '5'){ 
 43	$skipp_time="3600"; 
 44} 
 45
 46if (isset($qact)){
 47	if ($check_quest==$qact) {
 48		//avoid hacking gold, resources or reward -- added by Ronix
 49	}else {
 50		switch($qact) {
 51		case 'enter':
 52			$database->updateUserField($_SESSION['username'],'quest','1',0);
 53			$_SESSION['qst']= 1;
 54			break;
 55	
 56	
 57			//user does not follow the quest. 
 58			//Get reward: Resources: Every 24 hours (1 speed)  24/speed=hours
 59			//Gold: 25 gold
 60		case 'skip':
 61			$database->updateUserField($_SESSION['username'],'quest','90',0);
 62			$_SESSION['qst']= 90;
 63			break;
 64
 65		case '2':
 66			$database->updateUserField($_SESSION['username'],'quest','2',0);		
 67			$_SESSION['qst']= 2;	
 68			//Give Reward
 69			$database->FinishWoodcutter($session->villages[0]);	
 70			break;
 71
 72		case '3':
 73			$database->updateUserField($_SESSION['username'],'quest','3',0);
 74			$_SESSION['qst']= 3;
 75			//Give Reward
 76			if(!$session->plus){
 77				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());
 78			} else {
 79				$plus=$database->getUserField($_SESSION['username'],'plus','username');
 80				$plus+=86400;
 81				$database->updateUserField($_SESSION['username'],'plus',$plus,0);
 82			}
 83			break;
 84
 85		case '4':
 86			$database->updateUserField($_SESSION['username'],'quest','4',0);
 87			$_SESSION['qst']= 4;
 88			//Give Reward
 89			$database->modifyResource($session->villages[0],30,60,30,20,1);		
 90			break;
 91	
 92		case 'rank':
 93			$rSubmited=$qact2;
 94			break;
 95	
 96		case '5':
 97			$database->updateUserField($_SESSION['username'],'quest','5',0);
 98			$_SESSION['qst']= 5;
 99			//Give Reward
100			$database->modifyResource($session->villages[0],40,30,20,30,1);	
101			break;
102
103		case '6':
104			$database->updateUserField($_SESSION['username'],'quest','6',0);
105			$_SESSION['qst']= 6;
106			$Subject=Q6_SUBJECT;
107			$Message=Q6_MESSAGE;
108			$database->sendMessage($session->userinfo['id'],4,$Subject,$Message,0,0,0,0,0);
109			$RB=true;
110			//Give Reward
111			$database->modifyResource($session->villages[0],50,60,30,30,1);	
112			break;
113	
114		case '7':
115			$database->updateUserField($_SESSION['username'],'quest','7',0);
116			$_SESSION['qst']= 7;
117			//Give Reward
118			$gold=$database->getUserField($_SESSION['username'],'gold','username');
119			$gold+=20;
120			$database->updateUserField($_SESSION['username'],'gold',$gold,0);
121			break;
122
123		case 'coor':
124			$x=$qact2;
125			$y=$qact3;
126			break;
127			
128		case '8':
129			$database->updateUserField($_SESSION['username'],'quest','8',0);
130			$_SESSION['qst']= 8;
131			//Give Reward
132			$database->modifyResource($session->villages[0],60,30,40,90,1);
133			break;
134	
135		case '9':
136			$crop = round($village->acrop);
137			if ($crop>=200){
138				$database->updateUserField($_SESSION['username'],'quest','9',0);
139				//Get 200 Crop	
140				$database->modifyResource($session->villages[0],0,0,0,-200,1);		
141				//Give Reward
142				$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);
143				$database->addMovement(3,0,$session->villages[0],$attack,time(),time()+43200/INCREASE_SPEED);
144			} else{
145				$NoCrop=Q8_NOCROP;
146			}
147			$_SESSION['qst']= 9;	
148			break;
149	
150		case '10':
151			$database->updateUserField($_SESSION['username'],'quest','10',0);
152			$_SESSION['qst']= 10;
153			//Give Reward
154			$database->modifyResource($session->villages[0],100,80,40,40,1);
155			break;
156	
157		case '11':
158			$database->updateUserField($_SESSION['username'],'quest','11',0);
159			$_SESSION['qst']= 11;
160			//Give Reward
161			if(!$session->plus){
162				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());
163			} else {
164				$plus=$database->getUserField($_SESSION['username'],'plus','username');
165				$plus+=172800;
166				$database->updateUserField($_SESSION['username'],'plus',$plus,0);
167			}
168			break;
169
170		case '12':
171			$database->updateUserField($_SESSION['username'],'quest','12',0);
172			$_SESSION['qst']= 12;
173			//Give Reward
174			$database->modifyResource($session->villages[0],75,140,40,40,1);	
175			break;
176		
177		case '13':
178			$database->updateUserField($_SESSION['username'],'quest','13',0);
179			$_SESSION['qst']= 13;
180			//Give Reward
181			$database->modifyResource($session->villages[0],75,80,30,50,1);
182			break;
183	
184		case '14':
185			$database->updateUserField($_SESSION['username'],'quest','14',0);
186			$_SESSION['qst']= 14;
187			//Give Reward
188			$database->modifyResource($session->villages[0],120,200,140,100,1);
189			break;
190
191		case '15':
192			$database->updateUserField($_SESSION['username'],'quest','15',0);
193			$_SESSION['qst']= 15;
194			//Give Reward
195			$database->modifyResource($session->villages[0],150,180,30,130,1);
196			break;
197	
198		case '16':
199			$database->updateUserField($_SESSION['username'],'quest','16',0);
200			$_SESSION['qst']= 16;
201			//Give Reward
202			$database->modifyResource($session->villages[0],60,50,40,30,1);
203			break;
204
205		case 'lumber':
206			$lSubmited=$qact2;
207			break;
208
209		case '17':
210			$database->updateUserField($_SESSION['username'],'quest','17',0);
211			$_SESSION['qst']= 17;
212			//Give Reward
213			$database->modifyResource($session->villages[0],50,30,60,20,1);
214			break;
215	
216		case '18':
217			$database->updateUserField($_SESSION['username'],'quest','18',0);
218			$_SESSION['qst']= 18;
219			//Give Reward
220			$database->modifyResource($session->villages[0],75,75,40,40,1);
221			break;
222	
223		case '19':
224			$database->updateUserField($_SESSION['username'],'quest','19',0);
225			$_SESSION['qst']= 19;
226			//Give Reward
227			$database->modifyResource($session->villages[0],100,90,100,60,1);
228			break;
229	
230		case '20':
231			$database->updateUserField($_SESSION['username'],'quest','20',0);
232			$_SESSION['qst']= 20;
233			break;
234
235		case '21':
236			$_SESSION['dough']= true;
237			$database->updateUserField($_SESSION['username'],'quest','21',0);
238			$_SESSION['qst']= 21;
239			//Give Reward granary
240			$database->modifyResource($session->villages[0],80,90,60,40,1);
241			break;
242	
243		case '22':
244			$database->updateUserField($_SESSION['username'],'quest','22',0);
245			$_SESSION['qst']= 22;
246			//Give Reward warehouse
247			$database->modifyResource($session->villages[0],70,120,90,50,1);
248			break;
249	
250		case '23':
251			$database->updateUserField($_SESSION['username'],'quest','23',0);
252			$_SESSION['qst']= 23;
253			//Give Reward
254			//$database->modifyResource($session->villages[0],80,90,60,40,1);
255			break;
256	
257		case '24':
258			$database->updateUserField($_SESSION['username'],'quest','24',0);
259			$_SESSION['qst']= 24;
260			//Give Reward rally point
261			$database->modifyResource($session->villages[0],80,90,60,40,1);
262			break;
263	
264		case '25':
265			//$dataarray[3] = 1;
266			$database->updateUserField($_SESSION['username'],'quest','25',0);
267			$_SESSION['qst']= 25;
268			//Give Reward barrack
269			$database->modifyResource($session->villages[0],70,100,90,100,1);
270			break;
271
272		case '26':
273			//$dataarray[4] = 1;
274			$database->updateUserField($_SESSION['username'],'quest','26',0);
275			$_SESSION['qst']= 26;
276			//Give Reward
277			if (isset($_SESSION['dough']) && $_SESSION['dough']==true) {
278				unset($_SESSION['dough']);
279				$database->modifyResource($session->villages[0],200,200,700,250,1);
280			}else{
281				$database->modifyResource($session->villages[0],300,320,360,370,1);
282			}
283			break;
284
285		case '27':
286			//$dataarray[5] = 1;
287			$database->updateUserField($_SESSION['username'],'quest','27',0);
288			$_SESSION['qst']= 27;
289			//Give Reward
290			$gold=$database->getUserField($_SESSION['username'],'gold',1);
291			$gold+=15;
292			$database->updateUserField($_SESSION['username'],'gold',$gold,0);
293			break;
294		
295		case 'gold':
296			$lSubmited=$qact2;
297			break;
298			
299		case '28':
300			//$dataarray[6] = 1;
301			$database->updateUserField($_SESSION['username'],'quest','28',0);
302			$_SESSION['qst']= 28;
303			//Give Reward
304			$database->modifyResource($session->villages[0],80,70,60,40,1);
305			break;
306			
307		case '29':
308			//$dataarray[7] = 1;
309			$database->updateUserField($_SESSION['username'],'quest','29',0);
310			$_SESSION['qst']= 29;
311			//Give Reward
312			$database->modifyResource($session->villages[0],100,60,90,40,1);
313			break;
314    
315		case '30':
316			//$dataarray[8] = 1;
317			$database->updateUserField($_SESSION['username'],'quest','30',0);
318			$_SESSION['qst']= 30;
319			//Give Reward
320			$database->modifyResource($session->villages[0],100,140,90,50,1);
321			break;
322			
323		case '91':
324			$database->updateUserField($_SESSION['username'],'quest','91',0);
325			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
326			$_SESSION['qst']= 91;
327			$_SESSION['qst_time'] = time()+$skipp_time;
328			//Give Reward
329			if(!$session->plus){
330				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());
331			} else {
332				$plus=$database->getUserField($_SESSION['username'],'plus',1);
333				$plus+=86400;
334				$database->updateUserField($_SESSION['username'],'plus',$plus,0);
335			}
336			$gold=$database->getUserField($_SESSION['username'],'gold',1);
337			$gold+=15;
338			$database->updateUserField($_SESSION['username'],'gold',$gold,0);
339			break;
340		
341		case '92':
342			$database->updateUserField($_SESSION['username'],'quest','92',0);
343			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
344			$_SESSION['qst']= 92;
345			$_SESSION['qst_time'] = time()+$skipp_time;
346			//Give Reward
347			$database->modifyResource($session->villages[0],217,247,177,207,1);
348			break;	
349	
350		case '93':
351			$database->updateUserField($_SESSION['username'],'quest','93',0);
352			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
353			$_SESSION['qst']= 93;
354			$_SESSION['qst_time'] = time()+$skipp_time;
355			//Give Reward
356			$database->modifyResource($session->villages[0],217,247,177,207,1);
357			break;	
358	
359		case '94':
360			$database->updateUserField($_SESSION['username'],'quest','94',0);
361			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
362			$_SESSION['qst']= 94;
363			$_SESSION['qst_time'] = time()+$skipp_time;
364			//Give Reward
365			$database->modifyResource($session->villages[0],217,247,177,207,1);
366			break;	
367	
368		case '95':
369			$database->updateUserField($_SESSION['username'],'quest','95',0);
370			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
371			$_SESSION['qst']= 95;
372			$_SESSION['qst_time'] = time()+$skipp_time;
373			//Give Reward
374			$database->modifyResource($session->villages[0],217,247,177,207,1);
375			break;	
376	
377		case '96':
378			$database->updateUserField($_SESSION['username'],'quest','96',0);
379			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()+$skipp_time).'',0);
380			$_SESSION['qst']= 96;
381			$_SESSION['qst_time'] = time()+$skipp_time;
382			//Give Reward
383			$database->modifyResource($session->villages[0],217,247,177,207,1);
384			break;	
385	
386		case '97':
387			$database->updateUserField($_SESSION['username'],'quest','97',0);
388			$database->updateUserField($_SESSION['username'],'quest_time',''.(time()).'',0);
389			$_SESSION['qst_time'] = time();
390			$_SESSION['qst']= 97;
391			//Give Reward 20 gold + 2 days plus
392			if(!$session->plus){
393				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());
394			} else {
395				$plus=$database->getUserField($_SESSION['username'],'plus',1);
396				$plus+=172800;
397				$database->updateUserField($_SESSION['username'],'plus',$plus,0);
398			}
399			$gold=$database->getUserField($_SESSION['username'],'gold',1);
400			$gold+=20;
401			$database->updateUserField($_SESSION['username'],'gold',$gold,0);
402			break;
403		}	
404	}
405}
406
407header("Content-Type: application/json;");
408if($session->access!=BANNED){
409    if($_SESSION['qst']== 0){?>
410{"markup":"<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><div id=\"qstbg\" class=\"intro\"></div>","number":null,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":1}
411
412<?php } elseif($_SESSION['qst']== 1){
413
414//Check one of Woodcutters is level 1 or upper 
415$tRes = $database->getResourceLevel($session->villages[0]);
416$woodL=$tRes['f1']+$tRes['f3']+$tRes['f14']+$tRes['f17'];
417	//check if you are building a woodcutter to level 1
418	foreach($building->buildArray as $jobs) {
419			if($jobs['type']==1){
420				$woodL="99";
421			}	
422      	}
423if ($woodL<1){?>
424{"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}
425<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
426{"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}
427<?php }?>
428
429<?php } elseif($_SESSION['qst']== 2){ 
430
431//Check one of Croplands is level 1 or upper 
432$tRes = $database->getResourceLevel($session->villages[0]);
433$cropL=$tRes['f2']+$tRes['f8']+$tRes['f9']+$tRes['f12']+$tRes['f13']+$tRes['f15'];
434if ($cropL<1){?>
435{"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}
436<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
437{"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}
438<?php }?>
439
440<?php } elseif($_SESSION['qst']== 3){ 
441
442//Check the village name is changed or is default name
443
444$vName=$village->vname;
445if ($vName==$session->userinfo['username']."'s village"){?>
446{"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}
447<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
448{"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}
449<?php }?>
450
451<?php } elseif($_SESSION['qst']== 4){
452
453// Compare real player rank with submited rank
454$temp['uid']=$session->userinfo['id'];
455$ranking->procRankReq($temp);
456$displayarray = $database->getUserArray($temp['uid'],1);
457$rRes=$ranking->searchRank($displayarray['username'],"username");
458if ($rRes!=$rSubmited){?>
459{"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 Q_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}
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 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}
462<?php }?>
463
464<?php } elseif($_SESSION['qst']== 5){ 
465
466//Check one of Iron Mines and one of Clay Pites are level 1 or upper 
467$tRes = $database->getResourceLevel($session->villages[0]);
468$ironL=$tRes['f4']+$tRes['f7']+$tRes['f10']+$tRes['f11'];
469$clayL=$tRes['f5']+$tRes['f6']+$tRes['f16']+$tRes['f18'];
470if ($ironL<1 || $clayL<1){?>
471{"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}
472<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
473{"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}
474<?php }?>
475
476<?php } elseif($_SESSION['qst']== 6){ 
477
478//Check message is viewed or no
479if ($message->unread || $RB==true){?>
480{"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}
481<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
482{"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 <img src=\"img\/x.gif\" class=\"gold\" alt=\"Gold\" title=\"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}
483<?php }?>
484
485<?php } elseif($_SESSION['qst']== 7){
486//neighbourhood
487$getvID = $database->getVillageID($session->uid);
488$nvillage = $database->getFieldDistance($getvID);
489$ncoor = $database->getCoor($nvillage);
490$nvillagename = $database->getVillageField($nvillage,"name");
491if ($x!=$ncoor['x'] or $y!=$ncoor['y']){?>
492{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_7; ?></h1><br><i>&rdquo;<?php echo Q25_7_DESC; ?> <b><?php echo $nvillagename; ?></b>. <?php echo Q25_7_DESC1; ?>&rdquo;</i><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_7_ORDER; ?> <b><?php echo $nvillagename; ?></b> <?php echo Q25_7_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 Q_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":-7,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":0}
493<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
494{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_7; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_7_RESP; ?> <b> <?php echo $nvillagename;?> <\/b> <?php echo Q25_7_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('','8');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"neighbour\"><\/div>\n\t\t","number":7,"reward":{"wood":60,"clay":30,"iron":40,"crop":90},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
495<?php }?>
496
497<?php } elseif($_SESSION['qst']== 8){
498//hugh army
499?>
500{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_8; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_8_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_8_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 Q25_8_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}
501
502<?php } elseif($_SESSION['qst']== 9){
503//one each
504//Check additional of each resource upgraded to lvl1 or upper
505$tRes = $database->getResourceLevel($session->villages[0]);
506$ironL=0;$clayL=0;$woodL=0;$cropL=0;
507if($tRes['f4']>0){$ironL++;};if($tRes['f7']>0){$ironL++;};if($tRes['f10']>0){$ironL++;};if($tRes['f11']>0){$ironL++;}
508if($tRes['f5']>0){$clayL++;};if($tRes['f6']>0){$clayL++;};if($tRes['f16']>0){$clayL++;};if($tRes['f18']>0){$clayL++;}
509if($tRes['f1']>0){$woodL++;};if($tRes['f3']>0){$woodL++;};if($tRes['f14']>0){$woodL++;};if($tRes['f17']>0){$woodL++;}
510if($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++;}
511
512if ($ironL<2 || $clayL<2 || $woodL<2 || $cropL<2){?>
513{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_9; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_9_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_9_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}
514<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
515{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_9; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_9_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\" \/>100&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\" \/>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('','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}
516<?php }?>
517
518<?php } elseif($_SESSION['qst']== 10){
519//comming soon
520//Check rat is in villa
521$rat = $database->getEnforce($session->villages[0], 0);
522if ($rat['u31']<1){?>
523{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_10; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_10_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_10_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"army\"><\/div>\n\t\t","number":-10,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
524<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
525{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_10; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_10_RESP; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><input type=\"hidden\" id=\"qst_val\" value=\"2\" \/><?php echo Q25_10_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=\"army\"><\/div>\n\t\t","number":10,"reward":{"plus":2},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
526<?php }?>
527
528<?php } elseif($_SESSION['qst']== 11){ 
529
530//Check report is viewed or no
531if (count($database->getUnViewNotice($session->uid))>0) {?>
532{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_11; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_11_DESC; ?>.&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_11_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"report\"><\/div>\n\t\t","number":"-11","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"i2","altstep":99}
533<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
534{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_11; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_11_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\" \/>140&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('','12');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"report\"><\/div>\n\t\t","number":11,"reward":{"wood":75,"clay":140,"iron":40,"crop":40},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
535<?php }?>
536
537<?php } elseif($_SESSION['qst']== 12){
538//everything to One
539//Check additional of each resource upgraded to lvl1 or upper
540$tRes = $database->getResourceLevel($session->villages[0]);
541$ironL=0;$clayL=0;$woodL=0;$cropL=0;
542if($tRes['f4']>0){$ironL++;};if($tRes['f7']>0){$ironL++;};if($tRes['f10']>0){$ironL++;};if($tRes['f11']>0){$ironL++;}
543if($tRes['f5']>0){$clayL++;};if($tRes['f6']>0){$clayL++;};if($tRes['f16']>0){$clayL++;};if($tRes['f18']>0){$clayL++;}
544if($tRes['f1']>0){$woodL++;};if($tRes['f3']>0){$woodL++;};if($tRes['f14']>0){$woodL++;};if($tRes['f17']>0){$woodL++;}
545if($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++;}
546if ($ironL<4 || $clayL<4 || $woodL<4 || $cropL<6){?>
547{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_12; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_12_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_12_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"allres\"><\/div>\n\t\t","number":-12,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
548<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
549{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_12; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_12_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('','13');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"allres\"><\/div>\n\t\t","number":12,"reward":{"wood":75,"clay":80,"iron":30,"crop":50},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
550<?php }?>
551
552<?php } elseif($_SESSION['qst']== 13){ 
553
554//Check player Descriptions for [#0]
555$Dave= strrpos ($uArray['desc1'],'[#0]');
556$Dave2=strrpos ($uArray['desc2'],'[#0]');
557if (!is_numeric($Dave) and !is_numeric($Dave2)){?>
558{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_13; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_13_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_13_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"medal\"><\/div>\n\t\t","number":"-13","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
559<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
560{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_13; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_13_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\" \/>120&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r2\" alt=\"Clay\" title=\"Clay\" \/>200&nbsp;&nbsp;<img src=\"img\/x.gif\" class=\"r3\" alt=\"Iron\" title=\"Iron\" \/>140&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('','14');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"medal\"><\/div>\n\t\t","number":13,"reward":{"wood":120,"clay":200,"iron":140,"crop":100},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
561<?php }?>
562
563<?php } elseif($_SESSION['qst']== 14){
564
565//Check cranny builded or no
566$cranny = $building->getTypeLevel(23);
567if ($cranny == 0){?>
568{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_14; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_14_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_14_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"hide\"><\/div>\n\t\t","number":-14,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
569<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
570{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_14; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_14_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('','15');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"hide\"><\/div>\n\t\t","number":14,"reward":{"wood":150,"clay":180,"iron":30,"crop":130},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
571<?php }?>
572
573<?php } elseif($_SESSION['qst']== 15){
574
575//Check one of each resource is lvl2 or upper
576$tRes = $database->getResourceLevel($session->villages[0]);
577$ironL=0;$clayL=0;$woodL=0;$cropL=0;
578if($tRes['f4']>1){$ironL++;};if($tRes['f7']>1){$ironL++;};if($tRes['f10']>1){$ironL++;};if($tRes['f11']>1){$ironL++;}
579if($tRes['f5']>1){$clayL++;};if($tRes['f6']>1){$clayL++;};if($tRes['f16']>1){$clayL++;};if($tRes['f18']>1){$clayL++;}
580if($tRes['f1']>1){$woodL++;};if($tRes['f3']>1){$woodL++;};if($tRes['f14']>1){$woodL++;};if($tRes['f17']>1){$woodL++;}
581if($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++;}
582if ($ironL<1 || $clayL<1 || $woodL<1 || $cropL<1){?>
583{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_15; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_15_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_15_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"allres\"><\/div>\n\t\t","number":"-15","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
584<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
585{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_15; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_15_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('','16');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"allres\"><\/div>\n\t\t","number":15,"reward":{"wood":60,"clay":50,"iron":40,"crop":30},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":99}
586<?php }?>
587
588<?php } elseif($_SESSION['qst']== 16){ 
589
590//Check player submited number Barracks cost lumber
591if ($lSubmited!=210){?>
592{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_16; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_16_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_16_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 Q_BUTN; ?>\"\/><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"cost\"><\/div>\n\t\t","number":"-16","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
593<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
594{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_16; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_16_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('','17');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"cost\"><\/div>\n\t\t","number":16,"reward":{"wood":50,"clay":30,"iron":60,"crop":20},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
595<?php }?>
596
597<?php } elseif($_SESSION['qst']== 17){
598
599//Check main building lvl is 3 or upper
600$mainbuilding = $building->getTypeLevel(15);
601if ($mainbuilding<3){?>
602{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_17; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_17_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_17_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"main\"><\/div>\n\t\t","number":-17,"reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":0}
603<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
604{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_17; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_17_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('','18');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"main\"><\/div>\n\t\t","number":17,"reward":{"wood":75,"clay":75,"iron":40,"crop":40},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>g","msrc":"<?php echo $messagelol; ?>","altstep":0}
605<?php }?>
606
607<?php } elseif($_SESSION['qst']== 18){
608
609// Compare real player rank with submited rank
610$temp['uid']=$session->userinfo['id'];
611$ranking->procRankReq($temp);
612$displayarray = $database->getUserArray($temp['uid'],1);
613$rRes=$ranking->searchRank($displayarray['username'],"username");
614if ($rRes!=$rSubmited){ ?>
615{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_18; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_18_DESC; ?>&rdquo;<\/i><br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_18_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":"-18","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
616<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
617{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_18; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_18_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('','19');\"><?php echo Q_CONTINUE; ?><\/a><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"rank\"><\/div>\n\t\t","number":18,"reward":{"wood":100,"clay":90,"iron":100,"crop":60},"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
618<?php }?>
619
620<?php } elseif($_SESSION['qst']== 19){
621
622// Ask from plyer ?>
623{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_19; ?><\/h1><br \/><i>&rdquo;<?php echo Q25_19_DESC; ?>&rdquo;<\/i><br \/><br \/><input type=\"hidden\" id=\"qst_val\" value=\"\" \/><input onclick=\"javascript: qst_next('','20');\" type=\"button\" value=\"<?php echo Q25_19_BUTN; ?>\" class=\"qb1\"\/><input onclick=\"javascript: qst_next('','23');\" type=\"button\" value=\"<?php echo Q25_19_BUTN1; ?>\" class=\"qb2\" \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"granary_rally\"><\/div>\n\t\t","number":"-19","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
624
625<?php } elseif($_SESSION['qst']== 20){
626
627// Checking granary builded or no
628$granary = $building->getTypeLevel(11);
629if ($granary ==0){ ?>
630{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_20; ?> <\/h1><br \/><i>&rdquo;<?php echo Q25_20_DESC; ?>&rdquo;<br \/><br \/><div class=\"rew\"><p class=\"ta_aw\"><?php echo Q25_20_ORDER; ?><\/div><br \/><span id=\"qst_accpt\"><\/span><\/div>\n\t\t<div id=\"qstbg\" class=\"granary\"><\/div>\n\t\t","number":"-20","reward":false,"qgsrc":"q_l<?php echo $session->userinfo['tribe'];?>","msrc":"<?php echo $messagelol; ?>","altstep":99}
631<?php $_SESSION['qstnew']='0'; }else{ $_SESSION['qstnew']='1'; ?>
632{"markup":"\n\t\t<div id=\"qstd\"><h1> <img class=\"point\" src=\"img\/x.gif\" alt=\"\" title=\"\"\/> <?php echo Q25_20; ?> <\/h1><br \/><i>&rdquo;<?php echo Q25_20_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\" t

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