1 | <?php
|
---|
2 | if($vlozeni_souboru == "OK"){
|
---|
3 | ?>
|
---|
4 |
|
---|
5 | <?php
|
---|
6 |
|
---|
7 | if( !empty($q) AND !empty($id) ){
|
---|
8 | if( !empty($lvl_d) AND !empty($lvl_h) ){ $where = "(`MinLevel`>='$lvl_d' AND `MinLevel`<='$lvl_h') AND "; };
|
---|
9 | $sql_select = SQLselect_Strankovani("SELECT * FROM quest_template WHERE ( $where`Title` LIKE '%$q%' )", $limit, 20, "?id=questy&q=".$q."&lvl_d=".$lvl_d."&lvl_h=".$lvl_h, $SID, $DB_mangos);
|
---|
10 | if( @mysql_num_rows($sql_select[1]) > 0 ){ $i = 0;
|
---|
11 | $sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
|
---|
12 | $sql_select['result'] .= "<thead><tr><td>Název úkolu</td><td>Min level</td><td>Úkol zadává</td><td>Úkol</td></tr></thead>\n<col width=\"180px\"><col width=\"70px\">";
|
---|
13 |
|
---|
14 | while( $result = MySQL_Fetch_Array($sql_select[1]) ){
|
---|
15 | $sql_select['result'] .= " <tr valign='top'>";
|
---|
16 | $sql_select['result'] .= "<td><a href=\"index.php?quest=".$result['entry']."\">".$result['Title']."</a></td>";
|
---|
17 | $sql_select['result'] .= "<td>".$result['MinLevel']."</td>";
|
---|
18 | $sql_select['result'] .= "<td>";
|
---|
19 |
|
---|
20 | $startovni_creature_dotaz = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$result['entry']." ",$DB_mangos);
|
---|
21 | while( $start_creature = @MySQL_Fetch_Array($startovni_creature_dotaz) ){
|
---|
22 | $sql_select['result'] .= "<a href=\"index.php?creature=".$start_creature['entry']."\">".$start_creature['name']."</a><br>";
|
---|
23 | };
|
---|
24 | $startovni_gameobject_dotaz = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$result['entry']." ",$DB_mangos);
|
---|
25 | while( $start_gameobject = @MySQL_Fetch_Array($startovni_gameobject_dotaz) ){
|
---|
26 | $sql_select['result'] .= "<a href=\"index.php?gameobject=".$start_gameobject['entry']."\">".$start_gameobject['name']."</a><br>";
|
---|
27 | };
|
---|
28 |
|
---|
29 | $sql_select['result'] .= "</td>";
|
---|
30 | $sql_select['result'] .= "<td>".$result['Objectives']."</td>";
|
---|
31 | $sql_select['result'] .= "</tr>\n";
|
---|
32 | };
|
---|
33 |
|
---|
34 | $sql_select['result'] .= "</table>\n";
|
---|
35 | };
|
---|
36 |
|
---|
37 | }
|
---|
38 | elseif( !empty($quest) AND empty($id) ){
|
---|
39 | $sql_select['sql'] = mysql_query("SELECT * FROM quest_template WHERE `entry`='$quest' LIMIT 1;",$DB_mangos);
|
---|
40 | if( @mysql_num_rows($sql_select['sql']) > 0 ){ $i = 0;
|
---|
41 | $result = MySQL_Fetch_Array($sql_select['sql']);
|
---|
42 | $sql_select['quest'] = $result;
|
---|
43 |
|
---|
44 | // Zjištění creatur a gameobjectů kde se Quest dá vzít
|
---|
45 | $startovni_NPC_dotaz_creature = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$sql_select['quest']['entry']." ",$DB_mangos);
|
---|
46 | if( @mysql_num_rows($startovni_NPC_dotaz_creature) > 0 ){
|
---|
47 | while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_creature)){
|
---|
48 | $sql_select['other']['StartNPC'] .= "<a href=\"index.php?creature=".$start_NPC['entry']."\">".$start_NPC['name']."</a><br>\n";
|
---|
49 | }; };
|
---|
50 | $startovni_NPC_dotaz_gameobject = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$sql_select['quest']['entry']." ",$DB_mangos);
|
---|
51 | if( @mysql_num_rows($startovni_NPC_dotaz_gameobject) > 0 ){
|
---|
52 | while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_gameobject)){
|
---|
53 | $sql_select['other']['StartNPC'] .= "<a href=\"index.php?gameobject=".$start_NPC['entry']."\">".$start_NPC['name']."</a><br>\n";
|
---|
54 | }; };
|
---|
55 | if( empty($sql_select['other']['StartNPC']) ){
|
---|
56 | $sql_select['other']['StartNPC'] = "<b>Úkol není kde začít!<br> Nahlaste to prosím adminovy!</b>"; }
|
---|
57 |
|
---|
58 | // Zjištění Oblasti
|
---|
59 | if( AbsCheck($sql_select['quest']['ZoneOrSort']) ){ }
|
---|
60 | else{ };
|
---|
61 |
|
---|
62 | // Důležitá věc
|
---|
63 | $SrcItemId_dotaz = mysql_query("SELECT * FROM item_template WHERE entry =".$sql_select['quest']['SrcItemId']." LIMIT 1;",$DB_mangos);
|
---|
64 | if( @mysql_num_rows($SrcItemId_dotaz) > 0 ){
|
---|
65 | $SrcItemId = @MySQL_Fetch_Array($SrcItemId_dotaz);
|
---|
66 | $sql_select['other']['SrcItemId'] .= "<a href=\"index.php?item=".$SrcItemId['entry']."\">".$SrcItemId['name']."</a><br>\n";
|
---|
67 | };
|
---|
68 |
|
---|
69 | $sql_select['quest']['PrevQuestId'];
|
---|
70 | $sql_select['quest']['NextQuestId'];
|
---|
71 |
|
---|
72 | $sql_select['other']['ReqItems']; // ReqItemId1-4.ReqItemCount1-4
|
---|
73 |
|
---|
74 | $sql_select['other']['ReqSource']; // ??
|
---|
75 | /* ReqSourceId1-4
|
---|
76 | These fields are used in core quest-drop logic. They allow players to get quest drops which are not quest delivery items (ReqItem stand for this), but needed to create quest delivery by player or needed to cast ReqSpellCasts. ReqSourceId1 is the item_template id of a source item for creation of ReqItemX or casting of ReqSpellCastX. X is the value of ReqSourceRef1. Only items which have a quest drop chance (having QuestChance > 0 in *_loot_template) should be used as sources here.
|
---|
77 | The same for ReqSourceId2-4
|
---|
78 | You may define 1, 2, 3 or even all 4 sources for the same ReqItem/ReqSpellCast or use 4 sources for 4 ReqItems/ReqSpellCasts.
|
---|
79 | ReqSourceCount1-4
|
---|
80 | Amount of ReqSourceId items the player may gather per unfinished ReqItemId or ReqSpellCast.
|
---|
81 | So ReqSourceId1 items will drop up to a total amount of (ReqItemCount(ReqSourceRef1) - already owned ReqItemId(ReqSourceRef1)) * ReqSourceCount1. Same for ReqSpellCast objectives.
|
---|
82 | ReqSourceRef1-4
|
---|
83 | Should be 0 or 1..4. See ReqSourceId description. */
|
---|
84 |
|
---|
85 | $sql_select['other']['ReqCreatureOrGOId']; // need to kill/cast
|
---|
86 | /* Value > 0: 1.-4. required creature_template ID the player needs to kill/cast on in order to complete the quest.
|
---|
87 | Value < 0: 1.-4. required gameobject_template ID the player needs to cast on in order to complete the quest.
|
---|
88 | If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */
|
---|
89 |
|
---|
90 | $sql_select['other']['ReqSpellCast'];
|
---|
91 | /* Spell ID of Spell that needs to be cast in order to fulfill a quest objective.
|
---|
92 | If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */
|
---|
93 |
|
---|
94 | $sql_select['other']['ReqSpellCast'];
|
---|
95 | /* Spell ID of Spell that needs to be cast in order to fulfill a quest objective.
|
---|
96 | If ReqSpellCastN > 0 then at ReqCreatureOrGOIdN must be casted spell ReqSpellCastN, if ReqSpellCastN = 0 then it must be killed. */
|
---|
97 |
|
---|
98 | $sql_select['other']['RewChoiceItemId']; // !!! RewChoiceItemCount
|
---|
99 | /* Id of the 1.-6. Item available for reward choice. */
|
---|
100 |
|
---|
101 | $sql_select['other']['RewItemId']; // !!! RewItemCount
|
---|
102 | /* 1.-4. item Id given for reward (no choice). */
|
---|
103 |
|
---|
104 |
|
---|
105 | } else{ $sql_select['error'] = "<p>Quest nebyl nalezen.</p>"; };
|
---|
106 |
|
---|
107 | }
|
---|
108 | elseif( !empty($creature) AND empty($id) ){
|
---|
109 | $sql_select['sql'] = mysql_query("SELECT * FROM creature_template WHERE `entry`='$creature' LIMIT 1;",$DB_mangos);
|
---|
110 | if( @mysql_num_rows($sql_select['sql']) > 0 ){ $i = 0;
|
---|
111 | $result = MySQL_Fetch_Array($sql_select['sql']);
|
---|
112 | $sql_select['creature'] = $result;
|
---|
113 |
|
---|
114 | $questy_dotaz_creature = mysql_query("SELECT * FROM `creature_questrelation` LEFT JOIN `quest_template` ON `creature_questrelation`.`quest` = `quest_template`.`entry` WHERE (`creature_questrelation`.`id` =".$sql_select['creature']['entry']." AND `quest_template`.`PrevQuestId`=0 ) ",$DB_mangos);
|
---|
115 | if( @mysql_num_rows($questy_dotaz_creature) > 0 ){
|
---|
116 | while($quest_NPC = @MySQL_Fetch_Array($questy_dotaz_creature)){
|
---|
117 | $sql_select['other']['creature_quests'] .= "<a href=\"index.php?quest=".$quest_NPC['entry']."\">".$quest_NPC['Title']."</a><br>\n";
|
---|
118 | }; };
|
---|
119 |
|
---|
120 | } else{ $sql_select['error'] = "<p>Creep nebyl nalezen.</p>"; };
|
---|
121 |
|
---|
122 | };
|
---|
123 |
|
---|
124 |
|
---|
125 | ?>
|
---|
126 |
|
---|
127 |
|
---|
128 | <?php
|
---|
129 | };
|
---|
130 | ?>
|
---|
131 |
|
---|