개량형 우체국

2007.04.12 13:04

그리움 조회 수:177 추천:54

int online_deposit (ply_ptr, cmnd)
creature *ply_ptr;
cmd *cmnd;
{
int fd, n;

object *bnk_ptr;
creature *crt_ptr;
int len;
long amt;
   fd = ply_ptr->fd;
   if(!F_ISSET (ply_ptr->parent_rom, RBANKS)) {
   print (ply_ptr->fd, "은행에서만 가능합니다.");
   return (0);
   }
   if(cmnd->num <3) {
   print (fd, "누구에게 얼마를 송금하시려고요?");
   return (0);

   }
   if(load_ply(cmnd->str[1], &crt_ptr) < 0) {
   print(fd,"그런 사용자는 없습니다.\n");
   return (0);
   }
    if(!strcmp (cmnd->str[2], "모두")) {
   amt = ply_ptr->gold;
   if(amt<101000) {
   print(fd,"보낼수 있는 돈의 한계는 10만냥입니다.\n");
   return(0);
   }

   goto input_bank_all;
   }
   len = strlen (cmnd->str[2]);
   if(len > 2 && !strcmp (&cmnd->str[2][len - 2], "냥")) {
   amt = atol (cmnd->str[2]);
   if(amt < 1) {
   print (fd, "돈의 단위는 음수가 될 수 없습니다.");
   return (0);
   }
   if(amt < 100000L) {
   print(fd,"온라인 송금의 최소 값은 10만냥 이상입니다.\n");

   return(0);
   }
   if(ply_ptr->gold < amt) {
   print (fd, "당신은 그만큼의 돈을 가지고 있지 않습니다.");
   return (0);
   }
   input_bank_all:
   n = load_bank (crt_ptr->name, &bnk_ptr);
   if (n < 0) {
   bnk_ptr = (object *) malloc (sizeof (object));
   zero (bnk_ptr, sizeof (object));
   bnk_ptr->shotsmax = 200;
   }
   if((bnk_ptr->value+(amt)) >2100000000 || (bnk_ptr->value+(amt))<0){
   bnk_ptr->value=2100000000L;
   }
   else
   bnk_ptr->value += amt;
   ply_ptr->gold -= amt;
   ply_ptr->gold -= amt/100;
   print(fd, "?온라인송금?");
   print(fd, "당신은 %ld냥을 %M에게 송금했습니다.", amt, crt_ptr);
   print(fd, "\n송금 비용으로 %d냥을 가져갑니다.\n",(amt)/100);
   save_bank(crt_ptr->name, bnk_ptr);
   savegame_nomsg (ply_ptr);
   savegame_nomsg (crt_ptr);
   }
   else
   print(fd, "사용법: 사람 ###[만|억]냥 온라인송금");
   return (0);
}



홈지기 "그륨"
번호 제목 글쓴이 날짜 조회 수
57 도배방지 그리움 2007.04.12 222
56 그룹경험치 소스 그리움 2007.04.12 220
55 패거리전쟁중 "휴전" 그리움 2007.04.12 220
54 직업 추가하기 그리움 2007.04.12 218
53 자동으로 돈줍기 소스 그리움 2007.04.12 213
52 경매는 이렇게 그리움 2007.04.12 213
51 어디 그리움 2007.04.12 211
50 무한에서 안시 넣는 방법 그리움 2007.04.12 210
49 방설명 지우기 그리움 2007.04.12 209
48 특수 아이템 만들기 그리움 2007.04.12 209
47 복권 소스 그리움 2007.04.12 207
46 혼자 말하는 몹 그리움 2007.04.12 206
45 자동 이벤트 그리움 2007.04.12 204
44 낮과 밤이 되면 어둡고 환하게 그리움 2007.04.12 203
43 귀환장소 변경 소스 #1 그리움 2007.04.12 202
42 개량형 우체국 그리움 2007.04.12 202
41 주문추가 소스 그리움 2007.04.12 201
40 출구모양 개량 소스 그리움 2007.04.12 201
39 자동수련 소스 그리움 2007.04.12 201
38 잡담 안시 사용하기 그리움 2007.04.12 200


XE Login