affect_free = paf;
#0 0x080bbf93 in affect_remove_obj (obj=0x6168206b, paf=0x6f6c2073)
obj_update ( );of update_handler function.
void obj_update ( void )
{
OBJ_DATA *obj;
OBJ_DATA *obj_next;
AFFECT_DATA *paf, *paf_next;
for ( obj = object_list; obj != NULL; obj = obj_next )
{
CHAR_DATA *rch;
const char *message;
obj_next = obj->next;
/* go through affects and decrement */
for ( paf = obj->affected; paf != NULL; paf = paf_next )
{
paf_next = paf->next;
if ( paf->duration > 0 )
{
paf->duration–;
if ( number_range ( 0, 4 ) == 0 && paf->level > 0 )
paf->level–; /* spell strength fades with time */
}
else if ( paf->duration < 0 )
;
else
{
if ( paf_next == NULL
|| paf_next->type != paf->type
|| paf_next->duration > 0 )
{
if ( paf->type > 0 &&
skill_table[paf->type].msg_off )
{
act_new ( skill_table[paf->type].msg_off,
obj->carried_by, obj, NULL,
POS_SLEEPING, TO_CHAR );
}
}
affect_remove_obj ( obj, paf );
}
}
if ( obj->timer <= 0 || –obj->timer > 0 )
continue;
if ( obj->in_room || (obj->carried_by && obj->carried_by->in_room))
{
if ( HAS_TRIGGER_OBJ( obj, TRIG_DELAY )
&& obj->oprog_delay > 0 )
{
if ( –obj->oprog_delay <= 0 )
p_percent_trigger( NULL, obj, NULL, NULL, NULL, NULL, TRIG_DELAY );
}
else if ( ((obj->in_room && !obj->in_room->area->empty)
|| obj->carried_by ) && HAS_TRIGGER_OBJ( obj, TRIG_RANDOM ) )
p_percent_trigger( NULL, obj, NULL, NULL, NULL, NULL, TRIG_RANDOM );
}
/* Make sure the object is still there before proceeding */
if ( !obj )
continue;
switch ( obj->item_type )
{
default:
message = "$p crumbles into dust.";
break;
case ITEM_FOUNTAIN:
message = "$p dries up.";
break;
case ITEM_CORPSE_NPC:
message = "$p decays into dust.";
break;
case ITEM_CORPSE_PC:
message = "$p decays into dust.";
break;
case ITEM_FOOD:
message = "$p decomposes.";
break;
case ITEM_POTION:
message = "$p has evaporated from disuse.";
break;
}
if ( obj->carried_by != NULL )
{
if ( IS_NPC ( obj->carried_by )
&& obj->carried_by->pIndexData->pShop != NULL )
obj->carried_by->gold += obj->cost / 5;
else
{
act ( message, obj->carried_by, obj, NULL,
TO_CHAR );
sound ("DECAY.WAV", obj->carried_by );
}
}
else if ( obj->in_room != NULL &&
( rch = obj->in_room->people ) != NULL )
{
if ( !
( obj->in_obj &&
obj->in_obj->pIndexData->vnum == OBJ_VNUM_PIT &&
!CAN_WEAR ( obj->in_obj, ITEM_TAKE ) ) )
{
act ( message, rch, obj, NULL, TO_ROOM );
act ( message, rch, obj, NULL, TO_CHAR );
sound ("DECAY.WAV", rch);
}
}
if ( obj->item_type == ITEM_CORPSE_PC && obj->contains )
{ /* save the contents */
OBJ_DATA *t_obj, *next_obj;
for ( t_obj = obj->contains; t_obj != NULL;
t_obj = next_obj )
{
next_obj = t_obj->next_content;
obj_from_obj ( t_obj );
if ( obj->in_obj ) /* in another object */
obj_to_obj ( t_obj, obj->in_obj );
else if ( obj->carried_by ) /* carried */
if (obj->wear_loc == WEAR_FLOAT)
{
if (obj->carried_by->in_room == NULL)
extract_obj(t_obj);
else
obj_to_room(t_obj,obj->carried_by->in_room);
}
else
obj_to_char ( t_obj, obj->carried_by );
else if ( obj->in_room == NULL ) /* destroy it */
extract_obj ( t_obj );
else /* to a room */
obj_to_room ( t_obj, obj->in_room );
}
}
extract_obj ( obj );
}
return;
}
affect_free = paf;
#0 0x080bbf93 in affect_remove_obj (obj=0x6168206b, paf=0x6f6c2073)