function objectinfo($id, $level = 0) { global $DB; global $object_cols; $row = $DB->selectRow(' SELECT g.?# {, l.name_loc?d AS `name_loc`} FROM gameobject_template g {LEFT JOIN (locales_gameobject l) ON l.entry=g.entry AND ?d} WHERE g.entry = ?d LIMIT 1 ', $object_cols[$level], $_SESSION['locale'] > 0 ? $_SESSION['locale'] : DBSIMPLE_SKIP, $_SESSION['locale'] > 0 ? 1 : DBSIMPLE_SKIP, $id); return objectinfo2($row, $level); }
foreach ($tmp as $t) { $m[] = $t['entry']; } } $rows = $DB->select(' SELECT g.?# {, l.name_loc?d AS `name_loc`} FROM gameobject_template g {LEFT JOIN (locales_gameobject l) ON l.entry=g.entry AND ?d} WHERE name LIKE ? {OR g.entry IN (?a)} ', $object_cols[0], $m ? $_SESSION['locale'] : DBSIMPLE_SKIP, $m ? 1 : DBSIMPLE_SKIP, $nsearch, $m ? $m : DBSIMPLE_SKIP); unset($m); unset($t); unset($tmp); foreach ($rows as $numRow => $row) { $found['object'][] = objectinfo2($row); } // Ищем квесты if ($_SESSION['locale'] > 0) { $tmp = $DB->select(' SELECT entry FROM locales_quest WHERE Title_loc?d LIKE ? ', $_SESSION['locale'], $nsearch); foreach ($tmp as $t) { $m[] = $t['entry']; } } $rows = $DB->select(' SELECT *
FROM ?_gameobject_template g, ?_udwbase_lock a WHERE g.data1=?d AND g.type=?d AND a.lockID=g.data0 ', $lootid, GAMEOBJECT_TYPE_CHEST, LOCK_PROPERTIES_HERBALISM, LOCK_PROPERTIES_MINING); foreach ($rows as $numRow => $row) { if ($row['lockproperties1'] == LOCK_PROPERTIES_MINING) { // Залежи руды $item['minedfromobject'][] = array_merge(objectinfo2($row), $drop); } elseif ($row['lockproperties1'] == LOCK_PROPERTIES_HERBALISM) { // Собирается с трав $item['gatheredfromobject'][] = array_merge(objectinfo2($row), $drop); } else { // Сундуки $item['containedinobject'][] = array_merge(objectinfo2($row), $drop); } } } if (!$item['containedinobject']) { unset($item['containedinobject']); } if (!$item['minedfromobject']) { unset($item['minedfromobject']); } if (!$item['gatheredfromobject']) { unset($item['gatheredfromobject']); } unset($rows); } unset($drops_go);