Пример #1
0
 if ($rows = $dDB->select("SELECT *\n                          FROM `creature_template` join `creature_involvedrelation`\n                          WHERE\n                          `creature_involvedrelation`.`quest` = ?d AND\n                          `creature_involvedrelation`.`id` = `creature_template`.`entry`", $quest['entry'])) {
     foreach ($rows as $creature) {
         localiseCreature($creature);
         $loyality = getLoyality($creature['faction_A']);
         echo "<tr><td><a style='float: right;' href=\"?map&npc={$creature['entry']}\">{$lang['map']}</a>";
         echo "<a href=\"?npc={$creature['entry']}\">{$creature['name']}</a> ({$loyality})";
         if ($creature['subname'] != "") {
             echo "<br><FONT color=#008800 size=-3>&lt;{$creature['subname']}&gt;</FONT>";
         }
         echo "</td></tr>";
         $number++;
     }
 }
 if ($rows = $dDB->select("SELECT *\n                          FROM `gameobject_template` join `gameobject_involvedrelation`\n                          WHERE\n                          `gameobject_involvedrelation`.`quest` = ?d AND\n                          `gameobject_involvedrelation`.`id` = `gameobject_template`.`entry`", $quest['entry'])) {
     foreach ($rows as $go) {
         localiseGameobject($go);
         echo "<tr><td><a style='float: right;' href=\"?map&obj={$go['entry']}\">{$lang['map']}</a>";
         echo "<a href=\"?object={$go['entry']}\">{$go['name']}</a></td></tr>";
         $number++;
     }
 }
 if ($number == 0) {
     echo "<tr><td bgColor=#ff0000>{$lang['quest_not_found']}</td></tr>";
 }
 ### этот квест часть серии:
 $needForQuest = $dDB->selectRow("SELECT * FROM `quest_template` WHERE ABS(`PrevQuestId`) = ?d", $quest['entry']);
 if ($quest['PrevQuestId'] != 0 or $quest['NextQuestId'] != 0 or $needForQuest) {
     echo "<tr><td class = head>{$lang['this_quest_is_part_of_a_series']}</td></tr>";
     $step = 0;
     // Разматываем цепочку квестов назад
     if ($quest['PrevQuestId'] != 0) {
Пример #2
0
function getGameobject($gameobject_id, $fields = "*")
{
    global $dDB;
    if ($go = $dDB->selectRow("-- CACHE: 1h\n  SELECT {$fields} FROM `gameobject_template` WHERE `entry` = ?d", $gameobject_id)) {
        localiseGameobject($go);
    }
    return $go;
}
function r_LockProvide($data)
{
    global $lang, $dDB;
    if ($items = $dDB->select('SELECT `entry`, `Quality`, `displayid`, `name` FROM `item_template` WHERE `lockid` = ?d', $data['id'])) {
        foreach ($items as $i) {
            show_item($i['entry'], $i['displayid'], 'sell');
        }
    }
    $data0 = array(GAMEOBJECT_TYPE_QUESTGIVER, GAMEOBJECT_TYPE_CHEST, GAMEOBJECT_TYPE_TRAP, GAMEOBJECT_TYPE_GOOBER, GAMEOBJECT_TYPE_CAMERA);
    $data1 = array(GAMEOBJECT_TYPE_DOOR, GAMEOBJECT_TYPE_BUTTON);
    if ($go_list = $dDB->select('SELECT `entry`,`name` FROM `gameobject_template` WHERE (`type` IN (?a) AND `data0` = ?d) OR (`type` IN (?a) AND `data1` = ?d)', $data0, $data['id'], $data1, $data['id'])) {
        foreach ($go_list as $go) {
            localiseGameobject($go);
            r_objName($go);
            echo '<br>';
        }
    }
    if (count($items) + count($go_list) == 0) {
        echo $lang['no_found'];
    }
}