for ( ch = char_list; ch != NULL; ch = ch->next )
{
if (ch->desc && ch->desc->connected == CON_PLAYING && IS_AWAKE(ch) && ch->in_room && ch->in_room->area == pArea)
{
sprintf(buf, "{%s{x\n\r", msg);
send_to_char(buf, ch);
}
}
for (d = descriptor_list; d; d= d->next)
pArea->age = number_range( 0, 3 );
pRoomIndex = get_room_index( ROOM_VNUM_SCHOOL );
for (d = descriptor_list; d; d= d->next)
pArea->age = number_range( 0, 3 );
pRoomIndex = get_room_index( ROOM_VNUM_SCHOOL );
void area_update( void )
{
AREA_DATA *pArea;
char buf[MAX_STRING_LENGTH];
DESCRIPTOR_DATA *d;
for ( pArea = area_first; pArea != NULL; pArea = pArea->next )
{
if ( ++pArea->age < 3 )
continue;
/*
* Check age and reset.
* Note: Mud School resets every 3 minutes (not 15).
*/
if ( (!pArea->empty && (pArea->nplayer == 0 || pArea->age >= 15))
|| pArea->age >= 31)
{
ROOM_INDEX_DATA *pRoomIndex;
char *msg = NULL;
reset_area( pArea );
sprintf(buf,"%s has just been reset.\n\r",pArea->name);
wiznet(buf,NULL,NULL,WIZ_RESETS,0,0);
/* if (IS_SET(pArea->area_flags, AREA_CHANGED))
{
save_area(pArea);
REMOVE_BIT( pArea->area_flags, AREA_CHANGED );
sprintf(buf, "%s has just been saved.\n\r", pArea->name);
wiznet(buf, NULL, NULL, WIZ_RESETS, 0, 0);
}*/
for (d = descriptor_list; d; d= d->next)
pArea->age = number_range( 0, 3 );
pRoomIndex = get_room_index( ROOM_VNUM_SCHOOL );
if ( pRoomIndex != NULL && pArea == pRoomIndex->area )
pArea->age = 15 - 2;
else if (pArea->nplayer == 0)
pArea->empty = TRUE;
if (!IS_NULLSTR(pArea->repop_msg))
msg = pArea->repop_msg;
else if (!pRoomIndex || pRoomIndex->area != pArea) // no defaults for mud school.
{
switch (number_range(0, 4))
{
default:
msg = "The area repopulates itself.";
break;
case 1:
msg = "You notice a change in the area.";
break;
case 2:
msg =
"Time completes another cycle bringing life to the area.";
break;
case 3:
msg =
"You feel a sudden deja-vu bringing change to the area.";
break;
case 4:
msg = "You hear noises off in the distance…";
break;
}
}
if (!IS_NULLSTR(msg))
{
CHAR_DATA *ch;
for ( ch = char_list; ch != NULL; ch = ch->next )
{
if (ch->desc && ch->desc->connected == CON_PLAYING &&
IS_AWAKE(ch) && ch->in_room
&& ch->in_room->area == pArea)
sprintf(buf, "{`%s{x\n\r", msg);
send_to_char(buf, ch);
}
}
}
}
return;
}