자동 이벤트
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 | 레벨을 32767까지 가능하게 | 그리움 | 2007.04.12 | 200 |
36 | 암호 *****로 보이게 하기 | 그리움 | 2007.04.12 | 181 |
35 | 게시판 검색 기능 추가하기 | 그리움 | 2007.04.12 | 170 |
34 | 출구 정렬 | 그리움 | 2007.04.12 | 186 |
33 | 귀환장소 설정 | 그리움 | 2007.04.12 | 190 |
32 | 패거리 상점 만들기 | 그리움 | 2007.04.12 | 163 |
31 | Ctrl+Enter 패치하기 | 그리움 | 2007.04.12 | 161 |
30 | 글자색, 배경색 15색 사용하기 | 그리움 | 2007.04.12 | 173 |
29 | 경매 소스 | 그리움 | 2007.04.12 | 180 |
28 | 이동력 추가하기 | 그리움 | 2007.04.12 | 188 |
27 | 자기 아파트 방설명은 자기가 #2 | 그리움 | 2007.04.12 | 182 |
26 | 명성치 도입 | 그리움 | 2007.04.12 | 187 |
25 | 개량형 우체국 | 그리움 | 2007.04.12 | 177 |
24 | 순위 소스 | 그리움 | 2007.04.12 | 174 |
23 | 패거리 전쟁시 적과 아군 구분 | 그리움 | 2007.04.12 | 165 |
22 | 몹과 자신을 "비교" | 그리움 | 2007.04.12 | 171 |
21 | 특수 아이템 만들기 | 그리움 | 2007.04.12 | 209 |
20 | 개척 소스 | 그리움 | 2007.04.12 | 302 |
19 | 머드에서 몹 심기 | 그리움 | 2007.04.12 | 287 |
18 | 이동하는 몹 | 그리움 | 2007.04.12 | 283 |