}
}
if(obj) destruct(obj);
msg += \───────────────────────────────────msg += \序号] [ 商 品 名 称 ] [ 现货卖出单价 ] msg += \━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━msg += \注:请用 \物品ID>\来购买物品。目前\
\提供销售 \个种类的商品。[定义 \buy_of_bank 1\为
───────────────────────\\n\[ 库 存 量 ] [ 基准收购单价 ]\\n\━━━━━━━━━━━━━━━━━━━━━━━\\n\
钱庄转账购买方式]\\n\
if(this_object()->is_add_pawn_num()>0)
pawn_desc=\↑\
msg += sprintf(\最大收购种类为:%d个%s。最大储藏单个物品数量为:%d。估价后低
query(\
于%s之物品不予收购。\\n\
me->start_more(msg); if(flag>0)
log_time(), environment(), base_name(this_object()), lgfile));
log_file(\→ %s\\n\
return 1;
int do_buy(string arg) {
if( !arg )
return notify_fail(\你要买什么东西?\\n\if(!sizeof(pawned_objects))
return notify_fail(query(\里现在没有待出售的货物。\\n\if(me->is_busy()) return notify_fail(BUSY_MESSAGE); me=this_player();
int i, n, value, pay, balance; object ob, me, boss;
string *items, unit, boss_name, file, log_file; int p=0;
16
if(file->query(\
value = file->query(\if(value)
value = file->query(\
if( i >= to_int(sizeof(pawned_objects)))
return notify_fail(\你要买什么东西?\\n\for(i=0;i if(items[i]->id(arg)) { } return notify_fail(\没有这样东西。\\n\ file=items[i]; p++; break; items = keys(pawned_objects); n = to_int(sizeof(items)); if(n<1) return notify_fail(\这里目前没有任何东西出售。\\n\balance=(int)me->query(\boss_name=boss->query(\ //////////////////////////////////////////////////////// if(!me->query(\ } // Added by waiwai@2012/02/22 boss=have_hock_boss(this_object()); if(!boss) return 1; // 禁止冒充BOSS if(boss->query(\ } write(query(\当前法定持牌人不在,无法进行交易。\\n\return 1; if(money_all_inv(me)<1) { } write(\你身上没有半文铜板,啥也买不了。\\n\return 1; //////////////////////////////////////////////////////// if(p<1) } else 17 value = file->query(\ if(!value) value = value+1000; value = (value+1)*10; if( value value = value*to_sell_rate; if(wiz_level(me)>Wiz_L && me->query(\ value=1; // Added by waiwai@2012/02/22 if(me->query(\ } if(!me->is_busy()) me->start_busy(1); ob = new(file); if(!objectp(ob)) { } return 1; write(ERR_FILE_ZERO); log_time(), environment(), base_name(this_object()), file)); if(balance if(money_all_inv(me)<1) { } if(money_all_inv(me) write(sprintf(\说道:很抱歉,买%s需要花费%s,您身上仅有 boss_name, file->name(), money_num(value) )); write(\你身上没有半文钱,无法购买任何东西。\\n\return 1; write(\购买\需要\,你相记钱庄存款仅有return 1; \。\\n\ } else { \。\\n\ return 1; log_file(\→ %s\\n\ 18 if(file->query_amount() && file->query_amount()>1) { } if( --pawned_objects[items[i]] <= 0) map_delete(pawned_objects, file); message(\┋HOCKSHOP_QC┋Buy:ROOM(%s),%s\\n\\n\ base_name(this_object()), file), users()); write(\系统禁止性错误,\禁止购买。\\n\if(ob) destruct(ob); return 1; save(); ob ->set(\ ob ->set(\ unit=ob->query(\if(!me->query(\ message_vision(sprintf(\从%s买下一%s%s,花费:%s。\\n\ query(\ else write(sprintf(\你从%s买下一%s%s,花费:%s。\\n\ query(\ if(!ob->move(me,1)) { } if(me->query(\ me->add(\me->save(); write(sprintf(\你相记钱庄存款减少了%s[%s → %s]。\\n\ money_num(value), money_num(balance), write(boss_name+\说道:你拿不了\了,就给你先放这里地ob->move(this_object(),1); 上吧。\\n\ money_num((int)me->query(\ } else { } log_file=LOG_DIR\if(file_size(log_file)==-1) me->pay_money(value); me->save(); 19 } assure_file(log_file); log_file( \ sprintf(\在%s买下%d%s%s[%s.c],花费:%s。\\n\ log_time(), log_id(me), filter_color(this_object()->query(\ob->query_amount()?ob->query_amount():1, ob->query_amount()?ob->query(\filter_color(log_id(ob)), base_name(ob), money_num(value) ) ); return 1; string money_num(int amount) { } string Chinese_time(string get_time) { return output; } if (amount) if (output != \ return output + amount + \文铜板\return amount + \文铜板\else amount %= 100; if (amount / 10000) { if (amount / 100) { if (output != \ output += amount / 100 + \两白银\output = amount / 100 + \两白银\else output = amount / 10000 + \两黄金\amount %= 10000; if (amount < 1) return 0; string output; } else output = \ 20

