Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv31082
Modified Files:
spellbook.py tooltip.py
Log Message:
Changed scripts to resemble changes in wolfpack.registerglobal and wolfpack.registercommand
Added barebone for new magic system.
Index: spellbook.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/spellbook.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** spellbook.py 20 Sep 2003 02:22:09 -0000 1.3
--- spellbook.py 23 Sep 2003 12:17:39 -0000 1.4
***************
*** 11,59 ****
import wolfpack
! def onLoad():
! # Register .addspell, .removespell, .editspells (?)
! wolfpack.registercommand( "addspell", "spellbook" )
! wolfpack.registercommand( "removespell", "spellbook" )
! def onCommand( socket, command, arguments ):
! if command == "ADDSPELL":
! if arguments != 'all':
! try:
! if len( arguments ) < 1:
! raise Exception
!
! spell = int( arguments )
! except:
! socket.sysmessage( 'Usage: addspell <spell> or addspell all' )
! return
!
! if spell >= 64:
! socket.sysmessage( 'Values between 0 and 63 are valid.' )
! return
! else:
! spell = 'all'
! socket.sysmessage( 'Select the spellbook you want to add the spell to.' )
! socket.attachtarget( "spellbook.addspelltarget", [ spell ] )
!
! elif command == "REMOVESPELL":
! if arguments != 'all':
! try:
! if len( arguments ) < 1:
! raise Exception
!
! spell = int( arguments )
! except:
! socket.sysmessage( 'Usage: removespell <spell> or removespell all' )
! return
!
! if spell >= 64:
! socket.sysmessage( 'Values between 0 and 63 are valid.' )
! return
! else:
! spell = 'all'
! socket.sysmessage( 'Select the spellbook you want to remove the spell from.' )
! socket.attachtarget( "spellbook.removespelltarget", [ spell ] )
# Does the Spellbook have a specific spell?
--- 11,58 ----
import wolfpack
! def commandAddSpell( socket, command, arguments ):
! if arguments != 'all':
! try:
! if len( arguments ) < 1:
! raise Exception
! spell = int( arguments )
! except:
! socket.sysmessage( 'Usage: addspell <spell> or addspell all' )
! return
!
! if spell >= 64:
! socket.sysmessage( 'Values between 0 and 63 are valid.' )
! return
! else:
! spell = 'all'
! socket.sysmessage( 'Select the spellbook you want to add the spell to.' )
! socket.attachtarget( "spellbook.addspelltarget", [ spell ] )
!
! def commandRemoveSpell( socket, command, arguments ):
! if arguments != 'all':
! try:
! if len( arguments ) < 1:
! raise Exception
!
! spell = int( arguments )
! except:
! socket.sysmessage( 'Usage: removespell <spell> or removespell all' )
! return
! if spell >= 64:
! socket.sysmessage( 'Values between 0 and 63 are valid.' )
! return
! else:
! spell = 'all'
!
! socket.sysmessage( 'Select the spellbook you want to add the spell to.' )
! socket.attachtarget( "spellbook.addspelltarget", [ spell ] )
!
! def onLoad():
! # Register .addspell, .removespell, .editspells (?)
! wolfpack.registercommand( "addspell", commandAddSpell )
! wolfpack.registercommand( "removespell", commandRemoveSpell )
# Does the Spellbook have a specific spell?
Index: tooltip.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/tooltip.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** tooltip.py 20 Sep 2003 02:22:09 -0000 1.8
--- tooltip.py 23 Sep 2003 12:17:39 -0000 1.9
***************
*** 13,20 ****
# Register as a global script
def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SHOWTOOLTIP, "tooltip" )
! wolfpack.registerglobal( HOOK_ITEM, EVENT_SHOWTOOLTIP, "tooltip" )
! def onShowToolTip( sender, target, tooltip ):
if target.isitem():
--- 13,19 ----
# Register as a global script
def onLoad():
! wolfpack.registerglobal( EVENT_SHOWTOOLTIP, "tooltip" )
! def onShowTooltip( sender, target, tooltip ):
if target.isitem():
|