Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19048
Modified Files:
lock.py
Log Message:
locks
Index: lock.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/lock.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** lock.py 25 Aug 2004 17:03:05 -0000 1.13
--- lock.py 5 Oct 2004 12:41:49 -0000 1.14
***************
*** 7,11 ****
--- 7,13 ----
import wolfpack
+ from wolfpack.consts import *
from wolfpack.gumps import cGump
+ from wolfpack import *
import random
***************
*** 166,176 ****
if item.hasscript( 'key' ) and item.hastag( 'lock' ):
if lock == str(item.gettag('lock')):
! return 1
for subitem in item.content:
! if searchkey(subitem, lock):
! return 1
! return 0
def onUse(char, item):
--- 168,179 ----
if item.hasscript( 'key' ) and item.hastag( 'lock' ):
if lock == str(item.gettag('lock')):
! return item
for subitem in item.content:
! result = searchkey(subitem, lock)
! if result:
! return result
! return None
def onUse(char, item):
***************
*** 193,196 ****
--- 196,200 ----
if char.gm:
char.socket.clilocmessage(501281)
+ char.log(LOG_TRACE, tr("Accessed locked object 0x%x.\n") % item.serial)
return 0
***************
*** 198,203 ****
# if the user has the key in his posession.
if item.hasscript( 'door' ):
! if searchkey(char.getbackpack(), lock):
char.socket.clilocmessage(501282)
return 0
--- 202,209 ----
# if the user has the key in his posession.
if item.hasscript( 'door' ):
! key = searchkey(char.getbackpack(), lock)
! if key:
char.socket.clilocmessage(501282)
+ char.log(LOG_TRACE, tr("Accessed locked door 0x%x using key 0x%x.\n") % (item.serial, key.serial))
return 0
|