So a scavenger mob picks up items off the ground, as it is now the code determins the best item then places it in the mobs inventory. This actually causes issues because it bypasses any triggers that are on the item. So Id rather it actually force the mob to use the in game command "GET" rather then auto placing the object into its inventory.
Im just having issues of actually getting it to use the in game command "GET". Here is the unmodified script as is.
Any advice anyone?
Code:
/* Scavenger (picking up objects) */
if ( MOB_FLAGGED ( ch, MOB_SCAVENGER ) )
if ( IN_ROOM ( ch )->contents && !number ( 0, 10 ) )
{
max = 1;
best_obj = NULL;
for ( obj = IN_ROOM ( ch )->contents; obj;
obj = obj->next_content )
if ( CAN_GET_OBJ ( ch, obj ) && GET_OBJ_COST ( obj ) > max && ( ! ( IS_OBJ_STAT ( obj, ITEM_PC_CORPSE ) ) ) )
{
best_obj = obj;
max = GET_OBJ_COST ( obj );
}
if ( best_obj != NULL )
{
obj_from_room ( best_obj );
obj_to_char ( best_obj, ch );
act ( "$n picks up $p.", FALSE, ch, best_obj, 0, TO_ROOM );
total_actions++;
}
}