자동 이벤트
2007.04.12 11:44
/**********************************************************************/
/* update_game */
/**********************************************************************/
/* This function handles all the updates that occur while players are */
/* typing. */
void update_game(){
long t;
t = time(0);
if (t == last_update) return;
last_update = t;
if (t - last_user_update >= 20) update_users(t);
if (t - last_random_update >= Random_update_interval) update_random(t);
if (t != last_active_update) update_active(t);
if (t - last_monster_update >= 3000) /* 몹이 떨어지는데 걸리는 시간 추가*/
update_monster(t);
/************************************************************************/
/* update_active */
/************************************************************************/
void update_monster(t)
long t;
{
int rtn, rom_num;
room *new_rom=NULL;
creature *crt_ptr=NULL;
int tmp=0;
last_monster_update = t;
for (tmp; tmp < 10; tmp++) {
do {
rom_num = mrand(8000, 8300); /* 아래의 몹이 8000~8300 방에 생김 */
rtn = load_rom(rom_num, &new_rom);
if (rtn > -1 && F_ISSET(new_rom, RNOTEL)) rtn = -1;
} while(rtn < 0);
if (strlen(new_rom->name) < 2) return;
load_crt(mrand(599, 599), &crt_ptr); /* 599~599 몹이 선택 */
add_crt_rom(crt_ptr, new_rom);
}
broadcast("\n!!!!!%s가 %s에 나타났습니다.!!",crt_ptr->name,new_rom->name);
}
자료 출처 ; http://my.netian.com/~GGOLTO6/
홈지기 "그륨"
/* update_game */
/**********************************************************************/
/* This function handles all the updates that occur while players are */
/* typing. */
void update_game(){
long t;
t = time(0);
if (t == last_update) return;
last_update = t;
if (t - last_user_update >= 20) update_users(t);
if (t - last_random_update >= Random_update_interval) update_random(t);
if (t != last_active_update) update_active(t);
if (t - last_monster_update >= 3000) /* 몹이 떨어지는데 걸리는 시간 추가*/
update_monster(t);
/************************************************************************/
/* update_active */
/************************************************************************/
void update_monster(t)
long t;
{
int rtn, rom_num;
room *new_rom=NULL;
creature *crt_ptr=NULL;
int tmp=0;
last_monster_update = t;
for (tmp; tmp < 10; tmp++) {
do {
rom_num = mrand(8000, 8300); /* 아래의 몹이 8000~8300 방에 생김 */
rtn = load_rom(rom_num, &new_rom);
if (rtn > -1 && F_ISSET(new_rom, RNOTEL)) rtn = -1;
} while(rtn < 0);
if (strlen(new_rom->name) < 2) return;
load_crt(mrand(599, 599), &crt_ptr); /* 599~599 몹이 선택 */
add_crt_rom(crt_ptr, new_rom);
}
broadcast("\n!!!!!%s가 %s에 나타났습니다.!!",crt_ptr->name,new_rom->name);
}
자료 출처 ; http://my.netian.com/~GGOLTO6/
홈지기 "그륨"
댓글 0
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
77 | 패거리 직위 내리기 | 그리움 | 2007.04.12 | 156 |
76 | 패거리 전쟁 승패 기록 | 그리움 | 2007.04.12 | 160 |
75 | Ctrl+Enter 패치하기 | 그리움 | 2007.04.12 | 161 |
74 | 패거리 상점 만들기 | 그리움 | 2007.04.12 | 163 |
73 | 접속화면을 멋있게 | 그리움 | 2007.04.12 | 165 |
72 | 패거리 전쟁시 적과 아군 구분 | 그리움 | 2007.04.12 | 165 |
71 | 방설명 안시 넣기 | 그리움 | 2007.04.12 | 168 |
70 | 게시판 검색 기능 추가하기 | 그리움 | 2007.04.12 | 170 |
69 | 몹과 자신을 "비교" | 그리움 | 2007.04.12 | 171 |
68 | 글자색, 배경색 15색 사용하기 | 그리움 | 2007.04.12 | 173 |
67 | 순위 소스 | 그리움 | 2007.04.12 | 174 |
66 | 안시 사용하기 | 그리움 | 2007.04.12 | 175 |
65 | 개량형 우체국 | 그리움 | 2007.04.12 | 177 |
64 | 지도 기능 | 그리움 | 2007.04.12 | 178 |
63 | 경매 소스 | 그리움 | 2007.04.12 | 180 |
62 | 암호 *****로 보이게 하기 | 그리움 | 2007.04.12 | 181 |
61 | 자기 아파트 방설명은 자기가 #2 | 그리움 | 2007.04.12 | 182 |
60 | 분신을 만드는 기술 | 그리움 | 2007.04.12 | 183 |
59 | 출구 정렬 | 그리움 | 2007.04.12 | 186 |
58 | 명성치 도입 | 그리움 | 2007.04.12 | 187 |