귀환장소 변경소스 #2

2007.04.12 11:41

그리움 조회 수:198 추천:61

***********[ 귀환장소 설정 ]***********

  * 형식

    - "제3의눈"이라는 머드에서 쓰는 형식인데.. 귀환장소로 정하고

      싶은 장소에서 "귀환장소 설정"라고 치면 back 라는 변수에 방

      번호가 저장이 되고, 귀환 할때마다 그 방번호를 불러서 사용.

* mstruct.h 수정

   typedef struct creature {
                  char name[80];
                  char description[80];

                  char talk[80];
                  char password[15];
                  char key[3][20];
                  short fd;
                  unsigned char level;
                  short back; /* 추가(방번호) */
                  char type;
                                      .
                                      .
                                      .
                                      .

* command1.c 수정

   - return_square() 함수 부분 수정
                      .
                      .
   if(rom_ply->rom_num==15) { /* 삭제 */
     print(fd," 당신은 이미 쉼터에 와 있습니다.."); /* 삭제 */
     return 0; /* 삭제 */
   } /* 삭제 */
                      .
                      .
                      .
   if(!F_ISSET(ply_ptr->PFRTUN)) load_rom(7,&rom_ply); /* 이줄 삭제 */
   else load_rom(15 + ply_ptr->daily[DL_EXPND].max, &rom_ply); /* 이줄 삭제 */
   load_rom(ply_ptr->back,&rom_ply); /* 추가 */
   add_ply_rom(ply_ptr,rom_ply);


* command5.c 수정

   - flag_list() 함수 부분 수정
    room *rom_ply;
         ... 생략 ...

    print(fd," 패거리귀환 : %s\n", F_ISSET(ply_ptr,PFRTUN)?"설정":"미설정");/*
삭제 */
    load_rom(ply_ptr->back,&rom_ply);
    print(fd," 귀환장소 : %s\n", rom_ply->name); /* 추가 */

         ... 생략 ...

   - set()함수 수정
       ... 생략 ...
    int fd,i;
    room *rom_ply; /*추가*/
    struct {
       ... 생략 ...

     else if(!strcmp(cmnd->str[1],"패거리귀환")) { /* 삭 */
          if(F_ISSET(ply_ptr,PFAMIL)){ /* 제 */
               F_SET(ply_ptr,PFRTUN); /* 부 */
               print(fd,"패거리 존으로 귀환을 합니다.\n"); /* 분 */
          } /* */
          else print(fd,"당신은 패거리에 가입되어 있지 않습니다.\n");/* */
     } /* */
     load_rom(ply_ptr->back,&rom_ply); /*추가*/
     else if(!strcmp(cmnd->str[1],"귀환장소")) { /* 추 */
          ply_ptr->back=ply_ptr->parent_rom->rom_num; /* 가 */
          print(fd,"이제부터 %s 으로 귀환합니다.\n",rom_ply->name);/* 추가 */
     }
                    ...생략...

   * 참고 .

     여기서 패거리귀환을 없앤 이유는 다 아시겠죠?
     그러니깐 패거리방으로 연결되는 길이 꼭 있어야 합니다.
     좀 어지러워도 이해를 ~~ ^^
     그리고 이 방식은 사용자데이터와 몹데이터를 모조리 지워야 함다.
     그럼 ^^~...  




XE Login