| Message |
Okay, what I want to do, is every area reset, the code will go through all the mobs with certain ifchecks, and a random chance. If all is true, it will set an act flag on the mobs. I've nearly done this, except for that if the mob is already in the area, it won't set it. Here's the code, in reset.c, reset_area:
if ( pMobIndex->count >= pReset->arg2 )
{
mob = NULL;
break;
}
mob = create_mobile(pMobIndex);
chance = number_range( 0, 25 );
if ( chance == 24 && !xIS_SET(mob->act, ACT_PACIFIST ) && !xIS_SET(mob->act, ACT_SHARD_NEVER ) &&
!xIS_SET(mob->act, ACT_PROTOTYPE ) )
{
sprintf ( buf, "Loading shard on %s.", mob->name );
to_channel( buf, CHANNEL_SHARDMONITOR, "ShardMonitor", LEVEL_SUB_IMPLEM );
xSET_BIT(mob->act, ACT_HAS_SHARD);
mob->hitroll *= 2;
mob->damroll *= 2;
}
{
ROOM_INDEX_DATA *pRoomPrev = get_room_index(pReset->arg3 - 1);
if ( pRoomPrev && IS_SET(pRoomPrev->room_flags, ROOM_PET_SHOP) )
xSET_BIT(mob->act, ACT_PET);
}
if ( room_is_dark(pRoomIndex) )
xSET_BIT(mob->affected_by, AFF_INFRARED);
Now the flag will be set if the mob isn't in the area, and there's a reset for it, but not if the mob is not in the area. How do I change this, so it will check/set all mobs? |
Zeno McDohl,
Owner of Bleached InuYasha Galaxy
http://www.biyg.org | top |
|