opurge

opurge <vnum>

Remove objects the owner holds that match a vnum.

Every object with the given vnum directly held by the owner is extracted from the world. "Held by the owner" means a mob's inventory, the contents of an object owner, or the contents of a room owner. Objects elsewhere are not touched.

Arguments

Returns

null. Like the other action commands, a successful opurge in the handle phase suppresses the event's default action.

Examples

after command (say) {
  oload 1
  do "say Before: [count [inventory $self]]."
  opurge 1
  do "say After: [count [inventory $self]]."
}

After loading object vnum 1, the mob holds one item; opurge 1 removes it. The two say lines report 1 then 0, confirming the object was purged.

See also