자기 아파트 방설명은 자기가 #2
2007.04.12 13:04
/*==================================================================*/
/* 디스크립션 */
/*==================================================================*/
int discrip(ply_ptr, cmnd)
creature *ply_ptr;
cmd *cmnd;
{
int len, len2, i =0;
int fd;
room *rom_ptr;
char *buf, *desc, nnl = 0, ds = 0;
int index, num;
rom_ptr = ply_ptr->parent_rom;
fd = ply_ptr->fd;
num = ply_ptr->daily[DL_MARRI].max;
if(num == 0 ) {
print(fd, "당신은 그런 권한이 없습니다.");
return(0);
}
if(!F_ISSET(ply_ptr-> parent_rom, RONMAR)) {
print(fd, "당신의 집에서만 가능합니다.");
return(0);
}
i=0;
len=index=cut_command(cmnd->fullstr);
if (i >= len){
print(fd,"syntax: *append [-sn] \n"); return(0);
}
if (cmnd->fullstr[i] == '-'){
if (strlen(&cmnd->fullstr[i]) < 4){
print(fd,"syntax: *append [-sn] \n"); return(0);
}
i++;
if (cmnd->fullstr[i] == 's'){
ds =1;
if (cmnd->fullstr[i+1] == 'n')
nnl = 1;
}
else if (cmnd->fullstr[i] == 'n'){
nnl = 1;
if (cmnd->fullstr[i+1] == 's')
ds =1;
}
while(i < len){
if (nnl && cmnd->fullstr[i] == ' ')
break;
if (cmnd->fullstr[i] == ' ' && cmnd->fullstr[i+1] != ' ')
break;
i++;
}
i++;
if (i >= len){
print(fd,"syntax: *append [-sn] \n"); return(0);
}
}
if (ds){
desc = rom_ptr->short_desc;
if (!rom_ptr->short_desc)
nnl = 1;
}
else{
desc = rom_ptr->long_desc;
if (!rom_ptr->long_desc)
nnl = 1;
}
len = (&cmnd->fullstr[i]) ? strlen(&cmnd->fullstr[i]) : 0;
len2 =(desc) ? strlen(desc) : 0;
if (nnl) {
buf = (char *)malloc(len2 + len+1);
memcpy(buf,desc,len2);
memcpy(&buf[len2],&cmnd->fullstr[i],len);
buf[len+len2] = 0;
}
else {
buf = (char *)malloc(len2 + len+2);
memcpy(buf,desc,len2);
buf[len2] = '\n';
memcpy(&buf[len2+1],&cmnd->fullstr[i],len); buf[len+len2+1] = 0;
}
free(desc);
if (ds)
rom_ptr->short_desc = buf;
else
rom_ptr->long_desc = buf;
cmnd->fullstr[index]=' ';
return(0);
}
홈지기 "그륨"
/* 디스크립션 */
/*==================================================================*/
int discrip(ply_ptr, cmnd)
creature *ply_ptr;
cmd *cmnd;
{
int len, len2, i =0;
int fd;
room *rom_ptr;
char *buf, *desc, nnl = 0, ds = 0;
int index, num;
rom_ptr = ply_ptr->parent_rom;
fd = ply_ptr->fd;
num = ply_ptr->daily[DL_MARRI].max;
if(num == 0 ) {
print(fd, "당신은 그런 권한이 없습니다.");
return(0);
}
if(!F_ISSET(ply_ptr-> parent_rom, RONMAR)) {
print(fd, "당신의 집에서만 가능합니다.");
return(0);
}
i=0;
len=index=cut_command(cmnd->fullstr);
if (i >= len){
print(fd,"syntax: *append [-sn] \n"); return(0);
}
if (cmnd->fullstr[i] == '-'){
if (strlen(&cmnd->fullstr[i]) < 4){
print(fd,"syntax: *append [-sn] \n"); return(0);
}
i++;
if (cmnd->fullstr[i] == 's'){
ds =1;
if (cmnd->fullstr[i+1] == 'n')
nnl = 1;
}
else if (cmnd->fullstr[i] == 'n'){
nnl = 1;
if (cmnd->fullstr[i+1] == 's')
ds =1;
}
while(i < len){
if (nnl && cmnd->fullstr[i] == ' ')
break;
if (cmnd->fullstr[i] == ' ' && cmnd->fullstr[i+1] != ' ')
break;
i++;
}
i++;
if (i >= len){
print(fd,"syntax: *append [-sn] \n"); return(0);
}
}
if (ds){
desc = rom_ptr->short_desc;
if (!rom_ptr->short_desc)
nnl = 1;
}
else{
desc = rom_ptr->long_desc;
if (!rom_ptr->long_desc)
nnl = 1;
}
len = (&cmnd->fullstr[i]) ? strlen(&cmnd->fullstr[i]) : 0;
len2 =(desc) ? strlen(desc) : 0;
if (nnl) {
buf = (char *)malloc(len2 + len+1);
memcpy(buf,desc,len2);
memcpy(&buf[len2],&cmnd->fullstr[i],len);
buf[len+len2] = 0;
}
else {
buf = (char *)malloc(len2 + len+2);
memcpy(buf,desc,len2);
buf[len2] = '\n';
memcpy(&buf[len2+1],&cmnd->fullstr[i],len); buf[len+len2+1] = 0;
}
free(desc);
if (ds)
rom_ptr->short_desc = buf;
else
rom_ptr->long_desc = buf;
cmnd->fullstr[index]=' ';
return(0);
}
홈지기 "그륨"
댓글 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 |