Changeset 82 for db/post_read.php
- Timestamp:
- Sep 29, 2007, 8:25:17 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
db/post_read.php
r78 r82 5 5 <?php 6 6 7 if( array_key_exists('quest', $_GET) AND !empty($id) ){7 if( !empty($q) AND !empty($id) ){ 8 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 uest%' )", $limit, 20, "?id=questy&quest=".$quest."&lvl_d=".$lvl_d."&lvl_h=".$lvl_h, $SID);10 if( @mysql_num_rows($sql_select[1]) > "0" ) { $i = "0";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); 10 if( @mysql_num_rows($sql_select[1]) > 0 ){ $i = 0; 11 11 $sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; 12 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 13 14 while( $result = @MySQL_Fetch_Array($sql_select[1]) ){14 while( $result = MySQL_Fetch_Array($sql_select[1]) ){ 15 15 $sql_select['result'] .= " <tr valign='top'>"; 16 16 $sql_select['result'] .= "<td><a href=\"index.php?quest=".$result['entry']."\">".$result['Title']."</a></td>"; … … 35 35 }; 36 36 37 }; 37 } 38 elseif( !empty($quest) AND empty($id) ){ 39 $sql_select['sql'] = mysql_query("SELECT * FROM quest_template WHERE `entry`='$quest' LIMIT 1;"); 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']." "); 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']." "); 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;"); 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;"); 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 ) "); 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 38 124 39 125 ?>
Note:
See TracChangeset
for help on using the changeset viewer.