Beispiel #1
0
function itemuse_wrapper($itmn)
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'itemmain', 'logger'));
    if ($itmn < 1 || $itmn > 6) {
        $log .= '此道具不存在,请重新选择。';
        $mode = 'command';
        return;
    }
    $theitem = array();
    $theitem['itm'] =& ${'itm' . $itmn};
    $theitem['itmk'] =& ${'itmk' . $itmn};
    $theitem['itme'] =& ${'itme' . $itmn};
    $theitem['itms'] =& ${'itms' . $itmn};
    $theitem['itmsk'] =& ${'itmsk' . $itmn};
    $theitem['itmn'] = $itmn;
    if ($theitem['itms'] <= 0 && $theitem['itms'] != $nosta) {
        $theitem['itm'] = $theitem['itmk'] = $theitem['itmsk'] = '';
        $theitem['itme'] = $theitem['itms'] = 0;
        $log .= '此道具不存在,请重新选择。<br>';
        $mode = 'command';
        return;
    }
    itemuse($theitem);
    $mode = 'command';
}
Beispiel #2
0
 } else {
     if (strpos($command, 'off') === 0) {
         include_once GAME_ROOT . './include/game/itemmain.func.php';
         $off_item = substr($command, 3);
         itemoff($off_item);
     } else {
         if (strpos($command, 'swap') === 0) {
             include_once GAME_ROOT . './include/game/itemmain.func.php';
             $swap_item = substr($command, 4);
             itemdrop($swap_item);
             itemadd();
         } else {
             if (strpos($command, 'itm') === 0) {
                 include_once GAME_ROOT . './include/game/item.func.php';
                 $item = substr($command, 3);
                 itemuse($item);
                 $cmdnum++;
             } else {
                 if ($command == "shopquery") {
                     $result = $db->query("SELECT * FROM {$tablepre}shopitem WHERE item = '{$item}'");
                     if (!$db->num_rows($result)) {
                         echo "shopitemnum=0\n";
                     } else {
                         $iteminfo = $db->fetch_array($result);
                         if ($iteminfo['area'] > $areanum / $areaadd) {
                             echo "shopitemnum=0\n";
                         } else {
                             echo "shopitemnum={$iteminfo['num']}\n";
                         }
                     }
                 } else {