자동 이벤트
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
번호 | 제목 | 글쓴이 | 날짜 | 조회 수 |
---|---|---|---|---|
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 |
» | 자동 이벤트 | 그리움 | 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 |