@prog pchown.muf 1 999 d i ( pchown.muf by Wog A Player Chown command. Takes an object @chown's it if it's set CHOWN_OK, and then unset the CHOWN_OK flag. Also checks the @chlock. NOT designed to replace the @chown command. Create an action named similarly to @pchown;@pch to this program... --- Change History ---------------------------------- v 1.0 02/24/00 Assignment of version number to programs. --- Distrubution Information ------------------------ Copyright {C} Charles "Wog" Reiss This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or {at your option} any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. For a copy of the GPL: a> see: http://www.gnu.org/copyleft/gpl.html b> write to: the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA ) $include $lib/ansi $def .tell ansi-tell $def CHLOCK_PROP "/_/chlk" $def ERROR_COLOR "red,bold" $def SUCCESS_COLOR "green,bold" : main dup "#help" stringpfx if "Usage: " "cyan,bold" textattr command @ "white,bold" textattr strcat "<" "yellow" textattr strcat "object" "yellow,bold" textattr strcat ">" "yellow" textattr strcat .tell exit then match dup ok? not if dup #-2 dbcmp if "I don't know what you mean!" ERROR_COLOR textattr .tell exit then dup #-1 dbcmp if "I don't see that here!" ERROR_COLOR textattr .tell exit then int dbtop int >= if "You can't own things that don't exsit!" ERROR_COLOR .tell exit then "No one wants to own garbage!" ERROR_COLOR textattr .tell exit then dup player? if "You can't change the owner of players!" ERROR_COLOR textattr .tell exit then dup owner me @ dbcmp if "You already own that!" ERROR_COLOR textattr .tell exit then dup "C" flag? not if "That doesn't have the CHOWN_OK flag set on it!" ERROR_COLOR textattr .tell exit then ( Okay, now check @chlock... ) dup CHLOCK_PROP getprop dup lock? if me @ swap testlock not if "You can't take possession of that." ERROR_COLOR textattr .tell exit then else pop then dup me @ setown "Owner changed to you." SUCCESS_COLOR textattr .tell "!C" set "CHOWN_OK flag removed." SUCCESS_COLOR textattr .tell ; . c q @set pchown.muf=W