[PR]ÃÚËÞ”Ô‘g•\
¡–é‚̔ԑgÁª¯¸

ÉÔ¶ñ¹ç¤Î½¤Àµ - Ver b1.4

ÀßÃÖ»Ù±ç¥Ú¡¼¥¸¤Ø

[Ver b1.3]¡¡ [Ver b1.2.1]¡¡ [Ver b1.1]¡¡ [Ver b1.0]¡¡

  1. ÀïÆ®´ØÏ¢¤ÎÉÔ¶ñ¹ç½¤Àµ
  2. ²Ùʪ´ØÏ¢¤ÎÉÔ¶ñ¹ç½¤Àµ
  3. ºîÀ®´ØÏ¢¤ÎÉÔ¶ñ¹ç½¤Àµ
  4. ¥¢¥¤¥Æ¥à¥Ç¡¼¥¿¤ÎÀßÄê¤ÎÉÔ¶ñ¹ç½¤Àµ
  5. °Üư´ØÏ¢¤ÎÉÔ¶ñ¹ç½¤Àµ
  6. ¥Þ¥Ë¥å¥¢¥ë¤Î½¤Àµ
  7. ¤½¤Î¾¤ÎÉÔ¶ñ¹ç½¤Àµ
  8. ¤Á¤ç¤Ã¤È¤·¤¿¤³¤È


  1. ÀïÆ®´ØÏ¢¤ÎÉÔ¶ñ¹ç½¤Àµ
    1. ¥â¥ó¥¹¥¿¡¼Àï¤Ç¡¢ÀïÆ®¸å¥¹¥Æ¡¼¥¿¥¹¤Î¥²¡¼¥¸¤¬ÊѲ½¤·¤Ê¤¤
    2. ÀïÆ®»þ¤ËÁõÈ÷¤¬²õ¤ì¤Æ¤â¥¹¥Æ¡¼¥¿¥¹²èÌ̤«¤éÁõÈ÷Éʤ¬¾Ã¤¨¤Ê¤¤
    3. ¥â¥ó¥¹¥¿¡¼Àï¤ÇÀèÀ©¹¶·â¤¬¹Ô¤ï¤ì¤Ê¤¤
    4. ¥â¥ó¥¹¥¿¡¼Àï»þ¡¢ÁõÈ÷¤Î»ý¤ÁÂØ¤¨¤Î¾õÂÖ¡¦DEX¥Ü¡¼¥Ê¥¹¡¦Ç˲õȽÄ꤬¼¡¤ÎÀïÆ®¤Ë»ý¤Á±Û¤µ¤ì¤Æ¤·¤Þ¤¦

    ¥â¥ó¥¹¥¿¡¼Àï¤Ç¡¢ÀïÆ®¸å¥¹¥Æ¡¼¥¿¥¹¤Î¥²¡¼¥¸¤¬ÊѲ½¤·¤Ê¤¤ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/fight.cgi¤ò³«¤¯
    sub fight_creature:
        &reload_gage(['lf','hl','ap','hy'],'V');
    ¤òºï½ü
    
    library/find.cgi¤ò³«¤¯
    sub encounter:
        &set_user($I);
    
        &inner_HTML;
    ¢­
        &set_user($I);
    
        &reload_data('gl');
        &reload_gage(\@set::gva,'V');
    
        &inner_HTML;
    
    library/hunting.cgi¤ò³«¤¯
    sub hunting:
        &reload_gage(['vt'],'V');
    ¢­
        &reload_gage(\@set::gva,'V');
    

    ¤É¤¦¤·¤Æ¤³¤ì¤Çľ¤ë¤Î¤«¤¬¤è¤¯Ê¬¤«¤é¤Ê¤¤¡Ä

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ÀïÆ®»þ¤ËÁõÈ÷¤¬²õ¤ì¤Æ¤â¥¹¥Æ¡¼¥¿¥¹²èÌ̤«¤éÁõÈ÷Éʤ¬¾Ã¤¨¤Ê¤¤ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/fight.cgi¤ò³«¤¯
    sub baggage_check:
            else {
                &reload_data('of') if $Ii->{eq} eq 'rh';
                &reload_data('df') if $Ii->{cl} eq 'Ar';
    ¢­
            else {
                &reload_data($Ii->{eq});
                &reload_data('of') if $Ii->{eq} eq 'rh';
                &reload_data('df') if $Ii->{cl} eq 'Ar';
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥â¥ó¥¹¥¿¡¼Àï¤ÇÀèÀ©¹¶·â¤¬¹Ô¤ï¤ì¤Ê¤¤¤¿¤á¤ËÅêÚ³Éð´ï¤ò»È¤¤Â³¤±¤é¤ì¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£¤Ä¤¤¤Ç¤ËÀèÀ©¡¦È¿·â¤¬È¯À¸¤¹¤ë¤è¤¦¤Ë¤·¤Þ¤¹¡£

    library/fight.cgi¤ò³«¤¯
    sub fight_creature:
    my  $i;
    ¢­
    my ($i, $counter);
    
    sub fight_creature:
        &first_battle;
    ¢­
    #    $S->{Sk}{Sa} = 0;	# °ÇƤ¤Á̵¸ú
    #    $S->{Sk}{Ct} = 0;	# È¿·â(ºÇ¸å¤Î¹¶·â)̵¸ú
        $counter = &first_battle($I,$U);
    

    °ÇƤ¤Á¤ÈÈ¿·â¤Ï¥Ú¥Ê¥ë¥Æ¥£¤¬¤Ê¤¯ÀäÂÐȯÀ¸¤Ê¤Î¤Ç¶¯¤¹¤®¤ë¤«¤â¤·¤ì¤Ê¤¤¤«¤é´Êñ¤Ë̵¸ú¤Ë½ÐÍè¤ë¤è¤¦¤Ë¡£°ì±þÍͻҸ«¡£

    sub fight_creature:
        while ($I->{lf} && $U->{lf}) {
            &M("$U->{nm}¤ÏƨÁö¤·¤¿¡ª</span><br>") && last if $i++ >= $V;
            &initiative(0);
            &concrete_battle($A,$D,'¤Î¹¶·â¡£');
            &concrete_battle($D,$A,'¤Î¹¶·â¡£');
            &M();
        }
    ¢­
        while ($I->{lf} && $U->{lf}) {
            &M("$U->{nm}¤ÏƨÁö¤·¤¿¡ª<br>") && last if $i++ >= $V;
            &initiative(0);
            &concrete_battle($A,$D,'¤Î¹¶·â¡£');
            &concrete_battle($D,$A,'¤Î¹¶·â¡£');
            &M();
        }
        if ($counter == 1 && $U->{lf}) {
            &initiative($counter);
            &M("$A->{nm}¤Ïƨ¤²¤ë$D->{nm}¤ËºÇ¸å¤Î¹¶·â¤ò·«¤ê½Ð¤·¤¿¡£");
            &concrete_battle($A,$D,'¤Î¥«¥¦¥ó¥¿¡¼¡ª');
            &M();
        }
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥â¥ó¥¹¥¿¡¼Àï»þ¡¢ÁõÈ÷¤Î»ý¤ÁÂØ¤¨¤Î¾õÂÖ¡¦DEX¥Ü¡¼¥Ê¥¹¡¦Ç˲õȽÄ꤬¼¡¤ÎÀïÆ®¤Ë»ý¤Á±Û¤µ¤ì¤Æ¤·¤Þ¤¦ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/fight.cgi¤ò³«¤¯
    sub fight_creature:
    local $battleisover;
    ¢­
    local $battleisover;
    delete @{$I}{qw/WO DX WN TD BI ST/};
    delete @{$U}{qw/WO DX WN TD BI ST/};
    

    TD ¤È WN ¤È ST ¤Ï¥â¥ó¥¹¥¿¡¼Àï¤Ç¤Ï»È¤ï¤ì¤Ê¤¤¤±¤É°ì±þ
    ¢¨ undef ¤Ï°ú¿ô¤Ò¤È¤Ä¤·¤«ÅϤ»¤Ê¤¤¤Î˺¤ì¤Æ¤¿¡Ädelete¤Ë¥¹¥é¥¤¥¹¤Ê¤éɬÍפʤÀ¤±¾Ã¤·¤Æ¤¯¤ì¤ë

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¡Ú¥È¥Ã¥×¤ØÌá¤ë¡Û



  2. ²Ùʪ´ØÏ¢¤ÎÉÔ¶ñ¹ç½¤Àµ
    1. ½ÅÎ̤¬¤ª¤«¤·¤Ê¤³¤È¤Ë¤Ê¤ë
    2. Ʊ¤¸¼ïÎà¤Î¤â¤Î¤ò°ìÅÙ¤ËÊ£¿ô´³Êª¤Ë¤·¤¿¤È¤­¤Ë¥Ñ¥Ã¥¯¿ô¤¬¤¹¤Ù¤ÆÆ±¤¸¤Ë¤Ê¤ë

    ½ÅÎ̤¬¤ª¤«¤·¤Ê¤³¤È¤Ë¤Ê¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/base.cgi¤ò³«¤¯
    sub set_user:
        $V = index($S->{id},'_') ? $set::Udt_dir
                                 : $set::npc_dir;
    ¢­
        $V = index($S->{id},'_') ? $set::Udt_dir
                                 : $set::npc_dir;
    
    #    $S->{bs} =~ s/(\.\d\d)\d*/$1/;                                 # ¾®¿ôÅÀ2·å°Ê²¼¤ÏÀÚ¤ê¼Î¤Æ¤ë
        $S->{bs} = sprintf "%.2f", $S->{bs} if $S->{bs} =~ /\.\d\d\d/; # ¤¢¤ë¤¤¤Ï3·å°Ê¾å¤¢¤ì¤ÐÀ°·Á¤¹¤ë
    

    ÉâÆ°¾®¿ôÅÀ¿ô¤ÎÌäÂê¤ËÂбþ¡£¾å²¼¤Ç¤É¤¦°ã¤¦¤«¤È¤¤¤¦¤ÈÀڼΤƤ«»Í¼Î¸ÞÆþ¤«¤ß¤¿¤¤¤Ê´¶¤¸

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    Ʊ¤¸¼ïÎà¤Î¤â¤Î¤ò°ìÅÙ¤ËÊ£¿ô´³Êª¤Ë¤·¤¿¤È¤­¤Ë¥Ñ¥Ã¥¯¿ô¤¬¤¹¤Ù¤ÆÆ±¤¸¤Ë¤Ê¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/dry.cgi¤ò³«¤¯
    sub dried_food:
        $Si = $FI{$Si->{nm}};
    ¢­
        $Si = {%{ $FI{$Si->{nm}} }};
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¡Ú¥È¥Ã¥×¤ØÌá¤ë¡Û



  3. ºîÀ®´ØÏ¢¤ÎÉÔ¶ñ¹ç½¤Àµ
    1. ¥¨¥¯¥»¥ì¥ó¥ÈÉʤ¬ºîÀ®¤µ¤ì¤Ê¤¤

    ¥¨¥¯¥»¥ì¥ó¥ÈÉʤ¬ºîÀ®¤µ¤ì¤Ê¤¤ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/compose.cgi¤ò³«¤¯
            &excellent_roll($I,$Ui->{dt}) if $Ui->{db};
    ¢­
            &excellent_roll($I,$Ui->{dt}) if $Ui->{dt}{db};
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¡Ú¥È¥Ã¥×¤ØÌá¤ë¡Û



  4. ¥¢¥¤¥Æ¥à¥Ç¡¼¥¿¤ÎÀßÄê¤ÎÉÔ¶ñ¹ç½¤Àµ
    1. ÀßÄê¥ß¥¹¤È»×¤ï¤ì¤ë²Õ½ê¤ò½¤Àµ

    ÀßÄê¥ß¥¹¤È»×¤ï¤ì¤ë²Õ½ê¤ò½¤Àµ¤·¤Þ¤¹¡£

    item/product.cgi¤ò³«¤¯
        'µí' => [
                { nm => 'µíÆý',
                  cl => 'Fd',
                  id => 'Milk',
                  ql => 'Ml',
    ¢­
        'µí' => [
                { nm => 'µíÆý',
                  cl => 'Fd',
                  id => 'Milk',
                  ql => 'Ml,Dr',
    

    µíÆý¤ò¿©¤Ù¤ë¡£SOSIIIWiki¤Ë¤âºÜ¤Ã¤Æ¤ë¤±¤É½¤Àµ¤µ¤ì¤Æ¤Ê¤¤¤ß¤¿¤¤¡©

    item/clothes.cgi¤ò³«¤¯
              dt => { nm => '¥·¥§¥¤¥ó¥º',
                      cl => 'Ds',
                      id => 'Gaberdine',
                      ql => 'Bd',
                      im => 'gaberdine.gif',
    ¢­
              dt => { nm => '¥·¥§¥¤¥ó¥º',
                      cl => 'Ds',
                      id => 'Chainse',
                      ql => 'Bd',
                      im => 'chainse.gif',
    

    ID¤¬Æ±¤¸¤â¤Î¤Ï¿ʬ¤Ê¤¤¤À¤í¤¦¤È¤¤¤¦¤³¤È¤ÇID¤â½¤Àµ

    item/monster_cov.cgi¤ò³«¤¯
                  'i1' => { nm => 'Áư­¤Ê·õ',
                            cl => 'Sw',
                            id => 'Badsword',
                            ql => 'Tr',
    ¢­
                  'i1' => { nm => 'Áư­¤Ê·õ',
                            cl => 'Sw',
                            id => 'Badsword',
                            ql => 'Rh,Sb,Tr',
    

    Áư­¤Ê·õ¤òÁõÈ÷¤Ç¤­¤Ê¤¤¡£°äÀ׹Ӥ餷¤Î¤â¤Î¤ÈƱ¤¸¥¹¥Æ¡¼¥¿¥¹¤Ë

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¡Ú¥È¥Ã¥×¤ØÌá¤ë¡Û



  5. °Üư´ØÏ¢¤ÎÉÔ¶ñ¹ç½¤Àµ½¤Àµ
    1. ¶ä¹Ô¤Ç¡¢¶ä¹Ô¥¹¥í¥Ã¥È¤è¤ê¿¤¤¥¢¥¤¥Æ¥à¤òͤ±¤è¤¦¤È¤·¤¿¤È¤­¤Î¥á¥Ã¥»¡¼¥¸¤ÎÉÔ¶ñ¹ç
    2. ¶ä¹Ô¤Ç¡¢²Ùʪ¥¹¥í¥Ã¥È¤è¤ê¿¤¤¥¢¥¤¥Æ¥à¤ò°ú¤­½Ð¤¹¤³¤È¤¬½ÐÍè¤ë
    3. ¶ä¹Ô¤Ç¡¢ÃÍÃÊÀßÄꤷ¤Æ¤¢¤ë¥¢¥¤¥Æ¥à¤ò°ú¤­½Ð¤¹¤ÈÈÎÇ䥹¥í¥Ã¥È¤è¤ê¿¤¯¥¢¥¤¥Æ¥à¤òÈÎÇä¤Ç¤­¤ë
    4. ÇÀ¾ì¤Ç¡¢APP¤Ë¤è¤Ã¤ÆÈÎÇä²Á³Ê¤¬ÊÑÆ°¤·¤Ê¤¤
    5. ¸ø¶¦Íá¾ì/¸ø½°Íá¾ì¤òÅý°ì
    6. ¾ë¤Ç¡¢¥¯¥é¥¹¥Á¥§¥ó¥¸¤ÎºÝ¤ª¶â¤¬¾ÃÈñ¤µ¤ì¤Ê¤¤
    7. Àî¤Ç¡¢¿åÉÓ¤¬²õ¤ì¤Ê¤¤
    8. ¿¹¤Ç¡¢ÀïÆ®Ãæ¤ËµÝ¤¬²õ¤ì¤Æ¤â¼í¤ê¤ò³¤±¤ë¤³¤È¤¬½ÐÍè¤ë
    9. °Ç»Ô¤Ç¡¢¾¦Éʤ¬¤Ê¤¤¾ì¹ç¤Î¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤Ê¤¤

    ¶ä¹Ô¤Ç¡¢¶ä¹Ô¥¹¥í¥Ã¥È¤è¤ê¿¤¤¥¢¥¤¥Æ¥à¤òͤ±¤è¤¦¤È¤·¤¿¤È¤­¤Î¥á¥Ã¥»¡¼¥¸¤ÎÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/bank.cgi¤ò³«¤¯
    sub bank_after:
        $I = &get_user('I');
        $U->{id} = $I->{id};
    ¢­
        $I = &get_user('I');
        $U->{id} = $I->{id};
    
        &get_place($I);
    
        &spot_check($I,'Bk');
    

    &spot_check¤Ï&set_code¤¬¤¢¤ë¤«¤é¤¢¤ê¤¨¤Ê¤¤¤À¤í¤¦¤±¤É°ì±þ¤Ä¤±¤Æ¤ß¤ë

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¶ä¹Ô¤Ç¡¢²Ùʪ¥¹¥í¥Ã¥È¤è¤ê¿¤¤¥¢¥¤¥Æ¥à¤ò°ú¤­½Ð¤¹¤³¤È¤¬½ÐÍè¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/bank.cgi¤ò³«¤¯
    sub bank_after:
        &say("$I->{Sp}{Bk}{nm}¥¹¥í¥Ã¥È¤¬¤¤¤Ã¤Ñ¤¤¤Ç¤¹¡£",'bank_before') if $U->{Sl} > $I->{bk};
    ¢­
        &say("$I->{Sp}{Bk}{nm}¥¹¥í¥Ã¥È¤¬¤¤¤Ã¤Ñ¤¤¤Ç¤¹¡£",'bank_before') if $U->{Sl} > $I->{bk};
        &say("²Ùʪ¥¹¥í¥Ã¥È¤¬¤¤¤Ã¤Ñ¤¤¤Ç¤¹¡£",'bank_before') if grep($_,@{$I->{Bg}}) > $I->{bs};
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¶ä¹Ô¤Ç¡¢ÃÍÃÊÀßÄꤷ¤Æ¤¢¤ë¥¢¥¤¥Æ¥à¤ò°ú¤­½Ð¤¹¤ÈÈÎÇ䥹¥í¥Ã¥È¤è¤ê¿¤¯¥¢¥¤¥Æ¥à¤òÈÎÇä¤Ç¤­¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/bank.cgi¤ò³«¤¯
    sub bank_after:
        foreach $Ii (@{$I->{Bg}}) {
            $i++;
            next if !$Ii;
            next if !$F{"i$i"};
            &say("$Ii->{nm}¤Ï°Üư¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£",'bank_before') if $Ii->{Ql}{Lk};
            &say("$Ii->{nm}¤ÏÁõÈ÷Ãæ¤Ç¤¹¡£",'bank_before') if $Ii->{eq};
            $U->{Sl}++;
            $I->{bg} -= $Ii->{qn} * $Ii->{wt};
    ¢­
        foreach $Ii (@{$I->{Bg}}) {
            $i++;
            next if !$Ii;
            next if !$F{"i$i"};
            &say("$Ii->{nm}¤Ï°Üư¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó¡£",'bank_before') if $Ii->{Ql}{Lk};
            &say("$Ii->{nm}¤ÏÁõÈ÷Ãæ¤Ç¤¹¡£",'bank_before') if $Ii->{eq};
            $U->{Sl}++;
            $I->{bg} -= $Ii->{qn} * $Ii->{wt};
            $Ii->{sp} = '';
    

    ͤ±¤ë¤È¤­¤ËÃÍÃʥꥻ¥Ã¥È

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ÇÀ¾ì¤Ç¡¢APP¤Ë¤è¤Ã¤ÆÈÎÇä²Á³Ê¤¬ÊÑÆ°¤·¤Ê¤¤ÉÔ¶ñ¹ç?¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/farm.cgi¤ò³«¤¯
    # Sub Farm Before #
    ¢­
    require "$set::lib_dir/status.cgi";
    
    # Sub Farm Before #
    
    sub farm_before:
        &dead_check($I,'CLOSE');
    ¢­
        &dead_check($I,'CLOSE');
    
        &get_appearance($I);
    
    sub farm_after:
        $I = &get_user('I');
    ¢­
        $I = &get_user('I');
    
        &get_appearance($I);
    
    sub farm_after:
            $Ui->{Sp} = int($Ui->{bp} * $set::mtp + $set::mpp) * $Ui->{qn};
    ¢­
            $Ui->{Sp} = int(($Ui->{bp} * $set::mtp + $set::mpp) * $Ui->{qn} * $I->{Ap});
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¸ø¶¦Íá¾ì/¸ø½°Íá¾ì¤òÅý°ì¤·¤Þ¤¹¡£

    data/place.cgi¤ò³«¤¯
        'Pb' => { 'md' => 'bath_before',
                  'nm' => '¸ø¶¦Íá¾ì'},
    ¢­
        'Pb' => { 'md' => 'bath_before',
                  'nm' => '¸ø½°Íá¾ì'},
    
    ¸ø¶¦¤À¤ÈÊ¡»ã»ÜÀߤǡ¢¸ø½°¤À¤È¤ß¤ó¤Ê¤Î¤Ã¤Æ´¶¤¸¤«¤Ê¡©

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¾ë¤Ç¡¢¥¯¥é¥¹¥Á¥§¥ó¥¸¤ÎºÝ¤ª¶â¤¬¾ÃÈñ¤µ¤ì¤Ê¤¤ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/castle.cgi¤ò³«¤¯
    sub castle_after:
            if ($L->{cn}) {
                $V = $set::clf * $L->{cn};
    ¢­
            if ($L->{cn}) {
            my  $V = $set::clf * $L->{cn};
    

    $V¤ò¶É½ê²½

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    Àî¤Ç¡¢¿åÉÓ¤¬²õ¤ì¤Ê¤¤ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/water.cgi¤ò³«¤¯
    sub water:
        &M("$Ii->{nm}¤¬¤¤¤Ã¤Ñ¤¤¤Ë¤Ê¤ê¤Þ¤·¤¿¡£");
    ¢­
        if (&roll_dice(100) <= $set::wbp) {
            &M("$Ii->{nm}¤¬²õ¤ì¤Þ¤·¤¿¡£");
            &change_status($I,'bg',-$Ii->{wt});
            $Ii->{qn} = 0;
        }
        else {
            &M("$Ii->{nm}¤¬¤¤¤Ã¤Ñ¤¤¤Ë¤Ê¤ê¤Þ¤·¤¿¡£");
        }
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¿¹¤Ç¡¢ÀïÆ®Ãæ¤ËµÝ¤¬²õ¤ì¤Æ¤â¼í¤ê¤ò³¤±¤ë¤³¤È¤¬½ÐÍè¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/find.cgi¤ò³«¤¯
    sub found:
                &M("¤³¤ì°Ê¾å¤Ï»ý¤Æ¤Þ¤»¤ó¡£") && last if $S->{bg} == $S->{Mbg};
            }
    ¢­
                &M("¤³¤ì°Ê¾å¤Ï»ý¤Æ¤Þ¤»¤ó¡£") && last if $S->{bg} == $S->{Mbg};
            }
    
            &M("µÝ¤¬²õ¤ì¤¿¤Î¤Ç$V2¤òÃæÃǤ·¤Þ¤·¤¿¡£") && last if $V5 eq 'hunting' && !$S->{rh} && $i != $F{do};
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    °Ç»Ô¤Ç¡¢¾¦Éʤ¬¤Ê¤¤¾ì¹ç¤Î¥á¥Ã¥»¡¼¥¸¤¬É½¼¨¤µ¤ì¤Ê¤¤ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/blackmarket.cgi¤ò³«¤¯
    sub blackmarket_before:
        &say("¤á¤Ü¤·¤¤¾¦ÉʤϤʤ¤¤è¤¦¤Ç¤¹¡¦¡¦¡¦",'market') if !$U->{Bg};
    ¢­
        &say("¤á¤Ü¤·¤¤¾¦ÉʤϤʤ¤¤è¤¦¤Ç¤¹¡¦¡¦¡¦",'market') if !@{$U->{Bg}};
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¡Ú¥È¥Ã¥×¤ØÌá¤ë¡Û



  6. ¥Þ¥Ë¥å¥¢¥ë¤Î½¤Àµ
    1. ½é¿´¼Ô¥¬¥¤¥É¤Î½¤Àµ
    2. ºàÎÁ¤Î½¤Àµ

    ½é¿´¼Ô¥¬¥¤¥É¤Î½¤Àµ

    manual/biginner.html¤ò³«¤¯
    Ï£¶â½Ñ»Õ
    °å¼Ô
    ¤ò
    Ìô»Õ
    ¤ËÁ´¤ÆÃÖ¤­´¹¤¨
    
    <li>ÃÃÌê²°¤«¤éÅ´ÈĤòÇã¤Ã¤Æ¡¢³×¤Î³õ¤òºî¤ë¡£</li>
    ¤òºï½ü
    
    <li>Æ©ÌÀ¤ÊÌô±Õ¤ò»È¤Ã¤Æ¤Ê¤á¤·³×¤òºî¤ë»ö¤¬¤Ç¤­¤ë¡£</li>
    ¢­
    <li>¥¿¥ó¥Ë¥ó±Õ¤ò»È¤Ã¤Æ¤Ê¤á¤·³×¤òºî¤ë»ö¤¬¤Ç¤­¤ë¡£</li>
    
    <li>Å´¤Îº¿¤ÏºÛË¥»Õ¤¬¥Ê¥Ã¥×¥µ¥Ã¥¯ºî¤ê¤ËɬÍפȤ·¤Æ¤¤¤ë¡£</li>
    ¢­
    <li>º¿¤ÏºÛË¥»Õ¤¬¥Ê¥Ã¥×¥µ¥Ã¥¯ºî¤ê¤ËɬÍפȤ·¤Æ¤¤¤ë¡£</li>
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ºàÎÁ¤Î½¤Àµ

    manual/armor.html¤ò³«¤¯
      <tr> 
        <td nowrap>¥ß¥ê¥Æ¥£¥¢¥Ø¥ë¥á¥Ã¥È</td>
        <td><img src="../itemimage/militiahelmet.gif" width=16 height=16></td>
        <td nowrap>Hm</td>
        <td nowrap>Militia Helmet</td>
        <td>ÃÃ</td>
        <td width=100 nowrap>Å´ÈÄ</td>
        <td width=100>&nbsp;</td>
        <td width=100%>Ã×Ì¿½ý²óÈò+6%</td>
      </tr>
      <tr> 
        <td nowrap>¥ß¥ê¥Æ¥£¥¢¥¢¡¼¥Þ¡¼</td>
        <td><img src="../itemimage/militiaarmor.gif" width=16 height=16></td>
        <td nowrap>Ar</td>
        <td nowrap>Militia Armor</td>
        <td>ÃÃ</td>
        <td nowrap>Å´ÈÄx2</td>
        <td nowrap>&nbsp;</td>
        <td>Ëɸæ+3</td>
      </tr>
      <tr> 
        <td nowrap>¥ß¥ê¥Æ¥£¥¢¥Ö¡¼¥Ä</td>
        <td><img src="../itemimage/militiaboots.gif" width=16 height=16></td>
        <td nowrap>Bt</td>
        <td nowrap>Militia Boots</td>
        <td>ÃÃ</td>
        <td nowrap>Å´ÈÄ</td>
        <td nowrap>³×¤Ò¤â</td>
        <td>ƨÁö³ÎΨ+6%</td>
      </tr>
    ¢­
      <tr> 
        <td nowrap>¥ß¥ê¥Æ¥£¥¢¥Ø¥ë¥á¥Ã¥È</td>
        <td><img src="../itemimage/militiahelmet.gif" width=16 height=16></td>
        <td nowrap>Hm</td>
        <td nowrap>Militia Helmet</td>
        <td>ÃÃ</td>
        <td width=100 nowrap>Å´ÈÄ</td>
        <td width=100>ÀÐú+²Ð</td>
        <td width=100%>Ã×Ì¿½ý²óÈò+6%</td>
      </tr>
      <tr> 
        <td nowrap>¥ß¥ê¥Æ¥£¥¢¥¢¡¼¥Þ¡¼</td>
        <td><img src="../itemimage/militiaarmor.gif" width=16 height=16></td>
        <td nowrap>Ar</td>
        <td nowrap>Militia Armor</td>
        <td>ÃÃ</td>
        <td nowrap>Å´ÈÄx2</td>
        <td nowrap>ÀÐú+²Ð</td>
        <td>Ëɸæ+3</td>
      </tr>
      <tr> 
        <td nowrap>¥ß¥ê¥Æ¥£¥¢¥Ö¡¼¥Ä</td>
        <td><img src="../itemimage/militiaboots.gif" width=16 height=16></td>
        <td nowrap>Bt</td>
        <td nowrap>Militia Boots</td>
        <td>ÃÃ</td>
        <td nowrap>Å´ÈÄ</td>
        <td nowrap>³×¤Ò¤â+ÀÐú+²Ð</td>
        <td>ƨÁö³ÎΨ+6%</td>
      </tr>
    

    ¥ß¥ê¥Æ¥£¥¢¥»¥Ã¥È¤ÎºàÎÁ(Éû)¤ËÀÐú+²Ð¤òÄɲÃ

    manual/item01.html¤ò³«¤¯
      <tr> 
        <td nowrap>ÊñÃú</td>
        <td><img src="../itemimage/kitchenknife.gif" width=16 height=16></td>
        <td nowrap>Ck</td>
        <td nowrap>Kitchen Knife</td>
        <td nowrap>û·õ¤Î¿Ï</td>
        <td>ÎÁÍýÆ»¶ñ¡£</td>
      </tr>
    ¢­
      <tr> 
        <td nowrap>ÊñÃú</td>
        <td><img src="../itemimage/kitchenknife.gif" width=16 height=16></td>
        <td nowrap>Ck</td>
        <td nowrap>Kitchen Knife</td>
        <td nowrap>û·õ¤Î¿Ï+Å´¤ÎÊÁ</td>
        <td>ÎÁÍýÆ»¶ñ¡£</td>
      </tr>
    
      <tr> 
        <td nowrap>³°²ÊÍѥ᥹</td>
        <td><img src="../itemimage/scalpel.gif" width=16 height=16></td>
        <td nowrap>Sl</td>
        <td nowrap>Surgical Scalpel</td>
        <td nowrap>¾®·õ¤Î¿Ï</td>
        <td>ÃÃÌê²°¤¬ºîÀ®¤·¤¿¥á¥¹¡£¼£ÎÅÆ»¶ñ¡£</td>
      </tr>
    ¢­
      <tr> 
        <td nowrap>³°²ÊÍѥ᥹</td>
        <td><img src="../itemimage/scalpel.gif" width=16 height=16></td>
        <td nowrap>Sl</td>
        <td nowrap>Surgical Scalpel</td>
        <td nowrap>û·õ¤Î¿Ï</td>
        <td>ÃÃÌê²°¤¬ºîÀ®¤·¤¿¥á¥¹¡£¼£ÎÅÆ»¶ñ¡£</td>
      </tr>
    
      <tr> 
        <td nowrap>î</td>
        <td><img src="../itemimage/barrel.gif" width=16 height=16></td>
        <td nowrap>Ba</td>
        <td nowrap>Barrel</td>
        <td nowrap>&nbsp;</td>
        <td>¤¼ò¤ËɬÍס£ÌÚ¤ÎÈÄx3+Å´ÈÄ</td>
      </tr>
    ¢­
      <tr> 
        <td nowrap>î</td>
        <td><img src="../itemimage/barrel.gif" width=16 height=16></td>
        <td nowrap>Ba</td>
        <td nowrap>Barrel</td>
        <td nowrap>ÌÚ¤ÎÈÄx3+Å´ÈÄ</td>
        <td>¤¼ò¤ËɬÍס£</td>
      </tr>
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¡Ú¥È¥Ã¥×¤ØÌá¤ë¡Û



  7. ¤½¤Î¾¤Î½¤Àµ
    1. ¼£ÎŸ塢¥­¥ã¥é¥¯¥¿¡¼¤Î¥Ç¡¼¥¿¤¬Êݸ¤µ¤ì¤Ê¤¤
    2. ¥Ú¥Ã¥È¤¬¼÷Ì¿¤ò·Þ¤¨¤¿ºÝ¡¢¿®ÍêÅ٤ȶõÊ¢ÅÙ¤¬¡Ö¤¢¤ÎÀ¤¤Ç¤¦¤é¤ó¤Ç¤¤¤ë¡×¡Ö²î»à¡×¤Ë¤Ê¤ë
    3. ¥Õ¥¡¥¤¥ë¥í¥Ã¥¯
    4. ¥ì¥Ù¥ë¥¢¥Ã¥×ľ¸å¤Î·Ð¸³Ãͤ¬Àµ¤·¤¯É½¼¨¤µ¤ì¤Ê¤¤
    5. ¾õÂÖ°Û¾ï¤Ë¤è¤±¤¤¤Ê¡Ö¡¦¡×¤¬É½¼¨¤µ¤ì¤ë
    6. ¥Ú¥Ã¥È¤Ç¡¢Æ±¤¸¼ïÎà¤Î¥Ú¥Ã¥È¤òƱ»þ¤ËÊ£¿ôÅË»¦¤¹¤ë¤È·×»»¤É¤ª¤ê¤Î¼ý³Ï¤¬ÆÀ¤é¤ì¤Ê¤¤
    7. ¥í¥°¥¤¥ó»þ¤ÎÅϹҥÁ¥§¥Ã¥¯¤ÎºÝ¡Ö¡û¡û¤Ï¸½ºß¥í¥°¥¤¥óÃæ¤Ç¤¹¡×¤È¤Ê¤ë
    8. ÅË»¦¡¢È²ºÎ¡¢ºÎ·¡¤ÇÁõÈ÷¤¬²õ¤ì¤Ê¤¤
    9. ÈÎÇäÃæ¤Î¥Ú¥Ã¥È¤¬»þ´Ö·Ð²á¤Ç»à¤ó¤Ç¤¤¤Æ¤â»à¤ó¤Ç¤¤¤ë¤³¤È¤¬É½¼¨¤µ¤ì¤Ê¤¤

    ¼£ÎŸ塢¥­¥ã¥é¥¯¥¿¡¼¤Î¥Ç¡¼¥¿¤¬Êݸ¤µ¤ì¤Ê¤¤ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/cure.cgi¤ò³«¤¯
    sub cure_after:
    #    &set_item($U);
    
    #    &set_user($I);
    #    &set_user($U);
    ¢­
        &set_item($U);
    
        &set_user($I);
        &set_user($U);
    

    ¥³¥á¥ó¥È¥¢¥¦¥È¤ò³°¤¹¤À¤±

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥Ú¥Ã¥È¤¬¼÷Ì¿¤ò·Þ¤¨¤¿ºÝ¡¢¿®ÍêÅ٤ȶõÊ¢ÅÙ¤¬¡Ö¤¢¤ÎÀ¤¤Ç¤¦¤é¤ó¤Ç¤¤¤ë¡×¡Ö²î»à¡×¤Ë¤Ê¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/pet.cgi¤ò³«¤¯
    sub pet:
            if ($Ip->{hg}) {
                if ($age > $Ip->{ls}) {
                    $age .= 'ºÐ¤ÇÅ·¼÷¤òÁ´¤¦¤·¤¿';
                    $Ip->{hg} = 0;
                    $Ip->{ls} = -1;
                    $saveflag = 1;
                }
    ¢­
            if ($Ip->{hg}) {
                if ($age > $Ip->{ls}) {
                    $age .= 'ºÐ¤ÇÅ·¼÷¤òÁ´¤¦¤·¤¿';
                    $Ip->{hg} = 0;
                    $Ip->{ls} = -1;
                    $saveflag = 1;
                    $confidence = $stomach = $Ip->{ls};
                }
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥Õ¥¡¥¤¥ë¥í¥Ã¥¯¤ò¼ÂÁõ¡©¤·¤Þ¤¹¡£

    sos3.cgi¤ò³«¤¯
    sub action:
        &{$md};
    ¢­
        &{$md};
        &unlock('unlock');
    
    master.cgi¤ò³«¤¯
    exit;
    ¢­
    &unlock('unlock');
    exit;
    
    library/base.cgi¤ò³«¤¯
    sub get_user:
        ($L) = &open_dat("$dir/$id.cgi");
    ¢­
        &lock($id) if $W ne 'A' && $W ne 'B';
    
        ($L) = &open_dat("$dir/$id.cgi");
    
    sub set_user:
        &write_dat("$V/$S->{id}.cgi",join('<>',@L));
    ¢­
        &write_dat("$V/$S->{id}.cgi",join('<>',@L));
    
        &unlock($S->{id});
    
    sub lock:
    sub lock {
    my  $V = shift;
    my  $T = $set::lky < 0 ? 1 : 0;	# true -> check only
    my  $flag = 10;
    
        return if !$set::lky;
        &error('Reload Lock Error') if !$V;
        $lock::table{$V} = 1 if !$T;
        $V = "$set::loc_dir/$V";
    
        if (abs $set::lky == 1) {
            rmdir($V) if (time - (stat($V))[9] > 60);
            while ( $T ? -e $V : !mkdir($V,0755) ) {
                --$flag or &error('¸½ºß¡¢¥Õ¥¡¥¤¥ë¹¹¿·Ãæ¤Ç¤¹¡£','lock');
                sleep(1);
            }
        }
        elsif (abs $set::lky == 2) {
            eval { symlink("",""); };
            if ($@) { &error('Symlink Lock Error') }
            unlink($V) if (time - (stat($V))[9] > 60);
            while ( $T ? -e $V : !symlink(".",$V) ) {
                --$flag or &error('¸½ºß¡¢¥Õ¥¡¥¤¥ë¹¹¿·Ãæ¤Ç¤¹¡£','lock');
                sleep(1);
            }
        }
    }
    
    ¤ËÃÖ¤­´¹¤¨
    
    sub unlock:
    sub unlock {
    my  $V = shift;
    my  @L;
    
        return if !$V;
    
        @L = $V eq 'unlock' ? keys %lock::table : ($V);
    
        foreach (@L) {
            $V = "$set::loc_dir/$_";
            if    ($set::lky == 1) { rmdir($V)  }
            elsif ($set::lky == 2) { unlink($V) }
            delete $lock::table{$_};
        }
    }
    
    ¤ËÃÖ¤­´¹¤¨
    
    sub error:
        $V ||= $I->{lock};
    ¢­
        $V ||= 'unlock';
    
    sub say:
        &unlock($I->{lock});
    ¢­
        &unlock('unlock');
    
    library/bounty.cgi¤ò³«¤¯
    sub bounty_after:
        &lock($F{ud});
    ¤È
        &unlock($F{ud});
    ¤òºï½ü
    
    library/buy.cgi¤ò³«¤¯
    sub bounty_after:
        &lock($F{ud});
    ¤È
        &unlock($F{ud});
    ¤òºï½ü
    
    library/cure.cgi¤ò³«¤¯
    sub bounty_after:
        &lock($F{ud});
    ¤È
        &unlock($F{ud});
    ¤òºï½ü
    
    library/destone.cgi¤ò³«¤¯
    sub bounty_after:
        &lock($F{ud});
    ¤È
        &unlock($F{ud});
    ¤òºï½ü
    
    library/fight.cgi¤ò³«¤¯
    sub fight_player:
        &lock($F{ud});
    ¤òºï½ü
    
    sub fight_player:
        &set_user($I);
        &set_user($U);
        &set_pet($I) if $I->{Co};
        &set_pet($U) if $U->{Co};
    
        &unlock($F{ud});
    ¢­
        &set_pet($I) if $I->{Co};
        &set_pet($U) if $U->{Co};
        &set_user($I);
        &set_user($U);
    
    library/mail.cgi¤ò³«¤¯
    sub mail_after:
        &lock($U->{id});
    ¤È
        &unlock($U->{id});
    ¤òºï½ü
    
    library/main.cgi¤ò³«¤¯
    sub main:
        &lock($F{id});
    ¤È
        &unlock($F{id});
    ¤òºï½ü
    
    sub departure_monitor:
            &lock($D->[0]);
    ¤È
                &lock($_);
    ¤È
                &unlock($_);
    ¤È
            &unlock($D->[0]);
    ¤òºï½ü
    
    library/message.cgi¤ò³«¤¯
    sub message_after:
        $U = &get_user('U');
    ¢­
        $U = &get_user('U');
        &unlock($U->{id});
    
    library/new.cgi¤ò³«¤¯
    sub new_after:
        &regist_check;
    ¢­
        &lock($F{id});
    
        &regist_check;
    
    library/partner.cgi¤ò³«¤¯
    sub partner:
        &unlock($I->{lock});
    ¢­
        &unlock('unlock');
    
    library/playerlist.cgi¤ò³«¤¯
    sub playerlist:
        &get_resident($I);
    ¢­
        &get_resident($I);
    
        $set::lky *= -1;	# check only ¥â¡¼¥É
    
    library/trade.cgi¤ò³«¤¯
    sub trade_after:
        &lock($F{id});
    ¤È
        &unlock($U->{id});
    ¤òºï½ü
    

    $I->{lock} ¤Ï $I = &get_user('I'); ¤Î»þÅÀ¤Ç¾Ã¤¨¤Æ¤·¤Þ¤¦¤Î¤Ç %lock::table ¤Ë¤·¤Þ¤·¤¿¡£Åý°ì´¶¤Ê¤¤¤±¤É¤É¤¦¤À¤í¤¦

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥ì¥Ù¥ë¥¢¥Ã¥×ľ¸å¤Î·Ð¸³Ãͤ¬Àµ¤·¤¯É½¼¨¤µ¤ì¤Ê¤¤ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/experience.cgi¤ò³«¤¯
    sub experience:
        &reload_data('ex') if $S->{id} eq $F{id};
    
        if ($S->{ex} >= $S->{lv} * $set::exl) {
            $S->{ex} -= $S->{lv} * $set::exl;
            $S->{lv}++ if $S->{lv} < $set::lvx;
            $S->{lb}+= $set::lub;
            &M("<span class=levelup>$S->{nm}¤Î$set::lab{lv}¤¬UP¡ª</span>");
            &reload_data('lv') if $S->{id} eq $F{id};
            if ($S->{Sk}{Tb}) {
                $S->{Mlf} += $set::clf;
                &reload_gage('lf','V') if $S->{id} eq $F{id};
            }
        }
    ¢­
        if ($S->{ex} >= $S->{lv} * $set::exl) {
            $S->{ex} -= $S->{lv} * $set::exl;
            $S->{lv}++ if $S->{lv} < $set::lvx;
            $S->{lb}+= $set::lub;
            &M("<span class=levelup>$S->{nm}¤Î$set::lab{lv}¤¬UP¡ª</span>");
            &reload_data('lv') if $S->{id} eq $F{id};
            if ($S->{Sk}{Tb}) {
                $S->{Mlf} += $set::clf;
                &reload_gage('lf','V') if $S->{id} eq $F{id};
            }
        }
    
        &reload_data('ex') if $S->{id} eq $F{id};
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¾õÂÖ°Û¾ï¤Ë¤è¤±¤¤¤Ê¡Ö¡¦¡×¤¬É½¼¨¤µ¤ì¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/base.cgi¤ò³«¤¯
    sub condition_initial:
            while (($K,$V) = each %{$S->{Cd}}) {
    ¢­
            delete $S->{Cd}{in};
            while (($K,$V) = each %{$S->{Cd}}) {
    

    $set::cnd{in}[0] ¤¬push¤µ¤ì¤Æ¤¤¤¿¤Î¤ò½¤Àµ

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥Ú¥Ã¥È¤Ç¡¢Æ±¤¸¼ïÎà¤Î¥Ú¥Ã¥È¤òƱ»þ¤ËÊ£¿ôÅË»¦¤¹¤ë¤È·×»»¤É¤ª¤ê¤Î¼ý³Ï¤¬ÆÀ¤é¤ì¤Ê¤¤ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/butcher.cgi¤ò³«¤¯
    sub butcher_after:
            foreach $Ui (@{$FI{$Ip->{nm}}}) {
    ¢­
            foreach $Ii (@{$FI{$Ip->{nm}}}) {
                $Ui = {%$Ii};
    

    $Ui->{qn}¤ò½ñ¤­´¹¤¨¤Æ¤¤¤¿¤¿¤á·×»»¤¬¶¸¤Ã¤Æ¤·¤Þ¤Ã¤Æ¤¤¤¿

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥í¥°¥¤¥ó»þ¤ÎÅϹҥÁ¥§¥Ã¥¯¤ÎºÝ¡Ö¡û¡û¤Ï¸½ºß¥í¥°¥¤¥óÃæ¤Ç¤¹¡×¤È¤Ê¤ëÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/base.cgi¤ò³«¤¯
    sub login_check:
    my  $T = shift; # value = 'noerror'
    ¢­
    my  $T = shift; # true -> return true, false -> error
    
    sub login_check:
    		if ($T eq 'noerror') { return 1 }
    ¢­
            if ($T) { return 1 }
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ÅË»¦¡¢È²ºÎ¡¢ºÎ·¡¤ÇÁõÈ÷¤¬²õ¤ì¤Ê¤¤ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/break.cgi¤ò³«¤¯
    sub break_check:
        &get_equipment($I,$E);
    ¢­
        &get_equipment($S,$e);
    
    sub break_check:
            foreach $Ii (@{$I->{Bg}}) {
                if ($Ii->{eq} eq $E) {
    ¢­
            foreach $Ii (@{$S->{Bg}}) {
                if ($Ii->{eq} eq $e) {
    
    sub break_check:
                        $I->{bg} -= $Ii->{wt};
    ¢­
                        &change_status($S,'bg',-$Ii->{wt});
    
    library/butcher.cgi¤ò³«¤¯
    sub butcher_after:
        if ($I->{Rh}{ql}{Cp}) {
            &reload_data('rh') if &break_check('rh');
        }
        else {
            &reload_data('sb') if &break_check('sb');
        }
    ¢­
        if ($I->{Rh}{ql}{Cp}) {
            &reload_data('rh') if &break_check($I,'rh');
        }
        else {
            &reload_data('sb') if &break_check($I,'sb');
        }
    
    library/lumberjacking.cgi¤ò³«¤¯
    sub lumberjacking:
        if ($I->{Rh}{ql}{Lj}) {
            &reload_data('rh') if &break_check('rh');
        }
        else {
            &reload_data('sb') if &break_check('sb');
        }
    ¢­
        if ($I->{Rh}{ql}{Lj}) {
            &reload_data('rh') if &break_check($I,'rh');
        }
        else {
            &reload_data('sb') if &break_check($I,'sb');
        }
    
    library/mine.cgi¤ò³«¤¯
    sub mine_after:
        if ($I->{Rh}{ql}{Mn}) {
            &reload_data('rh') if &break_check('rh');
        }
        else {
            &reload_data('sb') if &break_check('sb');
        }
        &reload_data('lh') if &break_check('lh');
    ¢­
        if ($I->{Rh}{ql}{Mn}) {
            &reload_data('rh') if &break_check($I,'rh');
        }
        else {
            &reload_data('sb') if &break_check($I,'sb');
        }
        &reload_data('lh') if &break_check($I,'lh');
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ÈÎÇäÃæ¤Î¥Ú¥Ã¥È¤¬»þ´Ö·Ð²á¤Ç»à¤ó¤Ç¤¤¤Æ¤â»à¤ó¤Ç¤¤¤ë¤³¤È¤¬É½¼¨¤µ¤ì¤Ê¤¤ÉÔ¶ñ¹ç¤ò½¤Àµ¤·¤Þ¤¹¡£

    library/buy.cgi¤ò³«¤¯
    sub buy_before:
            next if !$Up->{sp};
    ¢­
            next if !$Up->{sp};
            $Up->{hg} = 0 if &get_passage($Up->{bt},$set::pyt) > $Up->{ls};
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¡Ú¥È¥Ã¥×¤ØÌá¤ë¡Û



  8. ¤Á¤ç¤Ã¤È¤·¤¿¤³¤È
    1. ¥¤¥ó¥Õ¥©¥á¡¼¥·¥ç¥óºîÀ®¤Çʸ»ú¼ÂÂλ²¾È¤¬»È¤¨¤ë¤è¤¦¤Ë
    2. ¥Û¡¼¥à¥Ú¡¼¥¸¤ËÌá¤ë¥ê¥ó¥¯
    3. Spetial Thanks¤Î¥¢¥ó¥«¡¼¤ò̵¸ú¤Ë
    4. ºîÀ®¤ÇºîÀ®ÍÑ¥¢¥¤¥Æ¥à¥Ç¡¼¥¿¤¬¤Ê¤¤¤È¤­¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÄɲÃ
    5. »àË´¤·¤Æ¤¤¤ë¤È¤­¤ÏVIT¤ò²óÉü¤·¤Ê¤¤¤è¤¦¤Ë
    6. ÈÎÇä¾ðÊó¤Ëµ­ºÜ¤µ¤ì¤ë¥¢¥¤¥Æ¥à¥Ç¡¼¥¿¤ò¾Ü¤·¤¯
    7. Å·¼÷¤òÁ´¤¦¤·¤¿¥Ú¥Ã¥È¤Î¼÷Ì¿¤ò·Þ¤¨¤¿Ç¯Îð¤òɽ¼¨
    8. ¥ª¡¼¥Ö¤òÅ»¤á¤ÆÉ½¼¨
    9. ¶ä¹Ô¤Ç¤â¥Ñ¥Ã¥¯
    10. ¥¢¥¤¥Æ¥à¤Î»ÈÍѤǤâ¥ì¥Ù¥ë¥¢¥Ã¥×
    11. ¥í¥°¥¤¥óÃæ¤Î¿Í¿ô¤Îɽ¼¨¤òÀµ³Î¤Ë
    12. ɽ¼¨¤ÎÍɤ餮¤òµÛ¼ý
    13. ¥¹¥í¥Ã¥È¿ô¤Ë¸½ºß¤Î½ê»ý¿ô¤òɽ¼¨
    14. ÀïÆ®»þ¤Î¥á¥Ã¥»¡¼¥¸¤ò¤Á¤ç¤Ã¤ÈÀ°·Á
    15. ºîÀ®¸å¤Î¥á¥Ã¥»¡¼¥¸¤òÊѹ¹
    16. ÀÜ¿¨¤·¤¿Áê¼ê¤¬¥í¥°¥¤¥óÃæ¤Î¾ì¹ç¤ËÌá¤ë¥Ü¥¿¥ó
    17. ¥Ñ¥Ã¥¯¤¹¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¤È¤­¤Î¥á¥Ã¥»¡¼¥¸¤òÄɲÃ
    18. ¥â¥ó¥¹¥¿¡¼¤Î½Ð¤ëÃϰè¤Ç¤ª¶â¤ò½¦¤¨¤ë¤è¤¦¤Ë
    19. Âѵ×Îϸº¾¯
    20. ¥ª¡¼¥È¥Ñ¥Ã¥­¥ó¥°
    21. ¶ä¹Ô¤Ë»ØÄê¸Ä¿ô¼è°ú/¶ä¹Ô¼«Æ°À°Íýµ¡Ç½ÄɲÃ
    22. ¥¢¥¤¥Æ¥à¤Î¹ØÆþ¥Õ¥©¡¼¥à¤òÅý°ì
    23. ÂпͤÎÇ㤤ʪ¤ò¤¹¤ë¤Ç¹ØÆþ¸Ä¿ô»ØÄê¤ò¤·¤Ê¤¤
    24. »þ´Ö·Ð²á¤ÇºÆÀï²Äǽ¤Ë
    ÉÔ¶ñ¹ç¤Ç¤Ï¤Ê¤¤¤±¤É¡¢°ì±þ¤ä¤Ã¤Æ¤ß¤¿¤³¤È¤Ç¤¹¡£

    ¥¤¥ó¥Õ¥©¥á¡¼¥·¥ç¥óºîÀ®¤Çʸ»ú¼ÂÂλ²¾È¤¬»È¤¨¤ë¤è¤¦¤Ë(ÌäÂ꤬µ¯¤³¤ê¤½¤¦¤Ê¤Î¤Ç¤ä¤é¤Ê¤¤¤Û¤¦¤¬¤¤¤¤¤«¤â)

    master.cgi¤ò³«¤¯
    sub edit_information:
        $t1 =~ s/<br>/\n/g;
    ¢­
        $t1 =~ s/<br>/\n/g;
        $t1 =~ s/&/&amp;/g;
    
    sub make_information:
        $F{in} =~ s/&lt;/</g;
        $F{in} =~ s/&gt;/>/g;
    ¢­
        $F{in} =~ s/&lt;/</g;
        $F{in} =~ s/&gt;/>/g;
        $F{in} =~ s/&amp;/&/g;
    
    library/base.cgi¤ò³«¤¯
    sub decode:
            $V =~ s/</&lt;/g;
            $V =~ s/>/&gt;/g;
    ¢­
            $V =~ s/&/&amp;/g;
            $V =~ s/</&lt;/g;
            $V =~ s/>/&gt;/g;
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥Û¡¼¥à¥Ú¡¼¥¸¤ËÌá¤ë¥ê¥ó¥¯¤¬¤Ê¤¤¤è¤¦¤Êµ¤¤¬¤·¤¿¤Î¤Ç

    library/rights.cgi¤ò³«¤¯
    sub rights:
        print qq|<br>Edit¡§$set::edt\n| if $set::edt;
    ¢­
        print qq|<br><a href="$set::rtn">Edit¡§$set::edt</a>\n| if $set::edt;
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    Spetial Thanks¤Î¥¢¥ó¥«¡¼¤ò̵¸ú¤Ë

    library/rights.cgi¤ò³«¤¯
    sub rights:
        print qq|<a href="#" onClick="GetView('creators')">$creators_label</a>\n| if !$set::stv;
    ¢­
        print qq|<a href="#" onClick="GetView('creators');return false">$creators_label</a>\n| if !$set::stv;
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ºîÀ®¤ÇºîÀ®ÍÑ¥¢¥¤¥Æ¥à¥Ç¡¼¥¿¤¬¤Ê¤¤¤È¤­¤Î¥¨¥é¡¼¥á¥Ã¥»¡¼¥¸¤òÄɲÃ

    library/compose.cgi¤ò³«¤¯
    compose_before:
        require "$set::itm_dir/$K.cgi";
    ¢­
        &error('̤¼ÂÁõ') if ! -e "$set::itm_dir/$K.cgi";
        require "$set::itm_dir/$K.cgi";
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    »àË´¤·¤Æ¤¤¤ë¤È¤­¤ÏVIT¤ò²óÉü¤·¤Ê¤¤¤è¤¦¤Ë

    library/main.cgi¤ò³«¤¯
    sub main:
        # VIT¤Î²óÉü
        $I->{Vt}  = int((time - $precode) / $set::rcv) / 10;
        $I->{vt} += $I->{Vt};
        $I->{vt}  = $I->{Mvt} if $I->{vt} > $I->{Mvt};
    ¢­
        # VIT¤Î²óÉü
        if ($I->{da} ne 'Dd' && $set::rcv) {
            $I->{Vt}  = int((time - $precode) / $set::rcv) / 10;
            $I->{vt} += $I->{Vt};
            $I->{vt}  = $I->{Mvt} if $I->{vt} > $I->{Mvt};
        }
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ÈÎÇä¾ðÊó¤Ëµ­ºÜ¤µ¤ì¤ë¥¢¥¤¥Æ¥à¥Ç¡¼¥¿¤ò¾Ü¤·¤¯¤·¤Æ¤ß¤ë

    library/playerlist.cgi¤ò³«¤¯
    sub sales_information:
                # ÈÎÇä²Á³Ê¤¬ÀßÄꤵ¤ìͽÌó¼Ô¤¬¤¤¤Ê¤¤
                next unless $Ui->{sp} && !$Ui->{rs};
                $Ui->{Id} = $U->{id};
                $Ui->{Nm} = $U->{nm};
    ¢­
                # ÈÎÇä²Á³Ê¤¬ÀßÄꤵ¤ìͽÌó¼Ô¤¬¤¤¤Ê¤¤
                next unless $Ui->{sp} && !$Ui->{rs};
                $Ui->{Id} = $U->{id};
                $Ui->{nm} = &decorate_item($Ui,2);
                $Ui->{Nm} = $U->{nm};
    
    sub sales_information:
            $T->{nm} .= "+$T->{pl}" if $T->{pl};
            $T->{nm} .= " x $T->{qn}" if $T->{qn} > 1;
    ¤òºï½ü
    
    library/base.cgi¤ò³«¤¯
    sub decorate_item:
    my  $T = shift; # Blackmarket = 1
    ¢­
    my  $T = shift; # Blackmarket = 1, Sales Information = 2
    
    sub decorate_item:
        $V = $Si->{Nm} ? $Si->{Nm} : $Si->{nm};
    ¢­
        $V = $T != 2 && $Si->{Nm} ? $Si->{Nm} : $Si->{nm};
    
    sub decorate_item:
        $V .= " x $W" if $W > 1 && !$T;
        $V .= " = " . int($Y * $X) . " $set::mny" if $Y;
        $V .= " ¡Ê$Z$set::wgt¡Ë" if $Z;
        $V .= "¡¦¡¦¡¦ºß¸Ë $W" if $T;
        $V .= "<br>\n";
    ¢­
        $V .= " x $W" if $W > 1 && $T != 1;
        $V .= " = " . int($Y * $X) . " $set::mny" if $Y && $T != 2;
        $V .= " ¡Ê$Z$set::wgt¡Ë" if $Z && $T != 2;
        $V .= "¡¦¡¦¡¦ºß¸Ë $W" if $T == 1;
        $V .= "<br>\n" if $T != 2;
        $V;
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    Å·¼÷¤òÁ´¤¦¤·¤¿¥Ú¥Ã¥È¤Î¼÷Ì¿¤ò·Þ¤¨¤¿Ç¯Îð¤òɽ¼¨¤·¤Æ¤ß¤ë

    library/pet.cgi¤ò³«¤¯
    sub pet:
            if ($Ip->{hg}) {
                if ($age > $Ip->{ls}) {
                    $age .= 'ºÐ¤ÇÅ·¼÷¤òÁ´¤¦¤·¤¿';
                    $Ip->{hg} = 0;
                    $Ip->{ls} = -1;
    ¢­
            if ($Ip->{hg}) {
                if ($age > $Ip->{ls}) {
                    $age .= 'ºÐ¤ÇÅ·¼÷¤òÁ´¤¦¤·¤¿';
                    $Ip->{hg} = 0;
                    $Ip->{ls} = -1;
                    $Ip->{up} = time;
    
    sub pet:
            else {
                $age  = '»à¸å' . &get_passage($Ip->{up},$set::pyt) . 'ǯ';
    ¢­
            else {
                $age  = '»à¸å' . &get_passage($Ip->{up},$set::pyt) . 'ǯ';
                $age .= '¡¡' . &get_passage(time - $Ip->{up} + $Ip->{bt},$set::pyt) . 'ºÐ¤ÇÅ·¼÷¤òÁ´¤¦¤·¤¿' if $Ip->{ls} == -1;
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥ª¡¼¥Ö¤òÅ»¤á¤ÆÉ½¼¨¤·¤Æ¤ß¤ë

    library/orb.cgi¤ò³«¤¯
    sub orb_before:
        foreach (@{$I->{Ob}}) {
            $i++;
            $checked = /[a-z]/ ? ' checked' : '';
            $_ = lc $_;
            $t1 .= "<input type=checkbox name=$i class=checkbox$checked> ";
            $t1 .= &orb_image($_);
            $t1 .= "$set::orb{$_}$set::orb{x}<br>\n";
        }
    ¢­
        $t1 .= "<table class=orb>\n";
    
        foreach ('a' .. 'l') {
            $count = $tcount = 0;
            $count++  while $I->{ob} =~ /$_/ig; $count  ||= 0;
            $tcount++ while $I->{ob} =~ /$_/g ; $tcount ||= 0;
            $checked = $tcount ? ' checked' : '';
            if ($count) {
                $t1 .= "<tr>";
                $t1 .= "<td><input type=checkbox name=$_ class=checkbox$checked> ";
                $t1 .= &orb_image($_);
                $t1 .= "$set::orb{$_}$set::orb{x}</td>";
                $t1 .= "<td>½ê»ý¡§$count</td>";
                $t1 .= "<td>¸ò´¹¡§<input type=textbox size=4 name=t$_ value=$tcount class=textbox$checked></td>";
                $t1 .= "</tr>\n";
            }
        }
    
        $t1 .= "</table><br>\n";
    
    sub orb_before:
        <tt>¥È¥ì¡¼¥É¤Ë½Ð¤¹$set::orb{x}¤Ë¥Á¥§¥Ã¥¯¤òÆþ¤ì¤Æ¤¯¤À¤µ¤¤¡£</tt><br>
    ¢­
        <tt>
        ¥È¥ì¡¼¥É¤Ë½Ð¤¹$set::orb{x}¤Ë¥Á¥§¥Ã¥¯¤òÆþ¤ì<br>
        ¥È¥ì¡¼¥É¤Ë½Ð¤¹¸Ä¿ô¤òÆþÎϤ·¤Æ¤¯¤À¤µ¤¤¡£
        </tt><br>
    
    sub orb_after:
        @{$I->{Ob}} = split(//,$I->{ob});
    ¢­
        @{$I->{Ob}} = split(//,lc $I->{ob});
    
    sub orb_after:
            $i++;
            $_ = $F{$i} ? lc $_ : uc $_;
    ¢­
            $_ = $F{$_} && $F{"t$_"} ? ($F{"t$_"}--, $_) : uc $_;
    
    library/trade.cgi¤ò³«¤¯
    sub trade_before:
        @{$I->{Ob}} = grep { !$unique{$_}++ }
                      map  { $_ = lc $_ } split(//,$I->{ob});
        $checked = ' checked';
        foreach (@{$I->{Ob}}) {
            $t1 .= qq|<input type=radio name=Iob class=radio value="$_"$checked> |;
            $t1 .= &orb_image($_);
            $t1 .= "$set::orb{$_}$set::orb{x}<br>\n";
            $checked = '';
        }
    
        @{$U->{Ob}} = grep { /[a-z]/ } split(//,$U->{ob});
        $checked = ' checked';
        foreach (@{$U->{Ob}}) {
            $t2 .= qq|<input type=radio name=Uob class=radio value="$_"$checked> |;
            $t2 .= &orb_image($_);
            $t2 .= "$set::orb{$_}$set::orb{x}<br>\n";
            $checked = '';
        }
    ¢­
        $checked = ' checked';
        $t1 .= "<table class=orb>\n";
        foreach ('a' .. 'l') {
            $count = 0;
            $count++ while $I->{ob} =~ /$_/ig; $count ||= 0;
            if ($count) {
                $t1 .= "<tr>";
                $t1 .= "<td><input type=radio name=Iob value=$_ class=radio$checked> ";
                $t1 .= &orb_image($_);
                $t1 .= "$set::orb{$_}$set::orb{x}</td>";
                $t1 .= "<td>½ê»ý¡§$count</td>";
                $t1 .= "</tr>\n";
                $checked = '';
            }
        }
        $t1 .= "</table><br>\n";
    
        $checked = ' checked';
        $t2 .= "<table class=orb>\n";
        foreach ('a' .. 'l') {
            $count = 0;
            $count++ while $U->{ob} =~ /$_/g; $count ||= 0;
            if ($count) {
                $t2 .= "<tr>";
                $t2 .= "<td><input type=radio name=Uob value=$_ class=radio$checked> ";
                $t2 .= &orb_image($_);
                $t2 .= "$set::orb{$_}$set::orb{x}</td>";
                $t2 .= "<td>¸ò´¹¡§$count</td>";
                $t2 .= "</tr>\n";
                $checked = '';
            }
        }
        $t2 .= "</table><br>\n";
    
    library/playerlist.cgi¤ò³«¤¯
    sub playerlist:
            @{$U->{Ob}} = map { &orb_image($_) }
                         grep { /[a-z]/ } split(//,$U->{ob});
    ¢­
            undef %trade;
            $trade{$_}  = $U->{ob} =~ s/$_//g foreach ('a' .. 'l');
            @{$U->{Ob}} = map { $trade{$_} ? &orb_image($_)."x$trade{$_}" : () } sort keys %trade;
    
    sub.css¤ò³«¤¯
    /* ¥ª¡¼¥Ö */
    .orb td {
      margin: 0;
      padding: 0 3px 0 0;
      vertical-align: middle;
    }
    
    ¤òÄɲÃ
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥Ñ¥Ã¥¯¤ò¶ä¹Ô¤Ç¤â½ÐÍè¤ë¤è¤¦¤Ë¤¹¤ë

    library/bank.cgi¤ò³«¤¯
    sub bank_before:
            $t2 .= qq|<input type=checkbox name=i$i class=checkbox> |;
    ¢­
            $t2 .= qq|<input type=checkbox name=$i class=checkbox> |;
    
    sub bank_before:
        <br>
        <div class=r>$set::but{OK} $set::but{CLOSE}</div>
    ¢­
        <div class=r>
        <select id=mode name=md class=select onChange="DisableObject('input','o','mode','bank_after','normal');">
        <option value="bank_after">¶ä¹Ô¤òÍøÍѤ¹¤ë</option>
        <option value="pack">¥Ñ¥Ã¥¯¤Ë¤¹¤ë</option>
        <option value="unpack_before">¥Ñ¥Ã¥¯¤òʬ¤±¤ë</option>
        <option value="dump">¼Î¤Æ¤ë</option>
        </select>
        $set::but{OK}<br>
        <br>
        $set::but{CLOSE}
        </div>
    
    sub bank_before:
        <input type=hidden name=md value="bank_after">
        <input type=hidden name=xx value="$I->{XX}">
    ¢­
        <input type=hidden name=xx value="$I->{XX}">
        <input type=hidden name=fl value="bank_before">
    
    sub bank_after:
            next if !$F{"i$i"};
    ¢­
            next if !$F{"$i"};
    
    javascript/GetView.js¤ò³«¤¯
    function DisableObject(tag,hid,cid,keyvalue,flag) {
        try {
            var val1 = flag == 'reverse' ? true : false;
            var val2 = flag == 'reverse' ? false : true;
        	target1 = document.getElementsByTagName(tag);
        	target2 = GetObject(cid,self);
        	for (var i in target1) {
        	    if (target1[i].name && target1[i].name.indexOf(hid) == 0) {
        	        target1[i].disabled  = target2.value == keyvalue ? val1 : val2;
        	    }
        	}
        }
        catch (err) {}
    }
    
    ¤òÄɲÃ
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥¢¥¤¥Æ¥à¤Î»ÈÍѤǤâ¥ì¥Ù¥ë¥¢¥Ã¥×½ÐÍè¤ë¤è¤¦¤Ë¤·¤Æ¤ß¤ë

    library/experience.cgi¤ò³«¤¯
    sub experience:
        if ($S->{ex} >= $S->{lv} * $set::exl) {
            $S->{ex} -= $S->{lv} * $set::exl;
            $S->{lv}++ if $S->{lv} < $set::lvx;
            $S->{lb}+= $set::lub;
            &M("<span class=levelup>$S->{nm}¤Î$set::lab{lv}¤¬UP¡ª</span>");
            &reload_data('lv') if $S->{id} eq $F{id};
            if ($S->{Sk}{Tb}) {
                $S->{Mlf} += $set::clf;
                &reload_gage('lf','V') if $S->{id} eq $F{id};
            }
        }
    ¢­
        &levelup_check($S);
    
    # Sub Level Up #
    sub levelup_check {
    my  $S = shift;
    
        if ($S->{ex} >= $S->{lv} * $set::exl) {
            $S->{ex} -= $S->{lv} * $set::exl;
            $S->{lv}++ if $S->{lv} < $set::lvx;
            $S->{lb}+= $set::lub;
            &M("<span class=levelup>$S->{nm}¤Î$set::lab{lv}¤¬UP¡ª</span>");
            &reload_data('lv') if $S->{id} eq $F{id};
            if ($S->{Sk}{Tb}) {
                $S->{Mlf} += $set::clf;
                &reload_gage('lf','V') if $S->{id} eq $F{id};
            }
        }
    }
    
    ¤òÄɲÃ
    
    library/use.cgi¤ò³«¤¯
    sub type_expendable:
                &change_status($I,$K,$V,1);
    ¢­
                &change_status($I,$K,$V,1);
                if ($K eq 'ex') { require "$set::lib_dir/experience.cgi",&levelup_check($I) }
    

    ɽ¼¨¤¬ÊѤï¤é¤Ê¤¤¤è¤¦¤Ë¤¯¤Õ¤¦¡£

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥í¥°¥¤¥óÃæ¤Î¿Í¿ô¤Îɽ¼¨¤òÀµ³Î¤Ë

    library/logout.cgi¤ò³«¤¯
    sub logout:
        &set_code('on');
    ¢­
        &set_code('on');
        utime(time, time - $set::lgi, "$set::Ucd_dir/$I->{id}.cgi");
    

    ¥í¥°¥¢¥¦¥È¤·¤¿¤éºÇ½ª¹¹¿·»þ¹ï¤ò $set::lgi ÉÃÁ°¤ËÌ᤹

    library/main.cgi¤ò³«¤¯
    sub main:
        $precode = (stat("$set::Ucd_dir/$I->{id}.cgi"))[9];
    ¢­
        $precode = (stat("$set::Ucd_dir/$I->{id}.cgi"))[9];
        $precode += $I->{li} eq 'out' ? $set::lgi : 0;
    
    library/new.cgi¤ò³«¤¯
    sub make_code:
        chmod($set::pms,"$set::Ucd_dir/$I->{id}.cgi");
    ¢­
        chmod($set::pms,"$set::Ucd_dir/$I->{id}.cgi");
        utime(time, time - $set::lgi, "$set::Ucd_dir/$I->{id}.cgi");
    

    ¿·µ¬ÅÐÏ¿¤âƱ¤¸¤è¤¦¤Ë

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ɽ¼¨¤ÎÍɤ餮¤òµÛ¼ý

    sos3.css¤ò³«¤¯
    /* Á´¤Æ¤ÎÍ×ÁÇ */
    * {
      -moz-box-sizing: border-box ;
      box-sizing: border-box ;
    }
    
    ¤òÄɲÃ
    

    Mozilla·Ï/Opera¤Ç¤âpadding¤Î°·¤¤¤òIE¤ÈƱ¤¸¤è¤¦¤Ë

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥¹¥í¥Ã¥È¿ô¤Ë¸½ºß¤Î½ê»ý¿ô¤òɽ¼¨¤·¤Æ¤ß¤ë

    library/base.cgi¤ò³«¤¯
    sub get_item:
        $S->{Bg} = [@K];
    ¢­
        $S->{Bs} = @K if $T == 0;
        $S->{Bk} = @K if $T == 3;
    
        $S->{Bg} = [@K];
    
    library/bag.cgi¤ò³«¤¯
    sub bag:
        <tt>²Ùʪ¥¹¥í¥Ã¥È¡§$I->{bs}</tt><br>
    ¢­
        <tt>²Ùʪ¥¹¥í¥Ã¥È¡§$I->{Bs}/$I->{bs}</tt><br>
    
    library/bank.cgi¤ò³«¤¯
    sub bank_before:
        <tt>$I->{Sp}{Bk}{nm}¥¹¥í¥Ã¥È¡§$I->{bk} $set::wgt</tt><br>
    ¢­
        <tt>$I->{Sp}{Bk}{nm}¥¹¥í¥Ã¥È¡§$I->{Bk}/$I->{bk}</tt><br>
    
    sub bank_before:
        <tt>²Ùʪ¥¹¥í¥Ã¥È¡§$I->{bs}</tt><br>
    ¢­
        <tt>²Ùʪ¥¹¥í¥Ã¥È¡§$I->{Bs}/$I->{bs}</tt><br>
        <tt>¥Ñ¥Ã¥¯¥¹¥­¥ë¡§$I->{pc}</tt>
    

    ¤Ä¤¤¤Ç¤Ë¥Ñ¥Ã¥¯¥¹¥­¥ë¤âɽ¼¨

    library/blackmarket.cgi¤ò³«¤¯
    sub blackmarket_before:
        &get_item($U,1);
    ¢­
        &get_item($I);
        &get_item($U,1);
    
    sub blackmarket_before:
        ¥¢¥¤¥Æ¥àÁí½ÅÎÌ¡§$I->{bg}/$I->{Mbg} $set::wgt<br>
    ¢­
        ¥¢¥¤¥Æ¥àÁí½ÅÎÌ¡§$I->{bg}/$I->{Mbg} $set::wgt<br>
        ²Ùʪ¥¹¥í¥Ã¥È¡§$I->{Bs}/$I->{bs}<br>
        ¥Ñ¥Ã¥¯¥¹¥­¥ë¡§$I->{pc}<br>
    

    ²Ùʪ¥¹¥í¥Ã¥È¤Î¤¿¤á¤Ë &get_item ¡Ä

    library/buy.cgi¤ò³«¤¯
    sub buy_before:
        &get_item($U);
    ¢­
        &get_item($I);
        &get_item($U);
    
    sub buy_before:
        ¥¢¥¤¥Æ¥àÁí½ÅÎÌ¡§$I->{bg}/$I->{Mbg} $set::wgt<br>
    ¢­
        ¥¢¥¤¥Æ¥àÁí½ÅÎÌ¡§$I->{bg}/$I->{Mbg} $set::wgt<br>
        ²Ùʪ¥¹¥í¥Ã¥È¡§$I->{Bs}/$I->{bs}<br>
        ¥Ñ¥Ã¥¯¥¹¥­¥ë¡§$I->{pc}<br>
    

    ²Ùʪ¥¹¥í¥Ã¥È¤Î¤¿¤á¤Ë &get_item ¡Ä

    library/compose.cgi¤ò³«¤¯
    sub compose:
        <div class=r>
        <tt>¥¢¥¤¥Æ¥àÁí½ÅÎÌ¡§$I->{bg}/$I->{Mbg} $set::wgt</tt><br>
        </div>
    ¢­
        <div class=r><tt>
        ¥¢¥¤¥Æ¥àÁí½ÅÎÌ¡§$I->{bg}/$I->{Mbg} $set::wgt<br>
        ²Ùʪ¥¹¥í¥Ã¥È¡§$I->{Bs}/$I->{bs}<br>
        ¥Ñ¥Ã¥¯¥¹¥­¥ë¡§$I->{pc}
        </tt></div>
    
    library/farm.cgi¤ò³«¤¯
    sub farm_before:
        require "$set::itm_dir/$I->{Pl}{fm}";
    ¢­
        &get_item($I);
    
        require "$set::itm_dir/$I->{Pl}{fm}";
    
    sub farm_before:
        <div class=r><tt>¥¢¥¤¥Æ¥àÁí½ÅÎÌ¡§$I->{bg}/$I->{Mbg} $set::wgt</tt></div>
    ¢­
        <div class=r><tt>
        ¥¢¥¤¥Æ¥àÁí½ÅÎÌ¡§$I->{bg}/$I->{Mbg} $set::wgt<br>
        ²Ùʪ¥¹¥í¥Ã¥È¡§$I->{Bs}/$I->{bs}<br>
        ¥Ñ¥Ã¥¯¥¹¥­¥ë¡§$I->{pc}
        </tt></div>
    

    ²Ùʪ¥¹¥í¥Ã¥È¤Î¤¿¤á¤Ë &get_item ¡Ä

    library/price.cgi¤ò³«¤¯
    sub price_before:
        foreach $Ii (@{$I->{Bg}}) {
            $i++;
    ¢­
        $I->{Sl} = 0;
    
        foreach $Ii (@{$I->{Bg}}) {
            $i++;
            $I->{Sl}++ if $Ii->{sp} && $Ii->{cl} ne 'Cu';
    
    sub price_before:
        <div class=r><tt>ÈÎÇ䥹¥í¥Ã¥È¡§$I->{vx}</tt></div>
    ¢­
        <div class=r><tt>ÈÎÇ䥹¥í¥Ã¥È¡§$I->{Sl}/$I->{vx}</tt></div>
    
    library/shopping.cgi¤ò³«¤¯
    sub shopping_before:
        &get_item($I);
    ¢­
        &get_item($I);
    
        require "$set::itm_dir/$I->{Pl}{mk}";
    
    sub shopping_before:
        ¥¢¥¤¥Æ¥àÁí½ÅÎÌ¡§$I->{bg}/$I->{Mbg} $set::wgt<br>
    ¢­
        ¥¢¥¤¥Æ¥àÁí½ÅÎÌ¡§$I->{bg}/$I->{Mbg} $set::wgt<br>
        ²Ùʪ¥¹¥í¥Ã¥È¡§$I->{Bs}/$I->{bs}<br>
        ¥Ñ¥Ã¥¯¥¹¥­¥ë¡§$I->{pc}<br>
    

    ²Ùʪ¥¹¥í¥Ã¥È¤Î¤¿¤á¤Ë &get_item ¡Ä

    library/unpack.cgi¤ò³«¤¯
    sub unpack_before:
        <div class=r><tt>²Ùʪ¥¹¥í¥Ã¥È¡§$I->{bs}</tt></div>
    ¢­
        <div class=r><tt>²Ùʪ¥¹¥í¥Ã¥È¡§$I->{Bs}/$I->{bs}</tt></div>
    

    ¥¢¥¤¥Æ¥à¤Î¹ØÆþ¥Õ¥©¡¼¥à¤òÅý°ì¤òƳÆþ¤·¤¿ºÝ¤ËÊØÍø¤½¤¦¤Ê¾ì½ê¤Ë¤âÄɲ䷤Ƥߤޤ·¤¿

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ÀïÆ®»þ¤Î¥á¥Ã¥»¡¼¥¸¤ò¤Á¤ç¤Ã¤ÈÀ°·Á¤·¤Æ¤ß¤ë

    library/fight.cgi¤ò³«¤¯
    sub fight_player:
            &M("$I->{Nm}¤¬Ë½\Áö¤·¤¿¡ª");
    ¢­
            &M("$I->{Nm}¤¬Ë½\Áö¤·¤¿¡ª");
            &M();
    
    sub fight_player:
            &concrete_battle($A,$D,'¤Î¹¶·â¡£');
            &concrete_battle($D,$A,'¤Î¹¶·â¡£');
    ¢­
            &concrete_battle($A,$D,'¤Î¹¶·â¡£');
            &concrete_battle($D,$A,'¤Î¹¶·â¡£');
            &M();
    
    sub fight_player:
            &concrete_battle($A,$D,'¤Î¥«¥¦¥ó¥¿¡¼¡ª');
    ¢­
            &concrete_battle($A,$D,'¤Î¥«¥¦¥ó¥¿¡¼¡ª');
            &M();
    
    sub first_battle:
        if ($S->{Sk}{Sa}) {
            &concrete_battle($S,$O,'¤Ë¤è¤ë°ÇƤ¤Á¡ª',1);
        }
        elsif ($V1) {
            &initiative($V1);
            if ($A->{Rh}{cl} eq 'Bo') {
                &concrete_battle($A,$D,'¤ÎÀèÀ©¹¶·â¡ª',1);
            }
        }
        elsif ($V2) {
            &initiative($V2);
            &throw_weapon($A,$D,"¤Ï$A->{Rh}{nm}¤òÅꤲ¤¿¡ª",1);
        }
        elsif ($V3) {
            &initiative($V3);
            if (&skill_roll($A,$set::sQg,$A->{in} * 3)) {
                &concrete_battle($A,$D,"¤Ï$SK{Qg}¤òÊü¤Ã¤¿¡ª",1);
            }
        }
        elsif ($V4) {
            &initiative($V4);
            if (&skill_roll($A,$set::sQd,$A->{in} * 3)) {
                &concrete_battle($A,$D,"¤Î$SK{Qd}¡ª",1);
                $V5 = $V4 * -1;
                $set::frd--;
            }
        }
    ¢­
        if ($S->{Sk}{Sa}) {
            &concrete_battle($S,$O,'¤Ë¤è¤ë°ÇƤ¤Á¡ª',1);
            &M();
        }
        elsif ($V1) {
            &initiative($V1);
            if ($A->{Rh}{cl} eq 'Bo') {
                &concrete_battle($A,$D,'¤ÎÀèÀ©¹¶·â¡ª',1);
                &M();
            }
        }
        elsif ($V2) {
            &initiative($V2);
            &throw_weapon($A,$D,"¤Ï$A->{Rh}{nm}¤òÅꤲ¤¿¡ª",1);
            &M();
        }
        elsif ($V3) {
            &initiative($V3);
            if (&skill_roll($A,$set::sQg,$A->{in} * 3)) {
                &concrete_battle($A,$D,"¤Ï$SK{Qg}¤òÊü¤Ã¤¿¡ª",1);
                &M();
            }
        }
        elsif ($V4) {
            &initiative($V4);
            if (&skill_roll($A,$set::sQd,$A->{in} * 3)) {
                &concrete_battle($A,$D,"¤Î$SK{Qd}¡ª",1);
                &M();
                $V5 = $V4 * -1;
                $set::frd--;
            }
        }
    

    ¸òÀï¤Î¸å¤Ë &M() ¤Ç²þ¹Ô¤òÆþ¤ì¤Þ¤·¤¿

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ºîÀ®¸å¤Îɽ¼¨¤òÊѤ¨¤Æ¤ß¤ë

    library/compose.cgi¤ò³«¤¯
    sub compose_after:
            $Ui->{Im} = &item_image($Ui->{dt});
            &M("$Ui->{Im}$Ui->{dt}{nm} x $Ui->{dt}{qn}¤òºîÀ®¤·¤Þ¤·¤¿¡£");
    
    ¤òºï½ü
    
    sub compose_after:
            &deluxe_roll($I,$Ui->{dt}) if $Ui->{dt}{cl} eq 'Fd';
            &double_roll($I,$Ui->{dt}) if $Ui->{dt}{cl} eq 'Mt';
    ¢­
            &deluxe_roll($I,$Ui->{dt}) if $Ui->{dt}{cl} eq 'Fd';
            &double_roll($I,$Ui->{dt}) if $Ui->{dt}{cl} eq 'Mt';
            &M(&decorate_item($Ui->{dt},2)."¤òºîÀ®¤·¤Þ¤·¤¿¡£");
            &M("<span class=effect>$Ui->{dt}{nm}¤Ï<span class=Ex>¥¨¥¯¥»¥ì¥ó¥ÈÉÊ</span>¤Ç¤¹¡£</span>") if $Ui->{dt}{Ql}{Ex};
            &M("<span class=effect>$Ui->{dt}{nm}¤Ï<span class=Dx>¥Ç¥é¥Ã¥¯¥¹ÉÊ</span>¤Ç¤¹¡£</span>")   if $Ui->{dt}{Ql}{Dx};
            &M("<span class=effect>¤¤¤Ä¤â¤ÎÆóÇܤÎÎ̤òºîÀ®¤¹¤ë»ö¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£</span>")              if $Ui->{dt}{DB};
    
    sub excellent_roll:
            &M("$Si->{nm}¤Ï<span class=Ex>¥¨¥¯¥»¥ì¥ó¥ÈÉÊ</span>¤Ç¤¹¡£");
    ¢­
            $Si->{Ql}{Ex} = 1;
    
    sub deluxe_roll:
            &M("$Si->{nm}¤Ï<span class=Dx>¥Ç¥é¥Ã¥¯¥¹ÉÊ</span>¤Ç¤¹¡£");
    ¢­
            $Si->{Ql}{Dx} = 1;
    
    sub double_roll:
            &M("¤¤¤Ä¤â¤ÎÆóÇܤÎÎ̤òºîÀ®¤¹¤ë»ö¤ËÀ®¸ù¤·¤Þ¤·¤¿¡£");
    ¢­
            $Si->{DB} = 1;
    

    ÈÎÇä¾ðÊó¤Ëµ­ºÜ¤µ¤ì¤ë¥¢¥¤¥Æ¥à¥Ç¡¼¥¿¤ò¾Ü¤·¤¯¤òÀè¤Ë¹Ô¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ÀÜ¿¨¤·¤¿Áê¼ê¤¬¥í¥°¥¤¥óÃæ¤Î¾ì¹ç¤ËÌá¤ë¥Ü¥¿¥ó¤òɽ¼¨¤·¤Æ¤ß¤ë

    library/base.cgi¤ò³«¤¯
    sub login_check:
    my  $T = shift; # value = 'noerror'
    ¢­
    my  $T = shift; # mode -> say, true -> return true, false -> error
    
    sub login_check:
            if ($T) { return 1 }
    ¢­
            if ($T =~ /\D/) { &say("$S->{nm}¤Ï¸½ºß¥í¥°¥¤¥óÃæ¤Ç¤¹",$T) }
            if ($T) { return 1 }
    

    ¥í¥°¥¤¥ó»þ¤ÎÅϹҥÁ¥§¥Ã¥¯¤ÎºÝ¡Ö¡û¡û¤Ï¸½ºß¥í¥°¥¤¥óÃæ¤Ç¤¹¡×¤È¤Ê¤ëÉÔ¶ñ¹ç¤Î½¤Àµ¤òÀè¤Ë¹Ô¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹

    library/bounty.cgi¤ò³«¤¯
    sub bounty_after:
        &login_check($U);
    ¢­
        &login_check($U,'bounty_before');
    
    library/buy.cgi¤ò³«¤¯
    sub buy_before:
        &login_check($U);
    ¢­
        &login_check($U,'contact_before');
    
    sub buy_after:
        &login_check($U);
    ¢­
        &login_check($U,'contact_before');
    
    library/contact.cgi¤ò³«¤¯
    sub contact_after:
        &login_check($U);
    ¢­
        &login_check($U,'contact_before');
    
    library/cure.cgi¤ò³«¤¯
    sub cure_before:
        &login_check($U);
    ¢­
        &login_check($U,'contact_before');
    
    sub cure_after:
        &login_check($U);
    ¢­
        &login_check($U,'contact_before');
    
    library/destone.cgi¤ò³«¤¯
    sub destone:
        &login_check($U);
    ¢­
        &login_check($U,'contact_before');
    
    library/fight.cgi¤ò³«¤¯
    sub fight_player:
        &login_check($U);
    ¢­
        &login_check($U,'contact_before');
    
    library/playerlist.cgi¤ò³«¤¯
    sub playerlist:
            $U->{Li} = &login_check($U,'noerror') ? '¡û' : '¡ü';
    ¢­
            $U->{Li} = &login_check($U,1) ? '¡û' : '¡ü';
    
    library/trade.cgi¤ò³«¤¯
    sub trade_before:
        &login_check($U);
    ¢­
        &login_check($U,'contact_before');
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥Ñ¥Ã¥¯¤¹¤ë¥¢¥¤¥Æ¥à¤¬¤Ê¤¤¤È¤­¤Î¥á¥Ã¥»¡¼¥¸¤òÄɲ䷤Ƥߤë

    library/pack.cgi¤ò³«¤¯
    sub pack:
        &set_code;
    ¢­
        &say("¥¢¥¤¥Æ¥à¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó",$F{fl}) if !$id;
    
        &set_code;
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥â¥ó¥¹¥¿¡¼¤Î½Ð¤ëÃϰè¤Ç¤ª¶â¤ò½¦¤¨¤ë¤è¤¦¤Ë

    library/find.cgi¤ò³«¤¯
    sub encounter:
        &found($I,'it',$set::fvt,'õº÷','¤Ä¼ê¤ËÆþ¤ì¤Þ¤·¤¿',0,'monster');
    ¢­
        &found($I,'it',$set::fvt,'õº÷','¤Ä¼ê¤ËÆþ¤ì¤Þ¤·¤¿',1,'monster');
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    Âѵ×Îϸº¾¯

    set.cgi¤ò³«¤¯
    # ¤½¤Î¾ Others ###################################### #
    $edb = 10;                   # À¸»º»þ¤ÎÁõÈ÷Âѵ×ÅÙ¸º¾¯³ÎΨ(n%)
    $fdb = 10;                   # ÀïÆ®»þ¤ÎÁõÈ÷Âѵ×ÅÙ¸º¾¯³ÎΨ(n%)
    
    library/base.cgi¤ò³«¤¯
    # Sub Set Equipment #
    sub set_equipment {
    my  $S = shift;
    my  $Si = shift;
    
        $S->{$Si->{eq}} = "$Si->{nm}/$Si->{cl}/$Si->{ql}/$Si->{ef}/$Si->{db}/$Si->{im}/$Si->{gd}/$Si->{pl}/$Si->{cr}";
    }
    
    ¤òÄɲá£
    
    library/break.cgi¤ò³«¤¯
    sub break_check:
            $S->{$e} = '';
            undef $S->{$E};
            return 1;
        }
    ¢­
            $S->{$e} = '';
            undef $S->{$E};
            return 1;
        }
        elsif (&roll_dice(100) <= $set::edb) {
            foreach $Ii (@{$S->{Bg}}) {
                if ($Ii->{eq} eq $e) {
                    &M("$S->{$E}{nm}¤ÎÂѵ×ÎϤ¬²¼¤¬¤ê¤Þ¤·¤¿¡£");
                    $Ii->{db}--;
                    &set_equipment($S,$Ii);
                    last;
                }
            }
            return 0;
        }
    
    library/consumption.cgi¤ò³«¤¯
    sub consumption_check:
                else {
                    &change_status($I,'bg',-$Si->{wt});
                    $Si->{qn} = 0;
                }
                $I->{$Si->{eq}} = '';
                &reload_data($Si->{eq});
            }
    ¢­
                else {
                    &change_status($I,'bg',-$Si->{wt});
                    $Si->{qn} = 0;
                }
                $I->{$Si->{eq}} = '';
                &reload_data($Si->{eq});
            }
            elsif (&roll_dice(100) <= $set::edb) {
                &M("$Si->{nm}¤ÎÂѵ×ÎϤ¬²¼¤¬¤ê¤Þ¤·¤¿¡£");
                $Si->{db}--;
                &set_equipment($I,$Si);
            }
    
    library/equip.cgi¤ò³«¤¯
    sub fitting_room:
        $I->{$E} = "$Si->{nm}/$Si->{cl}/$Si->{ql}/$Si->{ef}/$Si->{db}/$Si->{im}/$Si->{gd}/$Si->{pl}/$Si->{cr}";
        $Si->{sp} = $Si->{rs} = '';
        $Si->{eq} = $E;
    ¢­
        $Si->{sp} = $Si->{rs} = '';
        $Si->{eq} = $E;
        &set_equipment($I,$Si);
    
    library/fight.cgi¤ò³«¤¯
    sub fight_player:
        # Ã¥¼è¥Á¥§¥Ã¥¯ #
        &steal_check($I) if !$U->{Op}{Sc};
    ¢­
        # Ã¥¼è¥Á¥§¥Ã¥¯ #
        &steal_check($I) if !$U->{Op}{Sc};
    
        # ÁõÈ÷Âѵ×ÅÙ¸º¾¯¥Á¥§¥Ã¥¯ #
        &equip_wear_check($I);
        &equip_wear_check($U);
        &M();
    
    sub fight_creature:
        &baggage_check($I) if ref $I->{BI};
    ¢­
        &equip_wear_check($I);
        &baggage_check($I) if ref $I->{BI};
    
    sub baggage_check:
            next if !$F;
    ¢­
            next if !$F;
            if ($F == 2) {
                if (--$Ii->{db} > 0) {
                    &set_equipment($S,$Ii);
                }
                else {
                    &destruction_check($S,$Ii->{eq});
                    $F = 1;
                }
            }
            next if $F == 2;
    
    # Sub Equip Wear Check #
    sub equip_wear_check {
    my  $S = shift;
    my ($e,$E);
    
        return if !$set::fdb;
        return if $S->{Op}{Ub};
    
        foreach $e (keys %set::eqp) {
            $E = ucfirst($e);
            next if $S->{$e} eq '';
            next if $e eq 'rh' && $S->{Rh}{nm} eq '';
            next if $S->{BI}{$e};
    
            if (&roll_dice(100) <= $set::fdb) {
                $S->{BI}{$e} = 2;
                &M("$S->{Nm}¤Î$S->{$E}{nm}¤ÎÂѵ×ÎϤ¬¸º¾¯¤·¤¿¡£");
            }
        }
    }
    
    
    ¤òÄɲÃ
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥ª¡¼¥È¥Ñ¥Ã¥­¥ó¥°¤ò¼ÂÁõ¤·¤Æ¤ß¤ë

    library/bag.cgi¤ò³«¤¯
    sub bag:
        <option value="pack">¥Ñ¥Ã¥¯¤Ë¤¹¤ë</option>
    ¢­
        <option value="pack">¥Ñ¥Ã¥¯¤Ë¤¹¤ë</option>
        <option value="pack_all">Á´¤Æ¤ò¥Ñ¥Ã¥¯¤Ë¤¹¤ë</option>
    
    library/bank.cgi¤ò³«¤¯
    sub bank_before:
        <option value="pack">¥Ñ¥Ã¥¯¤Ë¤¹¤ë</option>
    ¢­
        <option value="pack">¥Ñ¥Ã¥¯¤Ë¤¹¤ë</option>
        <option value="pack_all">Á´¤Æ¤ò¥Ñ¥Ã¥¯¤Ë¤¹¤ë</option>
    
    library/compose.cgi¤ò³«¤¯
    sub compose:
        <option value="pack">¥Ñ¥Ã¥¯¤Ë¤¹¤ë</option>
    ¢­
        <option value="pack">¥Ñ¥Ã¥¯¤Ë¤¹¤ë</option>
        <option value="pack_all">Á´¤Æ¤ò¥Ñ¥Ã¥¯¤Ë¤¹¤ë</option>
    
    library/pack.cgi¤ò³«¤¯
    # Sub Pack All #
    sub pack_all {
        $I = &get_user('I');
        &say("¥Ñ¥Ã¥¯¥¹¥­¥ë¤¬¤¢¤ê¤Þ¤»¤ó",$F{fl}) if $I->{pc} < 2;
    
        &get_item($I);
    
        &auto_pack($I,$I->{Bg});
    
        &set_code;
    
        &sort_item($I);
    
        &set_item($I);
    
        &say("²Äǽ\¤Ê¥¢¥¤¥Æ¥à¤òÁ´¤Æ¥Ñ¥Ã¥¯¤Ë¤·¤Þ¤·¤¿¡£",$F{fl});
    }
    
    # Sub Auto Pack #
    sub auto_pack {
    my  $S = shift;
    my  $V = shift; # Bag
    my  $T = shift; # Bank Slot
    my ($Ii,$i,%P);
    
        foreach $Ii (@{$V}) {
            next if !$Ii;
            next if &item_class_check($Ii) ne 'M';
            next if $Ii->{qn} >= $S->{pc};
            if ($P{"$Ii->{id}:$Ii->{ql}:$Ii->{gd}"}) {
                foreach $i (0 .. $Ii->{qn}) {
                    $Ii->{Qn} = $i;
                    last if $P{"$Ii->{id}:$Ii->{ql}:$Ii->{gd}"}{qn} + $i >= $S->{pc};
                }
                $Ii->{qn}                               -= $Ii->{Qn};
                $P{"$Ii->{id}:$Ii->{ql}:$Ii->{gd}"}{qn} += $Ii->{Qn};
                $P{"$Ii->{id}:$Ii->{ql}:$Ii->{gd}"}{sp} = $Ii->{sp} = '' if $Ii->{Qn};
    
                if (!$Ii->{qn}) {
                    $T->{Sl}-- if $T;
                    undef $Ii; delete $P{"$Ii->{id}:$Ii->{ql}:$Ii->{gd}"};
                }
                else {
                    $P{"$Ii->{id}:$Ii->{ql}:$Ii->{gd}"} = $Ii;
                }
            }
            else {
                $P{"$Ii->{id}:$Ii->{ql}:$Ii->{gd}"} = $Ii;
            }
        }
    }
    
    ¤òÄɲÃ
    

    ²Äǽ¤Ê¸Â¤ê¤¹¤Ù¤Æ¥Ñ¥Ã¥¯¡£¥Ñ¥Ã¥¯¥¹¥­¥ë°Ê¾å¤ÎÎ̤ò¥Ñ¥Ã¥¯¤·¤Æ¤¤¤ë¤â¤Î¤Ï̵»ë¤¹¤ë¤Î¤Ç°Â¿´

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¶ä¹Ô¤Ë»ØÄê¸Ä¿ô¼è°ú/¶ä¹Ô¼«Æ°À°Íýµ¡Ç½ÄɲÃ

    javascript/GetCookie.js¤ò³«¤¯
    function GetValue:
    	document.loginform.ps.value = GetCookie("ps");
    ¢­
    	document.loginform.ps.value = GetCookie("ps");
    	document.loginform.bk.value = GetCookie("bk");
    
    function BankAutoCheck() {
    	document.bank.bk.checked = GetCookie("bk") != "" ? true : false;
    }
    
    ¤òÄɲÃ
    
    library/base.cgi¤ò³«¤¯
    sub set_cookie:
        $ck = "id\:$F{id}\,ps\:$F{ps}\,";
    ¢­
        $ck = "id\:$F{id}\,ps\:$F{ps}\,bk\:$F{bk}\,";
    
    library/bank.cgi¤ò³«¤¯
    sub bank_before:
            $t1 .= qq|<input type=checkbox name=o$i class=checkbox> |;
            $t1 .= &decorate_item($Ii);
    ¢­
            $t1 .= qq|<tr>\n<td>\n|;
            $t1 .= qq|<input type=checkbox name=o$i class=checkbox> |;
            $t1 .= &decorate_item($Ii);
            $t1 .= qq|</td>\n<td class=r>|;
            $Ii->{qn} ||= 1;
            $t1 .= qq|<input type=textbox name=ot$i class=textbox size=5 value=$Ii->{qn}>|;
            $t1 .= qq|</td>\n</tr>\n|;
    
    sub bank_before:
            $t2 .= qq|<input type=checkbox name=$i class=checkbox> |;
            $t2 .= &decorate_item($Ii);
    ¢­
            $t2 .= qq|<tr>\n<td>\n|;
            $t2 .= qq|<input type=checkbox name=$i class=checkbox> |;
            $t2 .= &decorate_item($Ii);
            $t2 .= qq|</td>\n<td class=r>|;
            $Ii->{qn} ||= 1;
            $t2 .= qq|<input type=textbox name=it$i class=textbox size=5 value=$Ii->{qn}>|;
            $t2 .= qq|</td>\n</tr>\n|;
    
    sub bank_before:
        &header(CSS=>'sub',JavaScript=>'GetView');
    ¢­
        &header(CSS=>'sub',JavaScript=>'GetCookie,GetView',Body=>' onLoad="BankAutoCheck();"');
    
    sub bank_before:
        <form method=post action=$set::cgi_url>
    ¢­
        <form name=bank method=post action=$set::cgi_url>
    
    sub bank_before:
        $I->{Sp}{Bk}{nm}¤«¤é¥¢¥¤¥Æ¥à¤ò½Ð¤¹<br>
        <br>
        $t1
    ¢­
        <table class=item>
        <tr class=first>
        <td>$I->{Sp}{Bk}{nm}¤«¤é¥¢¥¤¥Æ¥à¤ò½Ð¤¹</td>
        <td class=r>°ú½Ð¸Ä¿ô</td>
        </tr>
        $t1
        </table>
    
    sub bank_before:
        $I->{Sp}{Bk}{nm}¤Ë¥¢¥¤¥Æ¥à¤òÊݴɤ¹¤ë<br>
        <br>
        $t2
    ¢­
        <table class=item>
        <tr class=first>
        <td>$I->{Sp}{Bk}{nm}¤Ë¥¢¥¤¥Æ¥à¤òÊݴɤ¹¤ë</td>
        <td class=r>ÍÂÆþ¸Ä¿ô</td>
        </tr>
        $t2
        </table>
    
    sub bank_before:
        <tt>²Ùʪ¥¹¥í¥Ã¥È¡§$I->{bs}</tt><br>
    ¢­
        <tt>²Ùʪ¥¹¥í¥Ã¥È¡§$I->{bs}</tt><br>
        <tt>¥Ñ¥Ã¥¯¥¹¥­¥ë¡§$I->{pc}</tt>
    
    sub bank_before:
        <div class=r>$set::but{OK} $set::but{CLOSE}</div>
    ¢­
        <div class=r>
        <tt>¶ä¹Ô¼«Æ°À°Íý¡§<input type=checkbox name=bk class=checkbox></tt><br>
        <br>
        $set::but{OK} $set::but{CLOSE}
        </div>
    
    sub bank_after:
    my  $Ui;
    ¢­
    my  $Ui;
    my  $Si;
    
    sub bank_after:
            &say("$Ii->{nm}¤ÏÁõÈ÷Ãæ¤Ç¤¹¡£",'bank_before') if $Ii->{eq};
    ¢­
            &say("$Ii->{nm}¤ÏÁõÈ÷Ãæ¤Ç¤¹¡£",'bank_before') if $Ii->{eq};
            &say("$Ii->{nm}¡§¿ôÃͰʳ°¤Ï»ÈÍѽÐÍè¤Þ¤»¤ó¡£",'bank_before') if $F{"it$i"} =~ /\D/;
    
    sub bank_after:
            $I->{bg} -= $Ii->{qn} * $Ii->{wt};
            $Ii->{sp} = '';
            push(@{$U->{Bg}},$Ii);
            undef $Ii;
    ¢­
            $F{"it$i"} = $Ii->{qn} if $F{"it$i"} > $Ii->{qn};
            $F{"it$i"} = 1         if $F{"it$i"} <= 0;
            $I->{bg} -= $F{"it$i"} * $Ii->{wt};
            $Ii->{sp} = '';
            $Ii->{qn} -= $F{"it$i"};
    
            $Si = {%$Ii};
            $Si->{qn} = $F{"it$i"};
            push(@{$U->{Bg}},$Si);
            if (!$Ii->{qn}) { undef $Ii }
    

    ¶ä¹Ô¤Ç¡¢ÃÍÃÊÀßÄꤷ¤Æ¤¢¤ë¥¢¥¤¥Æ¥à¤ò°ú¤­½Ð¤¹¤ÈÈÎÇ䥹¥í¥Ã¥È¤è¤ê¿¤¯¥¢¥¤¥Æ¥à¤òÈÎÇä¤Ç¤­¤ëÉÔ¶ñ¹ç¤Î½¤Àµ¤òÀè¤Ë¤ä¤Ã¤Æ¤ª¤¯É¬Íפ¬¤¢¤ê¤Þ¤¹

    sub bank_after:
            $U->{Sl}--;
            $I->{bg} += $Ui->{qn} * $Ui->{wt};
            push(@{$I->{Bg}},$Ui);
            undef $Ui;
    ¢­
            &say("$Ui->{nm}¡§¿ôÃͰʳ°¤Ï»ÈÍѽÐÍè¤Þ¤»¤ó¡£",'bank_before') if $F{"ot$i"} =~ /\D/;
            $F{"ot$i"} = $Ui->{qn} if $F{"ot$i"} > $Ui->{qn};
            $F{"ot$i"} = 1         if $F{"ot$i"} <= 0;
            $I->{bg} += $F{"ot$i"} * $Ui->{wt};
            $Ui->{qn} -= $F{"ot$i"};
    
            $Si = {%$Ui};
            $Si->{qn} = $F{"ot$i"};
            push(@{$I->{Bg}},$Si);
            if (!$Ui->{qn}) { undef $Ui; $U->{Sl}-- }
    
    sub bank_after:
        &say("$I->{Sp}{Bk}{nm}¥¹¥í¥Ã¥È¤¬¤¤¤Ã¤Ñ¤¤¤Ç¤¹¡£",'bank_before') if $U->{Sl} > $I->{bk};
    ¢­
        if ($F{bk}) {
            require "$set::lib_dir/pack.cgi";
            &auto_pack($I,$U->{Bg},$U);
        }
    
        &say("$I->{Sp}{Bk}{nm}¥¹¥í¥Ã¥È¤¬¤¤¤Ã¤Ñ¤¤¤Ç¤¹¡£",'bank_before') if $U->{Sl} > $I->{bk};
    

    ¥ª¡¼¥È¥Ñ¥Ã¥­¥ó¥°¤òÀè¤Ë¹Ô¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹

    sub bank_after:
        &set_user($I);
    ¢­
        &set_user($I);
    
        &set_cookie;
    
    library/top.cgi¤ò³«¤¯
    sub top:
    <input type=hidden name=md value="main">
    ¢­
    <input type=hidden name=md value="main">
    <input type=hidden name=bk>
    
    sub.css¤ò³«¤¯
    /* ¥¢¥¤¥Æ¥à */
    .item {
      width: 100%;
    }
    .item .first td {
      padding-bottom: 5px;
      font-size: 11px;
      font-family: monospace;
      color: #005533;
    }
    .item td {
      margin: 0;
      padding: 0;
      font-size: 12px;
    }
    .item td.r {
      vertical-align: bottom;
    }
    
    
    ¤òÄɲÃ
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¥¢¥¤¥Æ¥à¤Î¹ØÆþ¥Õ¥©¡¼¥à¤òÅý°ì¤·¤Æ¤ß¤ë

    »Ô¾ì¡¦°Ç»Ô¡¦ÇÀ¾ì¡¦¥Ñ¡¼¥È¥Ê¡¼¤Ç¡¢¹ØÆþ¥Õ¥©¡¼¥à¤Î»ÅÍͤòÅý°ì¤·¤Þ¤¹¡£
    Ç㤤¤¿¤¤¥¢¥¤¥Æ¥à¤Ë¥Á¥§¥Ã¥¯¤òÆþ¤ì¡¢Íߤ·¤¤¿ô¤ò»ØÄꤷ¤Æ¹ØÆþ¤·¤Þ¤¹¡£
    ¥Ñ¥Ã¥¯¤Ç¤­¤ë¤â¤Î¤Ï¥Ñ¥Ã¥¯¤µ¤ì¡¢¥Ñ¥Ã¥¯¥¹¥­¥ë°Ê¾å¤ÎÎ̤òÇã¤Ã¤¿¤È¤­¤Ïʬ³ä¤µ¤ì¤Æ²Ùʪ¤ËÆþ¤ê¤Þ¤¹¡£
    ¤Ä¤Þ¤ê¥Ñ¥Ã¥¯¥¹¥­¥ë¤òͤ¨¤¿Î̤ò¥Ñ¥Ã¥¯¤¹¤ëÌÜŪ¤ÇÇ㤤ʪ¤ò¤¹¤ë¤³¤È¤¬½ÐÍè¤Ê¤¯¤Ê¤ê¤Þ¤¹¡£
    ÃÍÃÊÀßÄê¤Ïñ²Á¤ò»ØÄꤹ¤ë¤³¤È¤Ë¤Ê¤ê¤Þ¤¹¡£
    ¥Ñ¥Ã¥¯¥¹¥­¥ë¤Î²ÁÃͤ¬¤°¤ó¤È¾å¤¬¤ë°ìÊý¤Ç¡¢Ãª¤Î²ÁÃͤ¬Â¿¾¯²¼¤¬¤ë¤«¤È»×¤¤¤Þ¤¹¡£
    ¤¿¤À¡¢¥Ñ¥Ã¥¯¥¹¥­¥ë¤¬Ä㤤¡¦¤¤¤í¤ó¤Ê¼ïÎà¤Î¥¢¥¤¥Æ¥à¤òÈÎÇ䤷¤¿¤¤¤È¤­¤Ï꤬ɬÍפˤʤë¤Î¤Ç¿¼¹ï¤Ê¤Û¤É¤Ç¤Ï¤Ê¤¤¤È»×¤¤¤Þ¤¹¡£

    ¢¨ ¥Ñ¥Ã¥¯¥¹¥­¥ë¤òͤ¨¤Æ¤Î¥Ñ¥Ã¥¯¤òµö²Ä¤¹¤ë¤«¤ÎÀßÄê¤òÄɲä·¤Þ¤·¤¿¡£
    ¢¨ ¹ØÆþ¸Ä¿ô¤ò»ØÄê¤Ç¤­¤ë¤è¤¦¤Ë¤¹¤ë¤«¤ÎÀßÄê¤òÄɲä·¤Þ¤·¤¿¡£
    ¢¨ ¡ÖÃÍÃʤòÀßÄꤹ¤ë¡×¤Çñ²Á¤òÆþÎϤ¹¤ë¤«Á´ÂβÁ³Ê¤òÆþÎϤ¹¤ë¤«¤ÎÀßÄê¤ò¤òÄɲä·¤Þ¤·¤¿¡£

    set.cgi¤ò³«¤¯
    # »Ô¾ì Market ######################################## #
    $uop = 1;                    # ÃÍÃʤòÀßÄꤹ¤ë¤Çñ²Á¤òÆþÎϤ¹¤ë(yes=1,no=0)
    %mpc = (Mk=>0,Fm=>0,         # »Ô¾ì,ÇÀ¾ì,°Ç»Ô,ÂÐ¿Í¤Ç¤Î¹ØÆþ¤Ç¥Ñ¥Ã¥¯¥¹¥­¥ë¤òͤ¨¤Æ¤Î¥Ñ¥Ã¥¯¤òµö²Ä¤¹¤ë(yes=1,no=0)
            Bm=>0,Xx=>0);
    %mif = (Mk=>1,Fm=>1,         # »Ô¾ì,ÇÀ¾ì,°Ç»Ô,ÂÐ¿Í¤Ç¤Î¹ØÆþ¤Ç¹ØÆþ¸Ä¿ô¤ò»ØÄê½ÐÍè¤ë¤è¤¦¤Ë¤¹¤ë(yes=1,no=0)
            Bm=>1,Xx=>1);
    
    data/place.cgi¤ò³«¤¯
        'Bm' => { 'nm' => '°Ç»Ô'},
    ¢­
        'Bm' => { 'md' => 'blackmarket_before',
                  'nm' => '°Ç»Ô'},
    
    library/purchase.cgi¤òºîÀ®¤¹¤ë
    # --------------------------------------------------- #
    # Script of Saga III Purchase.cgi Version 1 (1.4)
    # Copyright (C) 2005-2007 Missing Link.
    # --------------------------------------------------- #
    
    # Sub Purchase Item #
    sub purchase_item {
    my  $V = shift; # item ref
    my  $P = shift; # place
    my  $R = shift; # return mode
    my  $T;
    my  $G;
    my  $M;
    my  $Ii;
    my  $Ui;
    my  $buyitemflag;
    my ($i,$n);
    my ($keychck,$keytext);
    
        $I->{Ap} ||= 1;
    
        $R ||= $I->{Sp}{$P}{md};
    
        $T = $P eq 'Xx' ? 2 :
             $P eq 'Bm' ? 1 : 0;
    
        $G = !$T || $T == 2 && !$set::mif{$P} ? 1 : 0;
    
        foreach $Ui (@$V) {
            $i++;
            $keychck = $T == 2 ?   "$i-$Ui->{id}-$Ui->{sp}" :   "$Ui->{id}_$Ui->{gd}";
            $keytext = $T == 2 ? "t-$i-$Ui->{id}-$Ui->{sp}" : "t_$Ui->{id}_$Ui->{gd}";
    
            $F{$keytext} = !$set::mif{$P} ? $T == 2 ? $Ui->{qn} : 1 : $F{$keytext};
    
            next if !$F{$keychck} || !$F{$keytext};
    
            if ($F{dl}) { $Ui->{qn} = 0; next }
    
            &error('Price Error') if $T == 2 && !$Ui->{sp};
            &error('Quantity Error') if !$Ui->{qn};
    
    
            if ($F{$keytext} =~ /\D/) {
                $T == 2 && &M("$Ui->{nm}¡§¿ôÃͰʳ°¤Ï»ÈÍѽÐÍè¤Þ¤»¤ó") && next;
                &say("$Ui->{nm}¡§¿ôÃͰʳ°¤Ï»ÈÍѽÐÍè¤Þ¤»¤ó",$R);
            }
            $F{$keytext} = $Ui->{qn} if $T && $F{$keytext} > $Ui->{qn};
    
    
            $Ui->{Qn} = $T ? $F{$keytext} : $Ui->{qn} * $F{$keytext};
            $Ui->{Wt} = $Ui->{wt} * $Ui->{Qn};
            $Ui->{sp} = $Ui->{bp} * $set::mtp + $set::mpp if $T != 2;
            $Ui->{sp}/= $Ui->{qn} if $T == 2 && !$set::uop;
            $Ui->{sP} = int($Ui->{sp});
            $Ui->{Sp} = $Ui->{sP} * $Ui->{Qn};
            $Ui->{SP} = $G ? int($Ui->{sP} * $Ui->{qn} * $I->{Ap})
                           : int($Ui->{sP} * $I->{Ap}) * $Ui->{Qn};
            $Ui->{SP}*= $F{$keytext} if !$T;
    
    
            if ($Ui->{rs} && $Ui->{rs} ne $I->{id}) {
                $T == 2 && &M("$Ui->{nm}¤Ï¾¤Î¿Í¤Ëͽ\Ìó¤µ¤ì¤Æ¤¤¤Þ¤¹¡£") && next;
                &say("$Ui->{nm}¤Ï¾¤Î¿Í¤Ëͽ\Ìó¤µ¤ì¤Æ¤¤¤Þ¤¹",$R);
            }
            elsif ($I->{bg} + $Ui->{Wt} > $I->{Mbg}) {
                $T == 2 && &M("¤³¤ì°Ê¾å¤Ï½Å¤¯¤Æ»ý¤Æ¤Þ¤»¤ó¡£") && next;
                &say('¤³¤ì°Ê¾å¤Ï½Å¤¯¤Æ»ý¤Æ¤Þ¤»¤ó',$R);
            }
            elsif ($Ui->{SP} > $I->{gl}) {
                $T == 2 && &M("$Ui->{nm}¤òÇ㤦¤ª¶â¤¬¤¢¤ê¤Þ¤»¤ó¡£") && next;
                &say('¤ª¶â¤¬Â­¤ê¤Þ¤»¤ó',$R);
            }
    
    
            # ¥Ñ¥Ã¥¯ÉԲĥ¢¥¤¥Æ¥à¤Î¾ì¹ç¥Ð¥é¤ÇÄɲà #
            if (&item_class_check($Ui) ne 'M') {
                $Ii = {%$Ui};
                $Ii->{sp} = '';
                $Ii->{rs} = '';
                push (@{$I->{Bg}},$Ii) foreach 1 .. $F{$keytext};
            }
            # ¥Ñ¥Ã¥¯¥¹¥­¥ë¤òͤ¨¤Æ¤Î¥Ñ¥Ã¥¯¤¬µö²Ä¤µ¤ì¤Æ¤¤¤ë¾ì¹ç #
            elsif ($set::mpc{$P}) {
                $Ii = {%$Ui};
                $Ii->{qn} = $Ui->{Qn};
                $Ii->{sp} = '';
                $Ii->{rs} = '';
                push (@{$I->{Bg}},$Ii);
            }
            # ¥Ñ¥Ã¥¯¥¹¥­¥ë¤òͤ¨¤Æ¤Î¥Ñ¥Ã¥¯¤¬µö²Ä¤µ¤ì¤Æ¤¤¤Ê¤¤¾ì¹ç #
            else {
                $Ui->{QN} = $Ui->{Qn};
                $Ui->{qN} = !$T ? $Ui->{qn} : 1; # ¥Õ¥é¥°¤¬¤Ê¤±¤ì¤Ð¥Ñ¥Ã¥¯¤Î¾õÂÖ¤ò¤Ò¤È¤Ä¤È¤·¤Æ¡¢¤½¤¦¤Ç¤Ê¤±¤ì¤Ð¥Ð¥é¤ÇȽÄê
    
                # ¹ØÆþ¸Ä¿ô¤Ö¤ó²Ùʪ¤Ë¼ý¤Þ¤ë¤Þ¤ÇÄɲà #
                while ($Ui->{QN} > 0) {
                    # ¥Ñ¥Ã¥¯¥¹¥­¥ë¤ò¥Á¥§¥Ã¥¯¤·¡¢¤Ç¤­¤ë¤À¤±¥Ñ¥Ã¥¯ #
                    foreach (1 .. $F{$keytext}) {
                        $n = $_;
                        $n-- && last if $Ui->{qN} * $n > $I->{pc};
                    }
                    $n = 1 if $n < 1;
    
                    $Ii = {%$Ui};
                    $Ii->{qn} = $Ui->{qN} * $n;
                    $Ii->{sp} = '';
                    $Ii->{rs} = '';
                    push (@{$I->{Bg}},$Ii);
    
                    $F{$keytext} -= $n;
                    $Ui->{QN} -= $Ii->{qn};
                }
            }
    
            if (@{$I->{Bg}} > $I->{bs}) {
                $T == 2 && &M("²Ùʪ¥¹¥í¥Ã¥È¤¬°ìÇդǤ¹¡£") && next;
                &say("²Ùʪ¥¹¥í¥Ã¥È¤¬°ìÇդǤ¹",$R);
            }
    
    
            $M .= &beat_price($Ui) if $T == 2;
    
            &change_status($U,'gl',$Ui->{Sp});
            &change_status($I,'bg',$Ui->{Wt});
            &change_status($I,'gl',-$Ui->{SP});
            &change_status($U,'bg',-$Ui->{Wt});
    
            $Ui->{qn}-= $Ui->{Qn};
            $Ui->{sp}*= $Ui->{qn} if $T == 2 && !$set::uop;
            $Ui->{Im} = &item_image($Ui);
    
            $M .= "$Ui->{Im}$I->{nm}¤Ï$Ui->{nm}¤ò$Ui->{Qn}¤Ä¡¢$Ui->{Sp} $set::mny¤Ç¹ØÆþ¤·¤Þ¤·¤¿¡£<br>\n";
            &M("$Ui->{Im}$Ui->{nm}¤ò$Ui->{Qn}¤Ä¡¢$Ui->{SP} $set::mny¤Ç¹ØÆþ¤·¤Þ¤·¤¿¡£");
    
            $buyitemflag = 1;
        }
    
        return $buyitemflag ? $M : '';
    }
    
    # Sub Purchase Pet #
    sub purchase_pet {
    my  $V = shift; # item ref
    my  $P = shift; # place
    my  $R = shift; # return mode
    my  $T;
    my  $Q;
    my  $Ii;
    my  $Ui;
    my  $buypetsflag;
    my ($i,$n);
    my ($keychck,$keytext);
    
        $I->{Ap} ||= 1;
    
        $R ||= $I->{Sp}{$P}{md};
    
        $T = $P eq 'Xx' ? 2 :
             $P eq 'Bm' ? 1 : 0;
    
        $Q = $T == 2 || !$set::mif{$P} ? 1 : 0;
    
        foreach $Up (@$V) {
            $i++;
            $keychck = $T == 2 ?   "$i-$Up->{id}-$Up->{sp}" :   "$Up->{id}_$Up->{gd}";
            $keytext = $T == 2 ? "t-$i-$Up->{id}-$Up->{sp}" : "t_$Up->{id}_$Up->{gd}";
            $F{$keytext} = 1 if $Q;
            next if !$F{$keychck} || !$F{$keytext};
            &error('Price Error') if $T == 2 && !$Up->{sp};
            if ($F{dl}) { $Up->{id} = ''; next }
    
            if ($F{$keytext} =~ /\D/) {
                $T == 2 && &M("$Ui->{nm}¡§¿ôÃͰʳ°¤Ï»ÈÍѽÐÍè¤Þ¤»¤ó") && next;
                &say("$Ui->{nm}¡§¿ôÃͰʳ°¤Ï»ÈÍѽÐÍè¤Þ¤»¤ó",$R);
            }
    
            $Up->{Qn} = $F{$keytext};
            $Up->{Sl} = $Up->{sl} * $Up->{Qn};
            $Up->{sp} = $Up->{bp} * $set::mtp + $set::mpp if $T != 2;
            $Up->{Sp} = $Up->{sp} * $Up->{Qn};
            $Up->{SP} = int($Up->{sp} * $I->{Ap}) * $Up->{Qn};
    
            if ($Up->{rs} && $Up->{rs} ne $I->{id}) {
                $T == 2 && &M("$Up->{nm}¤Ï¾¤Î¿Í¤Ëͽ\Ìó¤µ¤ì¤Æ¤¤¤Þ¤¹¡£") && next;
                &say("$Up->{nm}¤Ï¾¤Î¿Í¤Ëͽ\Ìó¤µ¤ì¤Æ¤¤¤Þ¤¹",$R);
            }
            elsif ($I->{px} + $Up->{Sl} > $I->{Mpx}) {
                &M("$Up->{nm}¤Î¤¿¤á¤Î¥¹¥í¥Ã¥È¤¬¶õ¤¤¤Æ¤¤¤Þ¤»¤ó¡£") && next;
                &say("¥¹¥í¥Ã¥È¤Î¶õ¤­¤¬Â­¤ê¤Þ¤»¤ó",$R);
            }
            elsif ($Up->{SP} > $I->{gl}) {
                $T == 2 && &M("$Up->{nm}¤òÇ㤦¤ª¶â¤¬¤¢¤ê¤Þ¤»¤ó¡£") && next;
                &say('¤ª¶â¤¬Â­¤ê¤Þ¤»¤ó',$R);
            }
    
            $M .= &beat_price($Up);
    
            &change_status($U,'gl',$Up->{Sp});
            &change_status($I,'px',$Up->{Sl});
            &change_status($I,'gl',-$Up->{SP});
            &change_status($U,'px',-$Up->{Sl});
    
            $Up->{Im} = &item_image($Up);
    
            $M .= "$Up->{Im}$I->{nm}¤Ï$Up->{nm}¤ò$Up->{Sp} $set::mny¤Ç¹ØÆþ¤·¤Þ¤·¤¿¡£<br>\n";
            &M("$Up->{Im}$Up->{nm}¤ò$Up->{Qn}ɤ¡¢$Up->{SP} $set::mny¤Ç¹ØÆþ¤·¤Þ¤·¤¿¡£");
    
            $Up->{sp} = '';
            $Up->{rs} = '';
            foreach (1 .. $F{$keytext}) {
                if ($T != 2) {
                    $Up->{up} = $Up->{bt} = time;
                    $Up->{pd} = time if $Up->{pd};
                    $Up->{ch} = &roll_dice(4) - 1;
                }
                push (@{$I->{Pt}},{%$Up});
            }
            $Up->{id} = '';
            $buypetsflag = 1;
        }
    
        return $buypetsflag ? $M : '';
    }
    
    # Beat the Price #
    sub beat_price {
    my  $Si = shift;
    
        # ÃÍÀÚ¤ê #
        if ($I->{Sk}{Bp} && &roll_dice(100 + $I->{Map} - $I->{ap}) <= $set::sBp) {
            $Si->{sp} -= int($Si->{sp} * $set::uBp / 100);
            $Si->{Sp} -= int($Si->{Sp} * $set::uBp / 100);
            &M("$U->{nm}¤Ï$Si->{nm}¤ò$set::uBp%°ú¤­¤Î$Si->{Sp} $set::mny¤Ë¤·¤Æ¤¯¤ì¤Þ¤·¤¿¡£");
            return "$Si->{nm}¤ò$set::uBp%°ú¤­¤Ë¤·¤Æ¤¢¤²¤Þ¤·¤¿¡£<br>\n";
        }
        return '';
    }
    
    # --------------------------------------------------- #
    1;
    

    ¾å¤ò purchase.cgi ¤È¤¤¤¦Ì¾Á°¤ÇÊݸ¡£library¤Ë¼ýǼ

    library/base.cgi¤ò³«¤¯
    sub decorate_item:
    my  $T = shift; # Blackmarket = 1, Sales Information = 2
    ¢­
    my  $T = shift; # Blackmarket = 1, Sales Information = 2, Market = 3
    

    ÈÎÇä¾ðÊó¤Ëµ­ºÜ¤µ¤ì¤ë¥¢¥¤¥Æ¥à¥Ç¡¼¥¿¤ò¾Ü¤·¤¯¤òÀè¤Ë¹Ô¤¦É¬Íפ¬¤¢¤ê¤Þ¤¹

    sub decorate_item:
        $Z = $Si->{wt} if $T;
    ¢­
        $Z = $Si->{wt} if $T == 1;
    
    sub decorate_item:
        $V .= " x $W" if $W > 1 && $T != 1;
    ¢­
        $V .= " x $W" if $W > 1 && (!$Y || $T == 2 || $T == 3);
    
    sub decorate_item:
        $V .= "¡¦¡¦¡¦ºß¸Ë $W" if $T == 1;
    ¢­
        $V .= "¡¦¡¦¡¦ºß¸Ë $W" if $Y && $W && ($T == 0 || $T == 1);
    
    library/blackmarket.cgi¤ò³«¤¯
    sub blackmarket_before:
        &say("¤á¤Ü¤·¤¤¾¦ÉʤϤʤ¤¤è¤¦¤Ç¤¹¡¦¡¦¡¦",'market') if !$U->{Bg};
    ¢­
        &say("¤á¤Ü¤·¤¤¾¦ÉʤϤʤ¤¤è¤¦¤Ç¤¹¡¦¡¦¡¦",'market') if !$U->{Bg};
    
        $t1 .= <<"    END_OF_HTML" if $set::mif{Bm};
        <tr class=first>
        <td colspan=2 class=r>¹ØÆþ¸Ä¿ô</td>
        </tr>
        END_OF_HTML
    
    sub blackmarket_before:
            $t1 .= qq|<input type=radio name=ui class=radio value="$Ui->{id}_$Ui->{gd}"> |;
            $t1 .= &decorate_item($Ui,1);
    ¢­
            $t1 .= qq|<tr>\n<td>\n|;
            $t1 .= qq|<input type=checkbox name=$Ui->{id}_$Ui->{gd} class=checkbox> |;
            $t1 .= &decorate_item($Ui,1);
            $t1 .= qq|</td>\n<td class=r>|;
            $t1 .= qq|<input type=textbox name=t_$Ui->{id}_$Ui->{gd} class=textbox size=5 value=1>| if $set::mif{Bm};
            $t1 .= qq|</td>\n</tr>\n|;
    
    sub blackmarket_before:
        $t1 .= qq|<p><input type=checkbox name=dl class=checkbox> Çã¤ï¤º¤Ëºï½ü¤¹¤ë</p>\n| if $I->{Sk}{Rm};
    ¢­
        $t1 .= qq|<tr><td colspan=2><br><input type=checkbox name=dl class=checkbox> Çã¤ï¤º¤Ëºï½ü¤¹¤ë</td></tr>\n| if $I->{Sk}{Rm};
    
    sub blackmarket_before:
        $t1
    ¢­
        <table class=item>
        $t1
        </table>
    
    sub blackmarket_before:
        ¸Ä¿ô¡§<input type=textbox name=hm class=textbox size=2 value="1"><br>
    
    ¤òºï½ü
    
    sub blackmarket_after:
    my  $Ii;
    my  $Ui;
    
        &say("¸Ä¿ô¤Ë¤Ï¿ôÃͰʳ°»ÈÍѤǤ­¤Þ¤»¤ó",'blackmarket_before') if $F{hm} =~ /[^\d]/;
        &say("¸Ä¿ô¤òÀßÄꤷ¤Æ²¼¤µ¤¤",'blackmarket_before') if !$F{hm};
        &say("¾¦Éʤ¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó",'blackmarket_before') if !$F{ui};
    
        $F{hm} = int($F{hm});
    
    ¤òºï½ü
    
    sub blackmarket_after:
        &lock($I->{Pl}{bm});
    
        &get_item($I);
        &get_item($U,1);
    
        foreach $Ui (@{$U->{Bg}}) {
            if ($F{ui} eq "$Ui->{id}_$Ui->{gd}") {
                if ($F{dl}) { $Ui->{qn} = 0; last }
                $F{hm} = $Ui->{qn} if $F{hm} > $Ui->{qn};
                $Ui->{Sp} = int(($Ui->{bp} * $set::mtp + $set::mpp) * $I->{Ap}) * $F{hm};
    
                &say('¤³¤ì°Ê¾å¤Ï½Å¤¯¤Æ»ý¤Æ¤Þ¤»¤ó','blackmarket_before') if $I->{bg} + $Ui->{wt} * $F{hm} > $I->{Mbg};
                &say('¤ª¶â¤¬Â­¤ê¤Þ¤»¤ó','blackmarket_before') if $Ui->{Sp} > $I->{gl};
    
                &change_status($I,'gl',-$Ui->{Sp});
                &change_status($I,'bg',$Ui->{wt} * $F{hm});
    
                $Ui->{Im} = &item_image($Ui);
    
                &M("$Ui->{Im}$Ui->{nm}¤ò$F{hm}¤Ä¹ØÆþ¤·¤Þ¤·¤¿¡£");
    
                $Ii = {%$Ui};
    
                $Ui->{qn}-= $F{hm};
                $Ii->{qn} = $F{hm};
    
                push (@{$I->{Bg}},$Ii);
    
                undef $F{ui};
                last;
            }
        }
    
    #    &say('Çä¤êÀÚ¤ì¤Ç¤¹','blackmarket_before') if !$F{ui};
    
        &sort_item($I);
    
        &set_item($I);
        &set_item($U,1);
    ¢­
        require "$set::lib_dir/purchase.cgi";
    
        &lock($I->{Pl}{bm});
    
        &get_item($I);
        &get_item($U,1);
    
        if (&purchase_item($U->{Bg},'Bm')) {
            &sort_item($I);
            &set_item($I);
            &set_item($U,1);
        }
    
    library/buy.cgi¤ò³«¤¯
    sub buy_before:
            $t1 .= "<input type=checkbox name=$i-$Ui->{id}-$Ui->{sp} class=checkbox> ";
            $t1 .= &decorate_item($Ui);
    ¢­
            $t1 .= qq|<tr>\n<td>\n|;
            $t1 .= qq|<input type=checkbox name=$i-$Ui->{id}-$Ui->{sp} class=checkbox> |;
            if ($set::mif{Xx}) {
                $Ui->{Sp} = $set::uop ? $Ui->{sp} : int($Ui->{sp} / $Ui->{qn});
                $t1 .= &decorate_item($Ui,1);
                $t1 .= qq|</td>\n<td class=r>|;
                $t1 .= qq|<input type=textbox name=t-$i-$Ui->{id}-$Ui->{sp} class=textbox size=5 value=1>|;
            }
            else {
                $Ui->{Sp} = $set::uop ? $Ui->{sp} * $Ui->{qn} : $Ui->{sp};
                $t1 .= &decorate_item($Ui,3);
            }
            $t1 .= qq|</td>\n</tr>\n|;
    
    sub buy_before:
            $t2 .= "<input type=checkbox name=$i-$Up->{id}-$Up->{sp} class=checkbox> ";
            $t2 .= &decorate_item($Up);
    ¢­
            $t2 .= qq|<tr>\n<td>\n|;
            $t2 .= qq|<input type=checkbox name=$i-$Up->{id}-$Up->{sp} class=checkbox> |;
            $t2 .= &decorate_item($Up,1);
            $t2 .= qq|</td>\n</tr>\n|;
    
    sub buy_before:
        &get_code;
    ¢­
        $t1 = <<"    END_OF_HTML" if $t1 && $set::mif{Xx};
        <tr class=first>
        <td colspan=2 class=r>¹ØÆþ¸Ä¿ô</td>
        </tr>
        $t1
        END_OF_HTML
    
        &get_code;
    
    sub buy_before:
        $t1
    ¢­
        <table class=item>
        $t1
        </table>
    
    sub buy_before:
        $t2
    ¢­
        <br>
        <table class=item>
        $t2
        </table>
    
    sub buy_after:
    my  $i;
    my ($Ii,$Ui,$Ip,$Up,$V);
    my  $buyitemflag;
    my  $buypetsflag;
    ¢­
    my  $M;
    
    sub buy_after:
        &get_item($I);
        &get_item($U);
    
        &set_code;
    
        foreach $Ui (@{$U->{Bg}}) {
            $i++;
            next if !$F{"$i-$Ui->{id}-$Ui->{sp}"};
            &error('Price Error') if !$Ui->{sp};
            $Ui->{Wt} = $Ui->{wt} * $Ui->{qn};
            $Ui->{Sp} = int($Ui->{sp} * $I->{Ap});
            if (@{$I->{Bg}} >= $I->{bs}) {
                &M("²Ùʪ¥¹¥í¥Ã¥È¤¬°ìÇդǤ¹¡£") && last;
            }
            elsif ($Ui->{rs} && $Ui->{rs} ne $I->{id}) {
                &M("$Ui->{nm}¤Ï¾¤Î¿Í¤Ëͽ\Ìó¤µ¤ì¤Æ¤¤¤Þ¤¹¡£") && next;
            }
            elsif ($I->{bg} + $Ui->{Wt} > $I->{Mbg}) {
                &M("¤³¤ì°Ê¾å¤Ï½Å¤¯¤Æ»ý¤Æ¤Þ¤»¤ó¡£") && next;
            }
            elsif ($Ui->{Sp} > $I->{gl}) {
                &M("$Ui->{nm}¤òÇ㤦¤ª¶â¤¬¤¢¤ê¤Þ¤»¤ó¡£") && next;
            }
    
            $M .= &beat_price($Ui);
    
            &change_status($U,'gl',$Ui->{sp});
            &change_status($I,'bg',$Ui->{Wt});
            &change_status($I,'gl',-$Ui->{Sp});
            &change_status($U,'bg',-$Ui->{Wt});
    
            $Ui->{Im} = &item_image($Ui);
    
            $M .= "$Ui->{Im}$I->{nm}¤Ï$Ui->{nm}¤ò$Ui->{qn}¤Ä¡¢$Ui->{sp} $set::mny¤Ç¹ØÆþ¤·¤Þ¤·¤¿¡£<br>\n";
            &M("$Ui->{Im}$Ui->{nm}¤ò$Ui->{qn}¤Ä¹ØÆþ¤·¤Þ¤·¤¿¡£");
    
            $Ui->{sp} = '';
            $Ui->{rs} = '';
    
            $Ii = {%{$Ui}};
            push (@{$I->{Bg}},$Ii);
            $Ui->{qn} = 0;
            $buyitemflag = 1;
        }
    
        if ($buyitemflag) {
            &sort_item($I);
            &set_item($I);
            &set_item($U) if !$U->{Sk}{Ms}; # Mass Selling
        }
    
        &get_pet($I);
        &get_pet($U);
    
        undef $i;
    
        foreach $Up (@{$U->{Pt}}) {
            $i++;
            next if !$F{"$i-$Up->{id}-$Up->{sp}"};
            &error('Price Error') if !$Up->{sp};
            $Up->{Sp} = int($Up->{sp} * $I->{Ap});
            if ($Up->{rs} && $Up->{rs} ne $I->{id}) {
                &M("$Up->{nm}¤Ï¾¤Î¿Í¤Ëͽ\Ìó¤µ¤ì¤Æ¤¤¤Þ¤¹¡£") && next;
            }
            elsif ($I->{px} + $Up->{sl} > $I->{Mpx}) {
                &M("$Up->{nm}¤Î¤¿¤á¤Î¥¹¥í¥Ã¥È¤¬¶õ¤¤¤Æ¤¤¤Þ¤»¤ó¡£") && next;
            }
            elsif ($Up->{Sp} > $I->{gl}) {
                &M("$Up->{nm}¤òÇ㤦¤ª¶â¤¬¤¢¤ê¤Þ¤»¤ó¡£") && next;
            }
    
            $M .= &beat_price($Up);
    
            &change_status($U,'gl',$Up->{sp});
            &change_status($I,'px',$Up->{sl});
            &change_status($I,'gl',-$Up->{Sp});
            &change_status($U,'px',-$Up->{sl});
    
            $Up->{Im} = &item_image($Up);
    
            $M .= "$Up->{Im}$I->{nm}¤Ï$Up->{nm}¤ò$Up->{sp} $set::mny¤Ç¹ØÆþ¤·¤Þ¤·¤¿¡£<br>\n";
            &M("$Up->{Im}$Up->{nm}¤ò¹ØÆþ¤·¤Þ¤·¤¿¡£");
    
            $Up->{sp} = '';
            $Up->{rs} = '';
    
            $Ip = {%{$Up}};
            push (@{$I->{Pt}},$Ip);
            $Up->{id} = '';
            $buypetsflag = 1;
        }
    
        if ($buypetsflag) {
            &sort_pet($I);
            &set_pet($I);
            &set_pet($U);
        }
    ¢­
        &set_code;
    
        require "$set::lib_dir/purchase.cgi";
    
        &get_item($I);
        &get_item($U);
    
        if ($M .= &purchase_item($U->{Bg},'Xx')) {
            &sort_item($I);
            &set_item($I);
            &set_item($U) if !$U->{Sk}{Ms}; # Mass Selling
        }
    
        &get_pet($I);
        &get_pet($U);
    
        if ($M .= &purchase_pet($U->{Pt},'Xx')) {
            &sort_pet($I);
            &set_pet($I);
            &set_pet($U);
        }
    
    # Beat the Price #
    sub beat_price {
    my  $Si = shift;
    
        # ÃÍÀÚ¤ê #
        if ($I->{Sk}{Bp} && &roll_dice(100 + $I->{Map} - $I->{ap}) <= $set::sBp) {
            $Si->{sp} -= int($Si->{sp} * $set::uBp / 100);
            $Si->{Sp} -= int($Si->{Sp} * $set::uBp / 100);
            &M("$U->{nm}¤Ï$Si->{nm}¤ò$set::uBp%°ú¤­¤Î$Si->{Sp} $set::mny¤Ë¤·¤Æ¤¯¤ì¤Þ¤·¤¿¡£");
            return "$Si->{nm}¤ò$set::uBp%°ú¤­¤Ë¤·¤Æ¤¢¤²¤Þ¤·¤¿¡£<br>\n";
        }
        return '';
    }
    
    ¤òºï½ü
    

    library/purchase.cgi¤Î¤Û¤¦¤Ë°Üư¤·¤Þ¤·¤¿

    library/farm.cgi¤ò³«¤¯
    sub farm_before:
            $t1 .= qq|<input type=checkbox name=$Ui->{id} class=checkbox> |;
            $t1 .= &decorate_item($Ui);
    ¢­
            $t1 .= qq|<tr>\n<td>\n|;
            $t1 .= qq|<input type=checkbox name=$Ui->{id}_$Ui->{gd} class=checkbox> |;
            $t1 .= &decorate_item($Ui,3);
            if ($set::mif{Fm}) {
                $t1 .= qq|</td>\n<td class=r>|;
                $t1 .= qq|x <input type=textbox name=t_$Ui->{id}_$Ui->{gd} class=textbox size=5 value=1>|;
            }
            $t1 .= qq|</td>\n</tr>\n|;
    
    sub farm_before:
        require "$set::itm_dir/$I->{Pl}{ls}";
    ¢­
        $t1 = $t1 && $set::mif{Fm} ? qq|<td class=r>¹ØÆþ¸Ä¿ô</td>\n</tr>\n$t1| : qq|</tr>\n$t1|;
    
        $t1 = <<"    END_OF_HTML";
        <tr class=first>
        <td>ÇÀ¾ì¤ÇÈÎÇ䤷¤Æ¤¤¤ë¥¢¥¤¥Æ¥à</td>
        $t1
        END_OF_HTML
    
        require "$set::itm_dir/$I->{Pl}{ls}";
    
    sub farm_before:
            $t2 .= qq|<input type=checkbox name=$Up->{id} class=checkbox> |;
            $t2 .= &decorate_item($Up);
    ¢­
            $t2 .= qq|<tr>\n<td>\n|;
            $t2 .= qq|<input type=checkbox name=$Up->{id}_$Ui->{gd} class=checkbox> |;
            $t2 .= &decorate_item($Up,3);
            if ($set::mif{Fm}) {
                $t2 .= qq|</td>\n<td class=r>|;
                $t2 .= qq|x <input type=textbox name=t_$Up->{id}_$Up->{gd} class=textbox size=5 value=1>|;
            }
            $t2 .= qq|</td>\n</tr>\n|;
    
    sub farm_before:
        &get_code;
    ¢­
        $t2 = $t2 && $set::mif{Fm} ? qq|<td class=r>¹ØÆþƬ¿ô</td>\n</tr>\n$t2| : qq|</tr>\n$t2|;
    
        $t2 = <<"    END_OF_HTML";
        <tr class=first>
        <td>ÇÀ¾ì¤ÇÈÎÇ䤷¤Æ¤¤¤ëưʪ</td>
        $t2
        END_OF_HTML
    
        &get_code;
    
    sub farm_before:
        <tt>ÇÀ¾ì¤ÇÈÎÇ䤷¤Æ¤¤¤ë¥¢¥¤¥Æ¥à</tt><br>
        $t1
    ¢­
        <table class=item>
        $t1
        </table>
    
    sub farm_before:
        <tt>ÇÀ¾ì¤ÇÈÎÇ䤷¤Æ¤¤¤ëưʪ</tt><br>
        $t2
    ¢­
        <table class=item>
        $t2
        </table>
    
    sub farm_after:
    my  $Ii;
    my  $Ui;
    my  $Up;
    my  $buyitemflag;
    my  $buypetsflag;
    
    ¤òºï½ü
    
    sub farm_after:
        &get_item($I);
    
        require "$set::itm_dir/$I->{Pl}{fm}";
    
        foreach $Ui (@FI) {
            next if !$F{$Ui->{id}};
            $Ui->{Sp} = int($Ui->{bp} * $set::mtp + $set::mpp) * $Ui->{qn};
    
            &say('¤³¤ì°Ê¾å¤Ï½Å¤¯¤Æ»ý¤Æ¤Þ¤»¤ó','farm_before') if $I->{bg} + $Ui->{wt} * $Ui->{qn} > $I->{Mbg};
            &say('¤ª¶â¤¬Â­¤ê¤Þ¤»¤ó','farm_before') if $Ui->{Sp} > $I->{gl};
            &say("²Ùʪ¥¹¥í¥Ã¥È¤¬°ìÇդǤ¹",'farm_before') if @{$I->{Bg}} >= $I->{bs};
    
            &change_status($I,'gl',-$Ui->{Sp});
            &change_status($I,'bg',$Ui->{wt} * $Ui->{qn});
    
            $Ui->{Im} = &item_image($Ui);
    
            &M("$Ui->{Im}$Ui->{nm}¤ò$Ui->{qn}¤Ä¹ØÆþ¤·¤Þ¤·¤¿¡£");
    
            push (@{$I->{Bg}},$Ui);
            $buyitemflag = 1;
        }
    
        if ($buyitemflag) {
            &sort_item($I);
            &set_item($I);
        }
    
        &get_pet($I);
        require "$set::itm_dir/$I->{Pl}{ls}";
    
        foreach $Up (@FI) {
            next if !$F{$Up->{id}};
            $Up->{Sp} = int($Up->{bp} * $set::mtp + $set::mpp);
    
            &say('¥¹¥í¥Ã¥È¤¬¶õ¤¤¤Æ¤¤¤Þ¤»¤ó','farm_before') if $I->{px} + $Up->{sl} > $I->{Mpx};
            &say('¤ª¶â¤¬Â­¤ê¤Þ¤»¤ó','farm_before') if $Up->{Sp} > $I->{gl};
    
            &change_status($I,'gl',-$Up->{Sp});
            &change_status($I,'px',$Up->{sl});
    
            $Up->{Im} = &item_image($Up);
    
            &M("$Up->{Im}$Up->{nm}¤ò¹ØÆþ¤·¤Þ¤·¤¿¡£");
    
            $Up->{up} = $Up->{bt} = time;
            $Up->{pd} = time if $Up->{pd};
            $Up->{ch} = &roll_dice(4) - 1;
            push (@{$I->{Pt}},$Up);
            $buypetsflag = 1;
        }
    
        if ($buypetsflag) {
            &sort_pet($I);
            &set_pet($I);
        }
    ¢­
        require "$set::lib_dir/purchase.cgi";
    
        &get_item($I);
    
        require "$set::itm_dir/$I->{Pl}{fm}";
        if (&purchase_item(\@FI,'Fm')) {
            &sort_item($I);
            &set_item($I);
        }
    
        &get_pet($I);
    
        require "$set::itm_dir/$I->{Pl}{ls}";
        if (&purchase_pet(\@FI,'Fm')) {
            &sort_pet($I);
            &set_pet($I);
        }
    
    library/shopping.cgi¤ò³«¤¯
    sub shopping_before:
            $t1 .= qq|<input type=radio name=ui class=radio value="$Ui->{id}"> |;
            $t1 .= &decorate_item($Ui);
    ¢­
            $t1 .= qq|<tr>\n<td>\n|;
            $t1 .= qq|<input type=checkbox name=$Ui->{id}_$Ui->{gd} class=checkbox> |;
            $t1 .= &decorate_item($Ui,3);
            if ($set::mif{Mk}) {
                $t1 .= qq|</td>\n<td class=r>|;
                $t1 .= qq|x <input type=textbox name=t_$Ui->{id}_$Ui->{gd} class=textbox size=5 value=1>|;
            }
            $t1 .= qq|</td>\n</tr>\n|;
    
    sub shopping_before:
        &get_code;
    ¢­
        $t1 = <<"    END_OF_HTML" if $t1 && $set::mif{Bm};
        <tr class=first>
        <td colspan=2 class=r>¹ØÆþ¸Ä¿ô</td>
        </tr>
        $t1
        END_OF_HTML
    
        &get_code;
    
    sub shopping_before:
        $t1
    ¢­
        <table class=item>
        $t1
        </table>
    
    sub shopping_before:
        ¸Ä¿ô¡§<input type=textbox name=hm class=textbox size=2 value="1"><br>
    
    ¤òºï½ü
    
    sub shopping_after:
    my  $Ii;
    my  $Ui;
    
        &say("¸Ä¿ô¤Ë¤Ï¿ôÃͰʳ°»ÈÍѤǤ­¤Þ¤»¤ó",'shopping_before') if $F{hm} =~ /[^\d]/;
        &say("¸Ä¿ô¤òÀßÄꤷ¤Æ²¼¤µ¤¤",'shopping_before') if !$F{hm};
        &say("¾¦Éʤ¬ÁªÂò¤µ¤ì¤Æ¤¤¤Þ¤»¤ó",'shopping_before') if !$F{ui};
    
        $F{hm} = int($F{hm});
    
    ¤òºï½ü
    
    sub shopping_after:
        require "$set::itm_dir/$I->{Pl}{mk}";
    
        foreach $Ui (@FI) {
            if ($F{ui} eq $Ui->{id}) {
                $Ui->{Sp} = int(($Ui->{bp} * $set::mtp + $set::mpp) * $I->{Ap}) * $F{hm};
    
                &say('¤³¤ì°Ê¾å¤Ï½Å¤¯¤Æ»ý¤Æ¤Þ¤»¤ó','shopping_before') if $I->{bg} + $Ui->{wt} * $F{hm} > $I->{Mbg};
                &say('¤ª¶â¤¬Â­¤ê¤Þ¤»¤ó','shopping_before') if $Ui->{Sp} > $I->{gl};
    
                &change_status($I,'gl',-$Ui->{Sp});
                &change_status($I,'bg',$Ui->{wt} * $F{hm});
    
                $Ui->{Im} = &item_image($Ui);
    
                &M("$Ui->{Im}$Ui->{nm}¤ò$F{hm}¤Ä¹ØÆþ¤·¤Þ¤·¤¿¡£");
    
                &get_quality($Ui);
    
                # ¥Ð¥é¤ÇÄɲÃ
                if ($Ui->{cl} ne 'Fd' && $Ui->{cl} ne 'Mt') {
                    $Ui->{qn} = 1;
                    for (1..$F{hm}) { push(@{$I->{Bg}},$Ui) }
                }
                # ¥Ñ¥Ã¥¯¤ÇÄɲÃ
                else {
                    $Ui->{qn} = $F{hm};
                    push(@{$I->{Bg}},$Ui);
                }
                &say("²Ùʪ¥¹¥í¥Ã¥È¤¬°ìÇդǤ¹",'shopping_before') if @{$I->{Bg}} > $I->{bs};
                last;
            }
        }
    
        &sort_item($I);
    
        &set_item($I);
    ¢­
        require "$set::lib_dir/purchase.cgi";
    
        require "$set::itm_dir/$I->{Pl}{mk}";
        if (&purchase_item(\@FI,'Mk','shopping_before')) {
            &sort_item($I);
            &set_item($I);
        }
    
    library/bag.cgi¤ò³«¤¯
            $t1 .= &decorate_item($Ii);
    ¢­
            if ($set::mif{Xx}) {
                $Ii->{Sp} = $set::uop ? $Ii->{sp} : int($Ii->{sp} / $Ii->{qn});
                $t1 .= &decorate_item($Ii);
            }
            else {
                $Ii->{Sp} = $set::uop ? $Ii->{sp} * $Ii->{qn} : $Ii->{sp};
                $t1 .= &decorate_item($Ii,3);
            }
    
    library/playerlist.cgi¤ò³«¤¯
    sub playerlist:
                $t2 .= "x$Ui->{qn}" if $Ui->{qn} > 1;
                push(@T,"$t2=$Ui->{sp}$set::mny");
    ¢­
                $t2  = "[$t2=$Ui->{sp}$set::mny]" if $set::mif{Xx};
                $t2 .= "x$Ui->{qn}" if $Ui->{qn} > 1;
                $t2 .= "=$Ui->{sp}$set::mny" if !$set::mif{Xx};
                push(@T,$t2);
    
    sub sales_information:
                $Ui->{nm} = &decorate_item($Ui,2);
    ¢­
                $Ui->{qn} ||= 1;
                $Ui->{Sp} = $set::mif{Xx} && !$set::uop ? int($Ui->{sp} / $Ui->{qn}) :
                            !$set::mif{Xx} && $set::uop ? $Ui->{sp} * $Ui->{qn} : $Ui->{sp};
                $Ui->{nm} = &decorate_item($Ui,2);
    
    library/price.cgi¤ò³«¤¯
    sub price_before:
    my ($t1,$t2);
    ¢­
    my ($t1,$t2,$t3);
    
        $t3 = $set::uop ? '¤Ò¤È¤ÄÅö¤¿¤ê¤Î' : '';
    
    sub price_before:
                $Ii->{qn} = 1 if $F{fl} eq 'pet';
                $Ii->{Sp} = $Ii->{bp} * $Ii->{qn} + $set::lip;
                $t1 .= qq|<input type=textbox name=$i class=textbox size=5 value="$Ii->{Sp}"> |;
                $t1 .= &decorate_item($Ii);
    ¢­
                if ($set::uop) {
                    $Ii->{Sp} = $Ii->{bp} + $set::lip;
                    $t1 .= qq|<input type=textbox name=$i class=textbox size=5 value="$Ii->{Sp}"> |;
                    $t1 .= &decorate_item($Ii,1);
                }
                else {
                    $Ii->{qn} = 1 if $F{fl} eq 'pet';
                    $Ii->{Sp} = $Ii->{bp} * $Ii->{qn} + $set::lip;
                    $t1 .= qq|<input type=textbox name=$i class=textbox size=5 value="$Ii->{Sp}"> |;
                    $t1 .= &decorate_item($Ii,3);
                }
    
    sub price_before:
        <tt>¿ôÃͤòÆþÎϤ·¤ÆÃÍÃʤòÀßÄꤷ¤Æ²¼¤µ¤¤¡£<br>ɽ\¼¨¤µ¤ì¤ëÃÍÃʤϺÇÄãÈÎÇä²Á³Ê</tt><br>
    ¢­
        <tt>¿ôÃͤòÆþÎϤ·¤Æ$t3ÃÍÃʤòÀßÄꤷ¤Æ²¼¤µ¤¤¡£<br>ɽ\¼¨¤µ¤ì¤ëÃÍÃʤϺÇÄãÈÎÇä²Á³Ê</tt><br>
    
    sub price_after:
                next if !$F{$i};
    ¢­
                next if !$F{$i};
                $Ii->{Bp} = $set::uop ? $Ii->{bp} : $Ii->{bp} * $Ii->{qn};
    
    sub price_after:
                elsif ($F{$i} < $Ii->{bp} * $Ii->{qn} + $set::lip) {
    ¢­
                elsif ($F{$i} < $Ii->{Bp} + $set::lip) {
    
    sub.css¤ò³«¤¯
    /* ¥¢¥¤¥Æ¥à */
    .item {
      width: 100%;
    }
    .item .first td {
      padding-bottom: 5px;
      font-size: 11px;
      font-family: monospace;
      color: #005533;
    }
    .item td {
      margin: 0;
      padding: 0;
      font-size: 12px;
    }
    .item td.r {
      vertical-align: bottom;
    }
    
    ¤òÄɲÃ
    

    ¶ä¹Ô¤Ë»ØÄê¸Ä¿ô¼è°ú/¶ä¹Ô¼«Æ°À°Íýµ¡Ç½ÄɲäÇÄɲä·¤¿¤â¤Î¤ÈƱ¤¸¤Ç¤¹

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ÂÐÀïÁê¼ê¤ÎÍúÎò¤Ë¼«Ê¬¤¬ºÜ¤Ã¤Æ¤¤¤Æ¤â»þ´Ö·Ð²á¤·¤Æ¤¤¤ì¤ÐºÆÀï²Äǽ¤Ë¤·¤Æ¤ß¤ë

    set.cgi¤ò³«¤¯
    # ÀïÆ® Fight ######################################### #
    $elt = 24;                   # ÀïÆ®Áê¼ê¤ÎÍúÎò¤Ë¤¢¤Ã¤Æ¤ân»þ´Ö·Ð²á¤·¤Æ¤¤¤ì¤ÐÀïÆ®²Äǽ¤Ë¤¹¤ë(yes=»þ´Ö,no=0)
    
    library/fight.cgi¤ò³«¤¯
    sub fight_player:
        @Den = grep { $_ eq $I->{id} } @Uen;
    ¢­
        @Den = grep { $_->[0] eq $I->{id} &&
                    (!$set::elt || time - $_->[1] < $set::elt * 3600) } map  { [split /:/] } @Uen;
    
    sub fight_player:
        $U->{en} = join(',',$I->{id},@Uen);
    ¢­
        $U->{en} = join(',',"$I->{id}:".time,@Uen);
    

    ¡Ú¥ê¥¹¥È¤ØÌá¤ë¡Û

    ¡Ú¥È¥Ã¥×¤ØÌá¤ë¡Û