예제 #1
0
파일: main.php 프로젝트: winddramon/dts
function act()
{
    if (eval(__MAGIC__)) {
        return $___RET_VALUE;
    }
    eval(import_module('sys', 'player', 'input'));
    if ($mode == 'command' && strpos($command, 'itm') === 0) {
        $item = substr($command, 3);
        itemuse_wrapper($item);
        return;
    }
    if ($mode == 'command' && $command == 'itemmain' && ($itemcmd == 'itemmerge' || $itemcmd == 'itemmove' || $itemcmd == 'itemdrop')) {
        ob_clean();
        if ($itemcmd == 'itemmerge') {
            include template(MOD_ITEMMAIN_ITEMMERGE);
        }
        if ($itemcmd == 'itemmove') {
            include template(MOD_ITEMMAIN_ITEMMOVE);
        }
        if ($itemcmd == 'itemdrop') {
            include template(MOD_ITEMMAIN_ITEMDROP);
        }
        $cmd = ob_get_contents();
        ob_clean();
    }
    if ($mode == 'itemmain') {
        if ($command == 'itemget') {
            itemget();
        } elseif ($command == 'itemadd') {
            itemadd();
        } elseif ($command == 'itemmerge') {
            if ($merge2 == 'n') {
                itemadd();
            } else {
                itemmerge($merge1, $merge2);
            }
        } elseif ($command == 'itemmove') {
            itemmove($from, $to);
        } elseif (strpos($command, 'drop') === 0) {
            $drop_item = substr($command, 4);
            itemdrop($drop_item);
        } elseif (strpos($command, 'off') === 0) {
            $off_item = substr($command, 3);
            itemoff($off_item);
        } elseif (strpos($command, 'swap') === 0) {
            $swap_item = substr($command, 4);
            itemdrop($swap_item);
            itemadd();
        }
    }
    $chprocess();
}
예제 #2
0
     }
 } else {
     if (strpos($command, 'drop') === 0) {
         include_once GAME_ROOT . './include/game/itemmain.func.php';
         $drop_item = substr($command, 4);
         itemdrop($drop_item);
     } 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) {