자동 이벤트

2007.04.12 11:44

그리움 조회 수:200 추천:60

/**********************************************************************/
/* 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/

홈지기 "그륨"


XE Login