Purgeobj

Main.Purgeobj History

Hide minor edits - Show changes to markup

December 31, 2008, at 06:36 PM EST by admin
Added lines 1-32:
     purgeobj - syntax: purgeobj(OBJ,options) 

Prog Types: Mob, Object, Room

Used to allow the mob to purge various combination of objects. By default, the room the mob is in and it's inventory/worn items are searched.

If the first argument is an OBJ type variable, it is purged and all other options are ignored. If the first argument is an object key, the first of that item type is purged, or all if LP_ALLOBJS is set (see below).

If the first argument is a keyword, an item is search for based on options. Keywords can also be "all.[item]" or just "all".

Purgeobj will not purge precious items. If a container that is purged holds these items, they will go to the room/mob holding the container. The options available with purgeobj are:

If purgeobj is used with no actor, the only valid argument is a direct OBJ type variable. From a lua prog, this will usually either by the object that triggered the program (objprogs) or an item retrieved using getobj. Note that if purgeobj is used on the 'obj' variable when an object prog is used, it should be the last statement in the prog that accesses obj.

  LP_SEEALL No visibility checks, if the object exists it will be purged. 
  LP_ROOMONLY Only purge items in the room. 
  LP_WORNONLY Only purge items worn by the mob. 
  LP_CARRIEDONLY Only purge items carried by the mob. 
  LP_ALLOBJS Only used with objkey - if this option is set, all objects with the same key will be purged. 


   --- Purge all tickets carried by self.
   purgeobj("all.ticket",LP_CARRIEDONLY)

   --- Purge all instances of aylor-321 in room, visible or not.
   purgeobj("aylor-321",LP_ROOMONLY+LP_SEEALL)

   --- Purge the item that triggered this prog (give trigger)
   purgeobj(obj)