자동 이벤트
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
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
37 | 개량형 우체국 | 그리움 | 2007.04.12 | 230 |
36 | 기술추가 | 그리움 | 2007.04.12 | 246 |
35 | 안시 문자열로 인한 공백 #2 | 그리움 | 2007.04.12 | 242 |
34 | 지도 기능 | 그리움 | 2007.04.12 | 219 |
33 | 안시 사용하기 | 그리움 | 2007.04.12 | 209 |
32 | 분신을 만드는 기술 | 그리움 | 2007.04.12 | 221 |
31 | 방설명 안시 넣기 | 그리움 | 2007.04.12 | 212 |
30 | 패거리 전쟁 승패 기록 | 그리움 | 2007.04.12 | 210 |
29 | 접속화면을 멋있게 | 그리움 | 2007.04.12 | 197 |
28 | 패거리 직위 내리기 | 그리움 | 2007.04.12 | 200 |
27 | 이도류 | 그리움 | 2007.04.12 | 237 |
26 | 안시 문자열로 인한 공백 | 그리움 | 2007.04.12 | 230 |
25 | 자동으로 돈줍기 #2 | 그리움 | 2007.04.12 | 237 |
» | 자동 이벤트 | 그리움 | 2007.04.12 | 242 |
23 | 낮과 밤이 되면 어둡고 환하게 | 그리움 | 2007.04.12 | 241 |
22 | 직업 추가하기 #2 | 그리움 | 2007.04.12 | 233 |
21 | 경매는 이렇게 | 그리움 | 2007.04.12 | 250 |
20 | 패거리전쟁중 "휴전" | 그리움 | 2007.04.12 | 257 |
19 | 도배방지 | 그리움 | 2007.04.12 | 266 |
18 | 직업 추가하기 | 그리움 | 2007.04.12 | 254 |