Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15312
Modified Files:
key.py lock.py
Log Message:
Fixed locks and added unlocking/locking functionality to keys.
Index: key.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/key.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** key.py 24 Jan 2004 22:33:25 -0000 1.2
--- key.py 25 Jan 2004 00:45:38 -0000 1.3
***************
*** 11,14 ****
--- 11,42 ----
def lock_response(char, args, target):
+ if len(args) != 1:
+ return
+
+ key = wolfpack.finditem(args[0])
+ if not key or not char.canreach(key,5):
+ char.socket.clilocmessage(501661)
+ return
+
+ # Check for an item target.
+ if not target.item or not char.canreach(target.item,5):
+ char.socket.clilocmessage(501666)
+ return
+
+ # a) Targetted a lockable item
+ if target.item == key:
+ char.socket.sysmessage('rename key')
+ # Gump...
+
+ elif 'lock' in target.item.events:
+ if target.item.hastag('locked') and int(target.item.gettag('locked')) == 1:
+ target.item.deltag('locked')
+ else:
+ target.item.settag('locked','1')
+ char.soundeffect(0x241)
+
+ else:
+ char.socket.clilocmessage(501666)
+
return
Index: lock.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/lock.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** lock.py 23 Jan 2004 00:39:03 -0000 1.3
--- lock.py 25 Jan 2004 00:45:39 -0000 1.4
***************
*** 178,187 ****
# Search for a key in the users backpack
! backpack = char.getbackpack()
! if searchkey(backpack, lock):
! if 'door' in events:
! char.message(501282) # quickly open / relock
! return 0
char.message(502503) # Thats locked
--- 178,187 ----
# Search for a key in the users backpack
! #backpack = char.getbackpack()
! #if searchkey(backpack, lock):
! # if 'door' in events:
! # char.message(501282) # quickly open / relock
! # return 0
char.message(502503) # Thats locked
|