개량형 우체국
2007.04.12 13:04
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);
}
홈지기 "그륨"
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);
}
홈지기 "그륨"
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
17 | 프롬프트 그래프화 | 그리움 | 2007.04.12 | 271 |
16 | 주민등록번호 검사 소스 | 그리움 | 2007.04.12 | 420 |
15 | 프롬프트 그래프화 #2 | 그리움 | 2007.04.12 | 280 |
14 | 귀환장소 수정판 | 그리움 | 2007.04.12 | 263 |
13 | Mordor에 있는 몹 소환 소스 | 그리움 | 2007.04.12 | 277 |
12 | 온라인 리붓 | 그리움 | 2007.04.12 | 287 |
11 | 방전체 공격루틴 #2 | 그리움 | 2007.04.12 | 287 |
10 | 낚시 | 그리움 | 2007.04.12 | 280 |
9 | 운영자명령 "보고" | 그리움 | 2007.04.12 | 280 |
8 | 감옥/퇴소 | 그리움 | 2007.04.12 | 338 |
7 | 연타기능 - 직업별 연타 | 그리움 | 2007.04.12 | 479 |
6 | 연타기능 - 연타수 자동 | 그리움 | 2007.04.12 | 447 |
5 | 게시판 버그 해결 방법. | 그리움 | 2007.04.12 | 470 |
4 | *괴물이름 방폭 버그 수정 | 그리움 | 2007.04.12 | 533 |
3 | 물건, 몹의 번호 찾아내기. | 그리움 | 2007.07.04 | 392 |
2 | 몹 소환하여 소환몹이 대신 싸우게 하기 | 그리움 | 2007.11.23 | 398 |
1 | 무한대전 방 데이터 Convert | 그리움 | 2007.11.23 | 423 |