Update of /cvsroot/wpdev/xmlscripts/scripts/commands
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27216
Modified Files:
account.py invul.py
Added Files:
kill.py
Log Message:
Cleanups
Also added the kill command to python.
WARNING: char.kill() IS BROKEN!
TypeError: onDeath() takes exactly 3 arguments (0 given)
Program received signal SIGSEGV, Segmentation fault.
cBaseChar::onDeath (this=0x91eb3e8, source=0x0, corpse=0x0) at basechar.cpp:2611
2611 Py_DECREF( args );
(gdb) bt
#0 cBaseChar::onDeath (this=0x91eb3e8, source=0x0, corpse=0x0) at basechar.cpp:2611
#1 0x0806d859 in cBaseChar::kill (this=0x91eb3e8, source=0x0) at basechar.cpp:2891
#2 0x0806be25 in cBaseChar::damage (this=0x91eb3e8, type=DAMAGE_GODLY, amount=67, source=0x0) at basechar.cpp:2287
#3 0x081836bb in wpChar_kill (self=0x0, args=0x41cbf7c4) at basechar.h:976
#4 0x400b365c in PyCFunction_Call () from /usr/lib/libpython2.3.so.1.0
#5 0x41d2a0e0 in ?? ()
#6 0x41cbf7c4 in ?? ()
#7 0xbfffea6c in ?? ()
#8 0x400f0b22 in PyEval_GetFuncDesc () from /usr/lib/libpython2.3.so.1.0
#9 0x00000000 in ?? ()
#10 0x0823d500 in wpTooltipMethods ()
#11 0x08183670 in wpChar_resurrect () at utilities.h:61
Previous frame inner to this frame (corrupt stack?)
--- NEW FILE: kill.py ---
#===============================================================#
# ) (\_ | WOLFPACK 13.0.0 Scripts
# (( _/{ "-; | Created by: Dreoth
# )).-' {{ ;'` | Revised by:
# ( ( ;._ \\ ctr | Last Modification: Created
#===============================================================#
"""
\command kill
\description Kills the selected character.
\notes You cannot kill invulnerable characters this way.
"""
import wolfpack
def onLoad():
wolfpack.registercommand( "kill", commandKill )
return
def commandKill(socket, cmd, args):
socket.sysmessage( "Please select the target to kill." )
socket.attachtarget( "commands.kill.dokill", [] )
return True
def dokill( char, args, target ):
if target.char and not target.char.dead:
if target.char.invulnerable:
socket.sysmessage( "This target is invulnerable!" )
return False
else:
target.char.lightning()
target.char.kill()
return True
Index: account.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/account.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** account.py 9 Jul 2004 09:00:09 -0000 1.6
--- account.py 9 Jul 2004 09:58:21 -0000 1.7
***************
*** 1,2 ****
--- 1,8 ----
+ #===============================================================#
+ # ) (\_ | WOLFPACK 13.0.0 Scripts
+ # (( _/{ "-; | Created by: Dreoth
+ # )).-' {{ ;'` | Revised by:
+ # ( ( ;._ \\ ctr | Last Modification: Created
+ #===============================================================#
"""
\command account
***************
*** 42,46 ****
import wolfpack.settings
import string
- from wolfpack.consts import *
from wolfpack.utilities import hex2dec
--- 48,51 ----
Index: invul.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/invul.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** invul.py 26 May 2004 13:07:21 -0000 1.3
--- invul.py 9 Jul 2004 09:58:21 -0000 1.4
***************
*** 1,5 ****
!
! import wolfpack
!
"""
\command invul
--- 1,8 ----
! #===============================================================#
! # ) (\_ | WOLFPACK 13.0.0 Scripts
! # (( _/{ "-; | Created by: ???
! # )).-' {{ ;'` | Revised by: Dreoth
! # ( ( ;._ \\ ctr | Last Modification: Tweaks
! #===============================================================#
"""
\command invul
***************
*** 15,29 ****
"""
def invul(socket, command, arguments):
! arguments = arguments.lower()
! if len(arguments) and arguments == '1' or arguments == 'on' or arguments == 'true':
! socket.player.invulnerable = 1
! elif len(arguments) and arguments == '0' or arguments == 'off' or arguments == 'false':
! socket.player.invulnerable = 0
! else:
! socket.player.invulnerable = not socket.player.invulnerable
! socket.sysmessage("'invul' is now '%u'" % socket.player.invulnerable)
socket.player.resendtooltip()
def onLoad():
! wolfpack.registercommand('invul', invul)
--- 18,31 ----
"""
+ import wolfpack
+ from wolfpack.utilities import booleantoggle
+
def invul(socket, command, arguments):
! socket.player.invulnerable = booleantoggle( socket.player.invulnerable )
! socket.sysmessage( "Invulnerable is now '%i'." % socket.player.invulnerable )
socket.player.resendtooltip()
+ return True
def onLoad():
! wolfpack.registercommand( 'invul', invul )
! return
|