2 include_once("conf.php");
3 include_once("include/functions.php");
5 function getQuestText($quest_text)
7 $letter = array( '$b' ,'$B$B', '$B' , '$N' , '$n' , '$C' , '$c' , '$r' , '$R' ,'<a' ,'<A');
8 $values = array('<br>','<br>','<br>','(Name)', '(Name)','(Class)','(Class)','(Race)','(Race)','< a','< A');
9 return str_replace($letter, $values, $quest_text);
12 function renderReqCollect($item_id, $maxcount, $count)
16 $name=getItemName($item_id);
17 echo "<tr><td> <a href=\"?item=$item_id\">$name</a>: $count/$maxcount</td></tr>";
20 function renderReqKillOrCast($text,$ReqCreatureOrGOId,$ReqCreatureOrGOCount,$ReqSpellCast, $count)
23 if ($ReqCreatureOrGOId>0)
25 echo "<tr><td><a style='float: right;' href=\"?map&npc=$ReqCreatureOrGOId\">$lang[map]</a> ";
26 if ($ReqSpellCast==0) // Требуется убить моба
29 echo "<a href=\"?npc=$ReqCreatureOrGOId\">$text</a>";
31 echo $lang['kill'].' '.getCreatureName($ReqCreatureOrGOId);
35 // $spell_name=getSpellName($ReqSpellCast);
36 if (!$text) $text = $lang['cast'];
37 echo "<a href=\"?spell=$ReqSpellCast\">$text</a> $lang[cast_on] ".getCreatureName($ReqCreatureOrGOId);
39 echo ": $count/$ReqCreatureOrGOCount</td></tr>";
41 else if ($ReqCreatureOrGOId<0)
43 $ReqCreatureOrGOId=-$ReqCreatureOrGOId;
44 echo "<tr><td><a style='float: right;' href=\"?map&obj=$ReqCreatureOrGOId\">$lang[map]</a> ";
45 if ($ReqSpellCast==0) // Требуется использовать геймобьект
48 echo "<a href=\"?object=$ReqCreatureOrGOId\">$text</a>";
50 echo $lang['use'].' '.getGameobjectName($ReqCreatureOrGOId);
54 if (!$text) $text = $lang['cast'];
55 // $spell_name=getSpellName($ReqSpellCast);
56 echo "<a href=\"?spell=$ReqSpellCast\">$text</a> $lang[cast_on] ".getGameobjectName($ReqCreatureOrGOId);
58 echo ": $count/$ReqCreatureOrGOCount</td></tr>";
61 function renderQuestSource($srcID, $srcCount)
65 $name=getItemName($srcID);
66 echo "<tr><td> <a href=\"?item=$srcID\">$name</a>".($srcCount?
' x '.$srcCount:'').'</td></tr>';
71 $entry = intval(@$_REQUEST['quest']);
72 $guid = intval(@$_REQUEST['guid']);
74 $quest=getQuest($entry);
77 RenderError("$lang[quest_not_found1]");
83 $q_status = $cDB->selectRow("SELECT * FROM `character_queststatus` WHERE `guid` = ?d AND `quest` = ?d", $guid, $entry);
84 if ($lang['www_quest'])
85 echo "<a href=\"".sprintf($lang['www_quest'], $entry)."\" target=\"_blank\"\">".sprintf($lang['www_quest'], $entry)."</a><br>";
87 echo "<table class=quest width=550>";
90 echo "<tr><td class=head>$quest[Title]";
93 echo "<br><FONT size=-3><".getQuestType($quest['Type'])."></FONT>";
95 if (getAllowableRace($quest['RequiredRaces']) && ($quest['RequiredRaces'] & 1101) && ($quest['RequiredRaces'] !=1791))
97 echo "<br><FONT color=#0000ff>$lang[required_races] $lang[Alliance] </FONT><img width=22 height=22 src='images/player_info/factions_img/alliance.gif'>";
98 echo '<br><FONT color=#0000ff>'.$game_text['allowable_race'].' '.getAllowableRace($quest['RequiredRaces']).'</FONT>';
101 if (getAllowableRace($quest['RequiredRaces']) && ($quest['RequiredRaces'] & 690) && ($quest['RequiredRaces'] !=1791))
103 echo "<br><FONT color=#ff0000>$lang[required_races] $lang[Horde] </FONT><img width=22 height=22 src='images/player_info/factions_img/horde.gif'>";
104 echo '<br><FONT color=#ff0000>'.$game_text['allowable_race'].' '.getAllowableRace($quest['RequiredRaces']).'</FONT>';
107 if (($quest['RequiredRaces'] == 0) OR ($quest['RequiredRaces'] == 1791))
110 echo "<br><FONT color=#008800>$lang[required_races] $lang[Both]</FONT>";
111 echo '<br><FONT color=#008800>'.$game_text['allowable_race'].' '.getAllowableRace(1791).'</FONT>';
114 if (getAllowableClass($quest['RequiredClasses']))
115 echo '<br><FONT color=#000000>'.$game_text['allowable_class'].' '.getQAllowableClass($quest['RequiredClasses']).'</FONT>';
117 if ($entry == getQuestOld($entry))
118 echo '<br><FONT color=#ff0000><b>'.$lang['quest_marked'].'</FONT></b>';
124 if ($quest['ZoneOrSort']>0)
125 echo "<a style='float: right;' href=\"?s=q&ZoneID=".$quest['ZoneOrSort']."\">".getAreaName($quest['ZoneOrSort'], 0)."</a>";
127 if ($quest['ZoneOrSort']<0 AND ((-$quest['ZoneOrSort']) >= 374 OR (-$quest['ZoneOrSort']) == 221 OR (-$quest['ZoneOrSort']) == 241 OR ((-$quest['ZoneOrSort']) >= 344 AND (-$quest['ZoneOrSort']) < 371) or
128 (-$quest['ZoneOrSort']) == 284 OR (-$quest['ZoneOrSort']) == 25 OR (-$quest['ZoneOrSort']) == 41 OR (-$quest['ZoneOrSort']) < 24))
129 echo "<a style='float: right;' href=\"?s=q&SortID=".(-$quest['ZoneOrSort'])."\">".getQuestSort(-$quest['ZoneOrSort'], 0)."</a>";
131 echo "$lang[quest_level] $quest[QuestLevel]<br>";
133 if ($quest['RequiredSkill'])
134 echo "<a style='float: right;' href=\"?s=q&SkillID=".($quest['RequiredSkill'])."\">".getSkillName($quest['RequiredSkill'], 0)." ($quest[RequiredSkillValue])</a>";
136 if ($quest['MinLevel'])
137 echo "$lang[obtained_at_level] $quest[MinLevel]</td></tr>";
139 if ($quest['SuggestedPlayers'])
140 echo "<tr><td>$lang[suggestedplayers] <b>$quest[SuggestedPlayers]</b></td></tr>";
142 if ($quest['LimitTime'])
143 echo '<tr><td>'.$lang['qlimittime'].' '.getTimeText($quest['LimitTime']).'</td></tr>';
145 if (getGameEventQuest($quest['entry']))
147 $qevent=getGameEventQuest($quest['entry']);
148 echo '<tr><td>'.$lang['obtained_at_event'].': <FONT color=#E614E6>'.getGameEventName($qevent).'</FONT></td></tr>';
151 if ($quest['SpecialFlags'] & QUEST_SPECIAL_FLAG_MONTHLY
)
152 echo "<tr><td>$lang[item_type]: <a href=\"?s=q&Sfm=".($quest['SpecialFlags'])."\">".$lang['quest_type3']."</a></td></tr>";
154 if ($quest['QuestFlags'] & QUEST_FLAGS_WEEKLY
)
155 echo "<tr><td>$lang[item_type]: <a href=\"?s=q&Sfw=".($quest['QuestFlags'])."\">".$lang['quest_type2']."</a></td></tr>";
157 if ($quest['QuestFlags'] & QUEST_FLAGS_DAILY
)
158 echo "<tr><td>$lang[item_type]: <a href=\"?s=q&Sfd=".($quest['QuestFlags'])."\">".$lang['quest_type1']."</a></td></tr>";
160 if (($quest['SpecialFlags'] & QUEST_SPECIAL_FLAG_REPEATABLE
) && (($quest['SpecialFlags'] & QUEST_SPECIAL_FLAG_MONTHLY
) ==0) && ($quest['QuestFlags'] & (QUEST_FLAGS_DAILY | QUEST_FLAGS_WEEKLY
)) == 0)
161 echo "<tr><td>$lang[item_type]: <a href=\"?s=q&Sfr=".($quest['SpecialFlags'])."\">".$lang['quest_type0']."</a></td></tr>";
163 if ($quest['RequiredMinRepFaction'] OR $quest['RequiredMaxRepFaction'])
164 echo "<tr><td>$lang[item_faction_rank]:</td></tr>";
166 if ($quest['RequiredMinRepFaction'])
168 $qrep_data = getReputationDataFromReputation($quest['RequiredMinRepValue']);
169 echo "<tr><td>".getFactionName($quest['RequiredMinRepFaction']).": ".$qrep_data['rank_name']." - $quest[RequiredMinRepValue]($lang[item_min_level])</td></tr>";
171 if ($quest['RequiredMaxRepFaction'])
173 $qrep_data = getReputationDataFromReputation($quest['RequiredMaxRepValue']);
174 echo "<tr><td>".getFactionName($quest['RequiredMaxRepFaction']).": ".$qrep_data['rank_name']." - $quest[RequiredMaxRepValue]($lang[item_max_level])</td></tr>";
177 $questobjectives = getQuestText($quest['Objectives']);
178 $questrequestitemstext = getQuestText($quest['RequestItemsText']);
179 $questofferrewardtext = getQuestText($quest['OfferRewardText']);
180 if ($questobjectives)
181 echo "<tr><td>$questobjectives<hr></td></tr>";
182 else if ($questrequestitemstext)
183 echo "<tr><td>$questrequestitemstext<hr></td></tr>";
184 else if ($questofferrewardtext)
185 echo "<tr><td>$questofferrewardtext<hr></td></tr>";
188 if ($quest['RepObjectiveFaction'])
189 echo "<tr><td>$lang[item_faction_rank]:</td></tr>";
191 if ($quest['RepObjectiveFaction'])
193 $qrep_data = getReputationDataFromReputation($quest['RepObjectiveValue']);
194 echo "<tr><td>".getFactionName($quest['RepObjectiveFaction']).": ".$qrep_data['rank_name']." - $quest[RepObjectiveValue]($lang[item_min_level])</td></tr>";
197 if ($quest['ReqItemId1'] OR $quest['ReqItemId2'] OR $quest['ReqItemId3'] OR $quest['ReqItemId4'] OR $quest['ReqItemId5'] OR $quest['ReqItemId6'])
199 echo "<tr><td class=mark>$lang[collect]</td></tr>";
200 renderReqCollect($quest['ReqItemId1'],$quest['ReqItemCount1'],$q_status?
$q_status['itemcount1']:0);
201 renderReqCollect($quest['ReqItemId2'],$quest['ReqItemCount2'],$q_status?
$q_status['itemcount2']:0);
202 renderReqCollect($quest['ReqItemId3'],$quest['ReqItemCount3'],$q_status?
$q_status['itemcount3']:0);
203 renderReqCollect($quest['ReqItemId4'],$quest['ReqItemCount4'],$q_status?
$q_status['itemcount4']:0);
204 renderReqCollect($quest['ReqItemId5'],$quest['ReqItemCount5'],$q_status?
$q_status['itemcount5']:0);
205 renderReqCollect($quest['ReqItemId6'],$quest['ReqItemCount6'],$q_status?
$q_status['itemcount6']:0);
209 if ($quest['ReqCreatureOrGOId1'] != 0 OR $quest['ReqCreatureOrGOId2'] != 0 OR
210 $quest['ReqCreatureOrGOId3'] != 0 OR $quest['ReqCreatureOrGOId4'] != 0 )
212 // echo "<tr><td class=mark>$lang[kill]</td></tr>";
213 renderReqKillOrCast($quest['ObjectiveText1'],$quest['ReqCreatureOrGOId1'],$quest['ReqCreatureOrGOCount1'],$quest['ReqSpellCast1'],$q_status?
$q_status['mobcount1']:0);
214 renderReqKillOrCast($quest['ObjectiveText2'],$quest['ReqCreatureOrGOId2'],$quest['ReqCreatureOrGOCount2'],$quest['ReqSpellCast2'],$q_status?
$q_status['mobcount2']:0);
215 renderReqKillOrCast($quest['ObjectiveText3'],$quest['ReqCreatureOrGOId3'],$quest['ReqCreatureOrGOCount3'],$quest['ReqSpellCast3'],$q_status?
$q_status['mobcount3']:0);
216 renderReqKillOrCast($quest['ObjectiveText4'],$quest['ReqCreatureOrGOId4'],$quest['ReqCreatureOrGOCount4'],$quest['ReqSpellCast4'],$q_status?
$q_status['mobcount4']:0);
219 if ($quest['ReqSourceId1'] != 0 OR $quest['ReqSourceId2'] != 0 OR
220 $quest['ReqSourceId3'] != 0 OR $quest['ReqSourceId4'] != 0 )
222 echo "<tr><td class=mark>$lang[req_items]</td></tr>";
223 renderQuestSource($quest['ReqSourceId1'],$quest['ReqSourceCount1']);
224 renderQuestSource($quest['ReqSourceId2'],$quest['ReqSourceCount2']);
225 renderQuestSource($quest['ReqSourceId3'],$quest['ReqSourceCount3']);
226 renderQuestSource($quest['ReqSourceId4'],$quest['ReqSourceCount4']);
230 echo "<tr><td>".getQuestText($quest['Details'])."</td></tr>";
231 if ($quest['CompletedText'])
233 echo "<tr><td class=head>$lang[quest_completed]</td></tr>";
234 echo '<tr><td>'.$quest['CompletedText'].'</td></tr>';
236 if ($quest['SrcItemId'] ||
$quest['SrcSpell'])
238 echo "<tr><td class=head>$lang[provided]</td></tr>";
239 if ($quest['SrcItemId'])
241 $item = getItem($quest['SrcItemId'], "`entry`, `name`, `Quality`, `displayid`");
242 echo '<tr><td class=reward> '.text_show_item($item['entry'], $item['displayid']);
243 echo ' <a class='.$Quality[$item['Quality']].' href="?item='.$item['entry'].'">'.$item['name'].'</a>';
244 if ($quest['SrcItemCount']>1) echo " x$quest[SrcItemCount]";
247 if ($quest['SrcSpell'])
249 $spell=getSpell($quest['SrcSpell']); // Кастуемый спелл
250 if ($spell) $spellName = getSpellName($spell);
251 else $spellName = "Spell $quest[SrcSpell]";
252 echo "<tr><td class=reward> ";show_spell($spell['id'], $spell['SpellIconID']);
253 echo " <a href=\"?spell=$spell[id]\">$spell[SpellName]</a></td></tr>";
256 echo "<tr><td class=head>$lang[quest_rewards]</td></tr>";
258 if ($quest['RewItemId1'] OR $quest['RewItemId1'] OR $quest['RewItemId1'] OR $quest['RewItemId1'])
260 echo "<tr><td class=mark>$lang[Rew_item]</td></tr>";
261 echo "<tr><td class=reward> ";
262 if ($quest['RewItemId1']) {show_item($quest['RewItemId1']);}
263 if ($quest['RewItemId2']) {echo $lang['item_sel_and'];show_item($quest['RewItemId2']);}
264 if ($quest['RewItemId3']) {echo $lang['item_sel_and'];show_item($quest['RewItemId3']);}
265 if ($quest['RewItemId4']) {echo $lang['item_sel_and'];show_item($quest['RewItemId4']);}
268 if ($quest['RewChoiceItemId1'] OR $quest['RewChoiceItemId2'] OR $quest['RewChoiceItemId3'] OR
269 $quest['RewChoiceItemId4'] OR $quest['RewChoiceItemId5'] OR $quest['RewChoiceItemId6'])
271 echo "<tr><td class=mark>$lang[Rew_select_item]</td></tr>";
272 echo "<tr><td class=reward> ";
273 if ($quest['RewChoiceItemId1']) {show_item($quest['RewChoiceItemId1']);}
274 if ($quest['RewChoiceItemId2']) {echo $lang['item_sel_or'];show_item($quest['RewChoiceItemId2']);}
275 if ($quest['RewChoiceItemId3']) {echo $lang['item_sel_or'];show_item($quest['RewChoiceItemId3']);}
276 if ($quest['RewChoiceItemId4']) {echo $lang['item_sel_or'];show_item($quest['RewChoiceItemId4']);}
277 if ($quest['RewChoiceItemId5']) {echo $lang['item_sel_or'];show_item($quest['RewChoiceItemId5']);}
278 if ($quest['RewChoiceItemId6']) {echo $lang['item_sel_or'];show_item($quest['RewChoiceItemId6']);}
281 if ($quest['RewMailTemplateId'])
283 $MailTime=$quest['RewMailDelaySecs']/60/60;
284 $ItemMail=getItemMail($quest['RewMailTemplateId']);
285 echo "<tr><td class=mark>$lang[Rew_mail] $lang[Mail_item_time]".$MailTime."$lang[Mail_time]";
288 echo "<tr><td class=mark>$lang[Rew_item_mail]</td></tr>";
289 echo "<tr><td class=reward> ";{show_item($ItemMail);}
293 if ($quest['RewSpell'] ||
$quest['RewSpellCast'])
295 $learn = $quest['RewSpell'] ?
$quest['RewSpell'] : $quest['RewSpellCast'];
296 $spell=getSpell($learn);
297 if ($spell) $spellName = getSpellName($spell);
298 else $spellName = "Spell $learn";
299 echo '<tr><td class=mark>'.($quest['RewSpell']?
$lang['learn_spell']:$lang['cast_spell']).'</td></tr>';
300 echo "<tr><td class=reward> ";show_spell($spell['id'], $spell['SpellIconID']);
301 echo " <a href=\"?spell=$spell[id]\">$spell[SpellName]</a></td></tr>";
304 for ($i = 1; $i <= 5; $i++
)
306 switch (ABS($quest['RewRepValueId'.$i])):
307 case 1: $RepValueId[$i] = 10; break;
308 case 2: $RepValueId[$i] = 25; break;
309 case 3: $RepValueId[$i] = 75; break;
310 case 4: $RepValueId[$i] = 150; break;
311 case 5: $RepValueId[$i] = 250; break;
312 case 6: $RepValueId[$i] = 350; break;
313 case 7: $RepValueId[$i] = 500; break;
314 case 8: $RepValueId[$i] = 1000; break;
315 case 9: $RepValueId[$i] = 5; break;
316 default: $RepValueId[$i] = 0;
319 $quest_rate[$i] = getRepRewRate($quest['RewRepFaction'.$i]);
321 if ($quest['RewRepValueId'.$i] < 0)
322 $RepValueId[$i] = -$RepValueId[$i];
324 if ($quest['RewRepValue'.$i] && $quest['RewRepValueId'.$i])
325 $quest['RewRepValue'.$i] = $quest['RewRepValue'.$i]/100;
327 if (!$quest['RewRepValue'.$i] && $quest['RewRepValueId'.$i])
328 $quest['RewRepValue'.$i] = $RepValueId[$i];
330 $quest['RewRepValue'.$i]=$quest['RewRepValue'.$i]*$quest_rate[$i];
333 if ($quest['RewRepFaction1'] AND !$quest['RewRepFaction2'] AND
334 !$quest['RewRepFaction3'] AND !$quest['RewRepFaction4'] AND
335 !$quest['RewRepFaction5'])
337 $spillover=getRepSpillover($quest['RewRepFaction1']);
339 foreach ($spillover as $faction)
341 if ($faction['faction1'])
343 $quest['RewRepFaction2']=$faction['faction1'];
344 $quest['RewRepValue2']=$quest['RewRepValue1']*$faction['rate_1'];
346 if ($faction['faction2'])
348 $quest['RewRepFaction3']=$faction['faction2'];
349 $quest['RewRepValue3']=$quest['RewRepValue1']*$faction['rate_2'];
351 if ($faction['faction3'])
353 $quest['RewRepFaction4']=$faction['faction3'];
354 $quest['RewRepValue4']=$quest['RewRepValue1']*$faction['rate_3'];
356 if ($faction['faction4'])
358 $quest['RewRepFaction5']=$faction['faction4'];
359 $quest['RewRepValue5']=$quest['RewRepValue1']*$faction['rate_4'];
364 if ($quest['RewRepFaction1'] OR $quest['RewRepFaction2'] OR
365 $quest['RewRepFaction3'] OR $quest['RewRepFaction4'] OR
366 $quest['RewRepFaction5'])
368 echo "<tr><td class=mark>$lang[Rew_reputation]</td></tr>";
369 if ($quest['RewRepFaction1'] && $quest['RewRepValue1'])echo "<tr><td> ".getFactionName($quest['RewRepFaction1']).": $quest[RewRepValue1]</td></tr>";
370 if ($quest['RewRepFaction2'] && $quest['RewRepValue2'])echo "<tr><td> ".getFactionName($quest['RewRepFaction2']).": $quest[RewRepValue2]</td></tr>";
371 if ($quest['RewRepFaction3'] && $quest['RewRepValue3'])echo "<tr><td> ".getFactionName($quest['RewRepFaction3']).": $quest[RewRepValue3]</td></tr>";
372 if ($quest['RewRepFaction4'] && $quest['RewRepValue4'])echo "<tr><td> ".getFactionName($quest['RewRepFaction4']).": $quest[RewRepValue4]</td></tr>";
373 if ($quest['RewRepFaction5'] && $quest['RewRepValue5'])echo "<tr><td> ".getFactionName($quest['RewRepFaction5']).": $quest[RewRepValue5]</td></tr>";
375 if($quest['RewMoneyMaxLevel']) echo "<tr><td class=mark>$lang[Rew_XP] ".getQuestXPValue($quest)." xp";
376 if($quest['RewHonorAddition'] OR $quest['RewHonorMultiplier'])
378 if ($quest['RewHonorMultiplier'])
379 $ihonor=round(getTeamContributionPoints(79)*$quest['RewHonorMultiplier']*0.1+
$quest['RewHonorAddition']);
381 $ihonor=round($quest['RewHonorAddition']);
382 echo "<tr><td class=mark>$lang[Rew_honor] ".substr($ihonor, 0, 4);
384 if($quest['RewOrReqMoney']) echo "<tr><td class=mark>$lang[Rew_money] ".money($quest['RewOrReqMoney'])."</td></tr>";
388 echo "<tr><td class = head>$lang[start]:</td></tr>";
389 if ($rows = $dDB->select("SELECT *
390 FROM `creature_template` join `creature_questrelation`
392 `creature_questrelation`.`quest` = ?d AND
393 `creature_questrelation`.`id` = `creature_template`.`Entry`", $quest['entry']))
394 foreach ($rows as $creature)
396 localiseCreature($creature);
397 $loyality = getLoyality($creature['FactionAlliance']);
398 echo "<tr><td><a style='float: right;' href=\"?map&npc=$creature[Entry]\">$lang[map]</a>";
399 echo "<a href=\"?npc=$creature[Entry]\">$creature[Name]</a> ($loyality)";
400 if ($creature['SubName'] != "")
401 echo "<br><FONT color=#008800 size=-3><$creature[SubName]></FONT>";
406 if ($rows = $dDB->select("SELECT *
407 FROM `gameobject_template` join `gameobject_questrelation`
409 `gameobject_questrelation`.`quest` = ?d AND
410 `gameobject_questrelation`.`id` = `gameobject_template`.`entry`", $quest['entry']))
411 foreach ($rows as $go)
413 localiseGameobject($go);
414 echo "<tr><td><a style='float: right;' href=\"?map&obj=$go[entry]\">$lang[map]</a>";
415 echo "<a href=\"?object=$go[entry]\">$go[name]</a></td></tr>";
419 if ($rows = $dDB->select("SELECT `entry`, `name`,`Quality`, `displayid` FROM `item_template` WHERE `startquest` = ?d", $quest['entry']))
420 foreach ($rows as $item)
423 echo '<tr><td class=reward> '.text_show_item($item['entry'], $item['displayid']);
424 echo ' <a class='.$Quality[$item['Quality']].' href="?item='.$item['entry'].'">'.$item['name'].'</a>';
429 echo "<tr><td bgColor=#ff0000>$lang[quest_not_found]</td></tr>";
432 echo "<tr><td class = head>$lang[end_q]:</td></tr>";
433 if ($rows = $dDB->select("SELECT *
434 FROM `creature_template` join `creature_involvedrelation`
436 `creature_involvedrelation`.`quest` = ?d AND
437 `creature_involvedrelation`.`id` = `creature_template`.`Entry`", $quest['entry']))
438 foreach ($rows as $creature)
440 localiseCreature($creature);
441 $loyality = getLoyality($creature['FactionAlliance']);
442 echo "<tr><td><a style='float: right;' href=\"?map&npc=$creature[Entry]\">$lang[map]</a>";
443 echo "<a href=\"?npc=$creature[Entry]\">$creature[Name]</a> ($loyality)";
444 if ($creature['SubName'] != "")
445 echo "<br><FONT color=#008800 size=-3><$creature[SubName]></FONT>";
450 if ($rows = $dDB->select("SELECT *
451 FROM `gameobject_template` join `gameobject_involvedrelation`
453 `gameobject_involvedrelation`.`quest` = ?d AND
454 `gameobject_involvedrelation`.`id` = `gameobject_template`.`entry`", $quest['entry']))
455 foreach ($rows as $go)
457 localiseGameobject($go);
458 echo "<tr><td><a style='float: right;' href=\"?map&obj=$go[entry]\">$lang[map]</a>";
459 echo "<a href=\"?object=$go[entry]\">$go[name]</a></td></tr>";
464 echo "<tr><td bgColor=#ff0000>$lang[quest_not_found]</td></tr>";
466 ### этот квест часть серии:
467 $needForQuest = $dDB->selectRow("SELECT * FROM `quest_template` WHERE ABS(`PrevQuestId`) = ?d", $quest['entry']);
468 if ($quest['PrevQuestId'] != 0 OR $quest['NextQuestId'] != 0 OR $needForQuest)
470 echo "<tr><td class = head>$lang[this_quest_is_part_of_a_series]</td></tr>";
472 // Разматываем цепочку квестов назад
473 if ($quest['PrevQuestId']!=0)
475 $prevquest[0]=$quest;
477 while ($prevquest[$list]['PrevQuestId']!=0)
479 $qbefore = getQuest(abs($prevquest[$list]['PrevQuestId']));
482 $prevquest[$list+
1]=$qbefore;
487 $entry = $prevquest[$list]['PrevQuestId'];
488 $prevquest[$list+
1]['entry'] = $entry;
489 $prevquest[$list+
1]['Title'] = "Error qid = $entry";
490 $prevquest[$list+
1]['QuestLevel'] = "??";
495 // Выводим все предыдущие квесты
498 $qinfo = $prevquest[$list-$step];
500 echo "<div style='float: right;'>($lang[level] $qinfo[QuestLevel])</div>";
501 if (getAllowableRace($qinfo['RequiredRaces']) && ($qinfo['RequiredRaces'] & 1101) && ($qinfo['RequiredRaces'] !=1791))
502 echo "$lang[step]($step) <img width=14 height=14 src='images/player_info/factions_img/alliance.gif'> <a href=\"?quest=$qinfo[entry]\">$qinfo[Title]</a>";
504 if (getAllowableRace($qinfo['RequiredRaces']) && ($qinfo['RequiredRaces'] & 690) && ($qinfo['RequiredRaces'] !=1791))
505 echo "$lang[step]($step) <img width=14 height=14 src='images/player_info/factions_img/horde.gif'> <a href=\"?quest=$qinfo[entry]\">$qinfo[Title]</a>";
507 echo "$lang[step]($step) <a href=\"?quest=$qinfo[entry]\">$qinfo[Title]</a>";
513 echo "<div style='float: right;'>($lang[level] $quest[QuestLevel])</div>";
514 if (getAllowableRace($quest['RequiredRaces']) && ($quest['RequiredRaces'] & 1101) && ($quest['RequiredRaces'] !=1791))
515 echo "$lang[step]($step) <img width=14 height=14 src='images/player_info/factions_img/alliance.gif'> $quest[Title]";
517 if (getAllowableRace($quest['RequiredRaces']) && ($quest['RequiredRaces'] & 690) && ($quest['RequiredRaces'] !=1791))
518 echo "$lang[step]($step) <img width=14 height=14 src='images/player_info/factions_img/horde.gif'> $quest[Title]";
520 echo "$lang[step]($step) $quest[Title]";
523 // Пытаемся найти следующие квесты
527 // Сначала по полю NextQuestId
528 if ($nextquest['NextQuestId']!=0)
530 $nextquest = getQuest(abs($nextquest['NextQuestId']));
532 echo "<div style='float: right;'>($lang[level] $nextquest[QuestLevel])</div>";
533 if (getAllowableRace($nextquest['RequiredRaces']) && ($nextquest['RequiredRaces'] & 1101) && ($nextquest['RequiredRaces'] !=1791))
534 echo "$lang[step]($step) <img width=14 height=14 src='images/player_info/factions_img/alliance.gif'> <a href=\"?quest=$nextquest[entry]\">$nextquest[Title]</a>";
536 if (getAllowableRace($nextquest['RequiredRaces']) && ($nextquest['RequiredRaces'] & 690) && ($nextquest['RequiredRaces'] !=1791))
537 echo "$lang[step]($step) <img width=14 height=14 src='images/player_info/factions_img/horde.gif'> <a href=\"?quest=$nextquest[entry]\">$nextquest[Title]</a>";
539 echo "$lang[step]($step) <a href=\"?quest=$nextquest[entry]\">$nextquest[Title]</a>";
542 // Если не вышло то по полю PrevQuestId = $nextquest[entry](у других квестов)
547 localiseQuest($needForQuest);
548 $nextquest=$needForQuest;
550 echo "<div style='float: right;'>($lang[level] $nextquest[QuestLevel])</div>";
551 if (getAllowableRace($nextquest['RequiredRaces']) && ($nextquest['RequiredRaces'] & 1101) && ($nextquest['RequiredRaces'] !=1791))
552 echo "$lang[step]($step) <img width=14 height=14 src='images/player_info/factions_img/alliance.gif'> <a href=\"?quest=$nextquest[entry]\">$nextquest[Title]</a>";
554 if (getAllowableRace($nextquest['RequiredRaces']) && ($nextquest['RequiredRaces'] & 690) && ($nextquest['RequiredRaces'] !=1791))
555 echo "$lang[step]($step) <img width=14 height=14 src='images/player_info/factions_img/horde.gif'> <a href=\"?quest=$nextquest[entry]\">$nextquest[Title]</a>";
557 echo "$lang[step]($step) <a href=\"?quest=$nextquest[entry]\">$nextquest[Title]</a>";
559 $needForQuest = $dDB->selectRow("SELECT * FROM `quest_template` WHERE ABS(`PrevQuestId`) = ?d", $nextquest['entry']);
567 // Ищем квесты требующие выполнение даного квеста
568 $needForQuest = $dDB->selectPage($number, "SELECT * FROM `quest_template` WHERE ABS(`PrevQuestId`) = ?d", $quest['entry']);
569 if ($needForQuest AND $number > 1) // если == 1 то мы уже вывели это в цепочке
571 echo "<tr><td class = head>$lang[req_for_quest_next]</td></tr>";
572 foreach ($needForQuest as $nextquest)
574 localiseQuest($nextquest);
576 echo "<div style='float: right;'>($lang[level] $nextquest[QuestLevel])</div>";
577 if (getAllowableRace($nextquest['RequiredRaces']) && ($nextquest['RequiredRaces'] & 1101) && ($nextquest['RequiredRaces'] !=1791))
578 echo "<img width=14 height=14 src='images/player_info/factions_img/alliance.gif'> <a href=\"?quest=$nextquest[entry]\">$nextquest[Title]</a>";
580 if (getAllowableRace($nextquest['RequiredRaces']) && ($nextquest['RequiredRaces'] & 690) && ($nextquest['RequiredRaces'] !=1791))
581 echo "<img width=14 height=14 src='images/player_info/factions_img/horde.gif'> <a href=\"?quest=$nextquest[entry]\">$nextquest[Title]</a>";
583 echo "<a href=\"?quest=$nextquest[entry]\">$nextquest[Title]</a>";
589 echo "<tr><td class = head>$lang[additional_info]</td></tr>";
590 echo "<tr><td><b style='float: right;'>".getNumPalayersCompletedQuest($quest['entry'])."</b>{$lang['players_completed_quest']}:</td></tr>";
591 echo "<tr><td><b style='float: right;'>".getNumPalayersWithThisQuest($quest['entry'])."</b>{$lang['players_with_this_quest']}:</td></tr>";
592 echo "</tbody></table>";