[wpdev-commits] xmlscripts/scripts/magic scroll.py,1.3,1.4
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-07-18 01:41:56
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32164/magic Modified Files: scroll.py Log Message: Fixed scrolls, tried to fix skillinfo... skillinfo still hangs my client... Index: scroll.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/scroll.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** scroll.py 26 May 2004 13:07:23 -0000 1.3 --- scroll.py 18 Jul 2004 01:41:48 -0000 1.4 *************** *** 8,13 **** #===============================================================# - from magic.spellbook import addspell import wolfpack # calculate the spell-id of a scroll --- 8,13 ---- #===============================================================# import wolfpack + from magic.spellbook import addspell, hasspell # calculate the spell-id of a scroll *************** *** 26,30 **** except: char.socket.sysmessage( 'Broken scroll' ) ! return 0 if item.amount > 1: --- 26,30 ---- except: char.socket.sysmessage( 'Broken scroll' ) ! return False if item.amount > 1: *************** *** 34,38 **** item.delete() ! return 1 def onDropOnItem( cont, item ): --- 34,38 ---- item.delete() ! return True def onDropOnItem( cont, item ): *************** *** 41,45 **** if not char.ischar(): ! return 0 try: --- 41,48 ---- if not char.ischar(): ! return False ! ! if cont == char.getbackpack() or cont == item.container: ! return False try: *************** *** 47,63 **** except: char.socket.sysmessage( "Error while calculating scroll id." ) ! return 0 ! if spell >= 64: ! char.socket.sysmessage( "Scroll with invalid spell-id: %d" % spell ) ! return 0 ! addspell( cont, spell ) - if item.amount > 1: - item.amount -= 1 - return 0 else: ! item.delete() # Consume the scroll ! return 1 --- 50,73 ---- except: char.socket.sysmessage( "Error while calculating scroll id." ) ! return False ! if ( 'magic.spellbook' in cont.events ): ! if spell >= 64: ! char.socket.sysmessage( "Scroll with invalid spell-id: %d" % spell ) ! else: ! if not hasspell( cont, spell ): ! addspell( cont, spell ) ! if item.amount > 1: ! item.amount -= 1 ! item.update() ! else: ! item.delete() # Consume the scroll ! return False ! else: ! return False else: ! return False ! return False |