Update of /cvsroot/wpdev/xmlscripts/scripts/magic
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28414/magic
Modified Files:
circle4.py circle7.py rune.py runebook.py
Log Message:
Runebook fixes
Index: rune.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/rune.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** rune.py 6 Oct 2004 01:24:04 -0000 1.7
--- rune.py 21 Oct 2004 17:59:07 -0000 1.8
***************
*** 114,116 ****
# Identify the item as a rune
def onCreate( item, definition ):
! item.settag( 'marked', 0 )
--- 114,118 ----
# Identify the item as a rune
def onCreate( item, definition ):
! if not item.hastag('marked'):
! item.settag( 'marked', 0 )
!
Index: runebook.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/runebook.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** runebook.py 20 Oct 2004 16:27:25 -0000 1.13
--- runebook.py 21 Oct 2004 17:59:07 -0000 1.14
***************
*** 15,168 ****
import magic.scroll
from magic.utilities import fizzle, MODE_BOOK, hasSpell
! import whrandom
import wolfpack.utilities
! def onUse( char, item ):
! # char does not have it and distance > 2
! if( char.distanceto( item ) > 2 and item.getoutmostchar() != char ):
! # "Target cannot be seen."
! char.socket.clilocmessage( 502400 )
! return 1
! # check use delay
! if item.hastag( "dclickdelay" ):
! # "This book needs time to recharge."
! char.socket.clilocmessage( 502403 )
! return 1
! sendGump( char, item )
! # set use delay 2 sec
! item.settag( "dclickdelay", 1 )
! wolfpack.addtimer( 2000, "magic.runebook.rmdelay", [ item.serial ] )
! return True
! def onDropOnItem( book, item ):
! if book.layer != 0 or isrunebook(item):
! return False # Don't handle if book is being dragged
!
! char = item.container
! if isrunebook( book ):
! if isrune(item) and item.hastag('marked'):
! # initialize rune serials to -1 if there's no rune
! # should not occur - will be removed later
! for i in range( 0, 16 ):
! if not book.hastag( "rune %i" % i ):
! book.settag( "rune %i" % i, -1 )
!
! # rune serials
! runes = [ -1 ] * 16
! for i in range( 0, 16 ):
! runes[ i ] = int( book.gettag( "rune %i" % i ) )
! i = 0
! while( runes[ i ] > -1 and i < 16 ):
! i = i + 1
! # runebook is full
! if( i > 15 ):
! # can we access the char.socket ?
! # "This runebook is full."
! if char.socket:
! char.socket.clilocmessage( 502401 )
! char.getbackpack().additem(item)
! item.pos = book.pos
! item.pos.z += 1
! item.update()
! return True
! book.settag( "rune %i" % i, int( item.serial ) )
!
! # insert rune - is runebook a container ?
! wolfpack.utilities.tocontainer( item, book )
! item.update()
! char.soundeffect(0x42)
! return True
! # Recall Scrolls for recharging
! elif item.hasscript('magic.scroll'):
! try:
! spellid = magic.scroll.calcSpellId(item)
! # Recall Scroll
! if spellid + 1 == 32:
! charges = item.amount
! maxcharges = book.gettag('maxcharges') - book.gettag('charges')
!
! if maxcharges > 0:
! charges = min(charges, maxcharges)
! book.settag('charges', book.gettag('charges') + charges)
!
! if charges >= item.amount:
! item.delete()
! return True
! else:
! item.amount -= charges
! item.update()
! item.resendtooltip()
!
! char.soundeffect(0x249)
! else:
! char.socket.clilocmessage(502410)
except:
! pass
!
! char.getbackpack().additem(item)
! item.pos = book.pos
! item.pos.z += 1
! item.update()
! return True
! def onCreate( item, defstr ):
! if not item:
! return 0
! item.settag( "charges", 0 )
! item.settag( "default", 0 )
! # max charge calc will be added later
! if not item.hastag( 'maxcharges' ):
! item.settag( "maxcharges", 5 )
! # initialize rune serials to -1
! for i in range( 0, 16 ):
! item.settag( "rune %i" % i, -1 )
! item.settag( "runebook", 1 )
! return 1
! def isrunebook( item ):
! if item.hastag( "runebook" ):
! return 1
! return 0
! def droprune( char, book, runenumber ):
! if book.hastag( "rune %i" % runenumber ):
! rune = wolfpack.finditem( book.gettag( "rune %i" % runenumber ) )
! if rune:
! wolfpack.utilities.tobackpack( rune, char )
! rune.update()
! book.settag( "rune %i" % runenumber, -1 )
! book.update()
! char.socket.clilocmessage(502421)
! return True
! #elif rune and rune.container != book.serial:
! # book.settag( "rune %i" % runenumber, -1 )
! # book.update()
! # return True
return False
! def rmdelay( self, args ):
! if( len( args ) < 1 ):
! return 1
! book = wolfpack.finditem( args[ 0 ] )
! if not book:
! return 1
! if not book.hastag( "dclickdelay" ):
! return 1
! book.deltag( "dclickdelay" )
! return 1
! def sendGump( char, item ):
! char.socket.closegump( 0x87654322 )
! char.soundeffect( 0x55 )
! runebook = cGump( 0, 0, 0, 100, 120 )
runebook.startPage( 0 )
--- 15,219 ----
import magic.scroll
from magic.utilities import fizzle, MODE_BOOK, hasSpell
! import random
import wolfpack.utilities
! #
! # Is Runebook?
! #
! def isRunebook(runebook):
! return runebook.hasscript('magic.runebook') and runebook.id == 0x22c5
!
! #
! # Is Rune?
! #
! def isRune(rune):
! return rune.hasscript('magic.rune') and (rune.id >= 0x1f14 and rune.id <= 0x1f17)
! #
! # Is the item a recall scroll?
! #
! def isRecallScroll(scroll):
! return scroll.hasscript('magic.scroll') and scroll.id == 0x1f4c
! #
! # Show a custom tooltip for runebooks
! #
! def onShowTooltip(player, runebook, tooltip):
! tooltip.reset()
! tooltip.add(1028901, '')
! if runebook.hastag('description'):
! description = unicode(runebook.gettag('description'))
! if len(description) > 0:
! tooltip.add(1042971, description)
! #
! # Convert this runebook by moving all the old runes out of it
! #
! def convertRunebook(runebook):
! if runebook.container.isitem():
! wolfpack.utilities.cont2cont(runebook, runebook.container)
! #
! # Show the runebook as long as we are in range
! #
! def onUse(player, runebook):
! convertRunebook(runebook) # Legacy conversion
! if player.canreach(runebook, 1):
! closeGump(player, runebook)
! sendGump(player, runebook)
! return True
!
! #
! # Get the books charges
! #
! def getCharges(runebook):
! (charges, maxcharges) = (0, 6) # Default
! if runebook.hastag('maxcharges'):
! try:
! maxcharges = int(runebook.gettag('maxcharges'))
! except:
! maxcharges = 6
! if runebook.hastag('charges'):
! try:
! charges = min(maxcharges, int(runebook.gettag('charges')))
! except:
! charges = 0
! return (charges, maxcharges)
!
! #
! # Get a single entry or None if that entry does not exist
! #
! def getEntry(runebook, index):
! if index < 0 or index > 15:
! return None
! tagname = 'entry%u' % index
!
! if not runebook.hastag(tagname):
! return None
! try:
! (x, y, z, map) = runebook.gettag(tagname).split(',')
! pos = wolfpack.coord(int(x), int(y), int(z), int(map))
! except:
! return None
!
! return pos
!
! #
! # Retrieve the entries for this book
! # Index, Name, Location (coord)
! #
! def getEntries(runebook):
! entries = []
!
! for i in range(0, 16):
! tagname = 'entry%u' % i
! if runebook.hastag(tagname):
! try:
! (x, y, z, map) = runebook.gettag(tagname).split(',')
! pos = wolfpack.coord(int(x), int(y), int(z), int(map))
!
! if runebook.hastag(tagname + 'name'):
! name = runebook.gettag(tagname + 'name')
! else:
! name = tr('(indescript)')
! entries.append([i, name, pos])
except:
! raise
! runebook.deltag(tagname)
! runebook.deltag(tagname + 'name')
! return entries
! #
! # Get the first free index or -1 if the book is full
! #
! def getFreeIndex(runebook):
! for i in range(0, 16):
! if not runebook.hastag('entry%u' % i):
! return i
! return -1 # No free entry was found
! #
! # An item is being dropped on this runebook
! #
! def onDropOnItem(runebook, item):
! if not isRunebook(runebook):
! return False # Only handle for dropping something on the runebook
!
! if not item.container or not item.container.ischar():
! return False # Some internal error or script before us
!
! player = item.container
!
! if isRune(item):
! location = None
! if item.hastag('marked') and item.hastag('location'):
! try:
! (x, y, z, map) = item.gettag('location').split(',')
! location = wolfpack.coord(int(x), int(y), int(z), int(map))
! except:
! pass
! if location:
! index = getFreeIndex(runebook)
!
! if index != -1:
! tagname = 'entry%u' % index
! name = item.name.strip()
! if len(name) != 0:
! runebook.settag(tagname + 'name', name)
! else:
! runebook.deltag(tagname + 'name') # Make sure there is no old name
! runebook.settag(tagname, str(location))
! player.soundeffect(0x42)
! item.delete()
! return True
!
! else:
! player.socket.clilocmessage(502401)
! else:
! player.socket.clilocmessage(502409)
!
! elif isRecallScroll(item):
! # Recharge if possible
! (charges, maxcharges) = getCharges(runebook)
! if charges < maxcharges:
! consume = min(item.amount, maxcharges - charges)
! runebook.settag('charges', charges + consume)
! player.soundeffect(0x249)
!
! if consume == item.amount:
! item.delete()
! return True # The item has been removed
! else:
! item.amount -= consume
! item.update()
! item.resendtooltip()
! else:
! player.socket.clilocmessage(502410)
!
return False
! # Bounce Code
! if char.socket:
! char.socket.clilocmessage( 502401 )
! char.getbackpack().additem(item)
! item.pos = book.pos
! item.pos.z += 1
! item.update()
! return True
! def closeGump(char, item):
! char.socket.closegump(0x87654322)
! char.socket.deltag('runebook_open')
! def sendGump(char, item):
! char.socket.settag('runebook_open', 1)
! char.soundeffect(0x55)
! runebook = cGump(0, 0, 0, 100, 120)
runebook.startPage( 0 )
***************
*** 189,198 ****
# charge / max charge
! if not item.hastag( "charges" ):
! item.settag( "charges", 0 )
! charges = item.gettag( "charges" )
! if not item.hastag( "maxcharges" ):
! item.settag( "maxcharges", 5 )
! maxcharges = item.gettag( "maxcharges" )
runebook.addText( 160, 40, "Charges: %i" % charges )
runebook.addText( 300, 40, "Max Charges: %i" % maxcharges )
--- 240,244 ----
# charge / max charge
! (charges, maxcharges) = getCharges(item)
runebook.addText( 160, 40, "Charges: %i" % charges )
runebook.addText( 300, 40, "Max Charges: %i" % maxcharges )
***************
*** 207,228 ****
runebook.addPageButton( 393, 14, 2206, 2206, 2 )
! # get rune serials and names
! runes = [ -1 ] * 16
! for i in range( 0, 16 ):
! if not item.hastag( "rune %i" % i ):
! item.settag( "rune %i" % i, int( runes[ i ] ) )
! else:
! runes[ i ] = int( item.gettag( "rune %i" % i ) )
! runenum = 0
! while( runenum < 16 and runes[ runenum ] > -1 ):
! runenum = runenum + 1
! runenames = [ "Empty" ] * 16
! for i in range( 0, runenum ):
! rune = wolfpack.finditem( int( runes[ i ] ) )
! if rune and isrune( rune ):
! runenames[ i ] = rune.name
# blue button and rune name
! for i in range( 0, 16 ):
if( i < 8 ):
x = 130
--- 253,261 ----
runebook.addPageButton( 393, 14, 2206, 2206, 2 )
! entries = getEntries(item) # Get runebook entries
# blue button and rune name
! i = 0
! for entry in entries:
if( i < 8 ):
x = 130
***************
*** 230,247 ****
x = 290
y = 60 + ( i % 8 ) * 15
# blue button return code = rune number + 1
# tramel color : 115, feluca color : ???
! namecolor = 115
! runebook.addButton( x, y + 5, 2103, 2104, i + 1 )
! if i < runenum:
! runebook.addText( x + 15, y, "%s" % runenames[ i ], namecolor )
! else:
! # no color - black
! runebook.addText( x + 15, y, "Empty" )
! if item.hastag( "default" ):
! default = item.gettag( "default" )
else:
! item.settag( "default", 0 )
default = 0
--- 263,279 ----
x = 290
y = 60 + ( i % 8 ) * 15
+
# blue button return code = rune number + 1
# tramel color : 115, feluca color : ???
! namecolor = 10
! runebook.addButton( x, y + 5, 2103, 2104, 1 + entry[0] )
! runebook.addText( x + 15, y, entry[1], namecolor )
! i += 1
!
! if item.hastag("default"):
! default = item.gettag("default")
else:
! item.settag("default", 0 )
default = 0
***************
*** 249,257 ****
for i in range( 2, 10 ):
runebook.startPage( i )
# next page - top right corner
if( i < 9 ):
runebook.addPageButton( 393, 14, 2206, 2206, i + 1 )
# previous page - top left corner
! runebook.addPageButton( 125, 14, 2205, 2205, i - 1 )
# for each sub-page
--- 281,291 ----
for i in range( 2, 10 ):
runebook.startPage( i )
+
# next page - top right corner
if( i < 9 ):
runebook.addPageButton( 393, 14, 2206, 2206, i + 1 )
+
# previous page - top left corner
! runebook.addPageButton( 124, 14, 2205, 2205, i - 1 )
# for each sub-page
***************
*** 259,287 ****
# rune number
k = ( i - 2 ) * 2 + j
# blue button return code = 1 + rune number
! runebook.addButton( 130 + j * 160, 65, 2103, 2104, 1 + k )
# recall button return code = 301 + rune number
! runebook.addButton( 135 + j * 160, 140, 2271, 2271, 301 + k )
# gate button return code = 401 + rune number
! runebook.addButton( 205 + j * 160, 140, 2291, 2291, 401 + k )
! # there's a recall rune
! # tramel color : 115, feluca : ???
! namecolor = 115
! if( k < runenum ):
! runebook.addText( 145 + j * 160, 60, runenames[ k ], namecolor )
! # set default button return code = 101 + rune number
! if( k == default ):
! runebook.addButton( 160 + j * 135, 20, 2360, 2360, 101 + k )
! else:
! runebook.addButton( 160 + j * 135, 20, 2360, 2361, 101 + k )
! runebook.addText( 175 + j * 135, 15, "Set default" )
! # drop button return code = 201 + rune number
! runebook.addButton( 135 + j * 160, 115, 2437, 2438, 201 + k )
! runebook.addText( 150 + j * 160, 115, "Drop rune" )
! # empty - no color : black
! else:
! runebook.addText( 145 + j * 160, 60, runenames[ k ] )
! runebook.setArgs( [ item ] )
runebook.setType( 0x87654322 )
runebook.setCallback( "magic.runebook.callback" )
--- 293,316 ----
# rune number
k = ( i - 2 ) * 2 + j
+
+ if k >= len(entries):
+ runebook.addText( 145 + j * 160, 60, tr('Empty') )
+ continue
+
# blue button return code = 1 + rune number
! runebook.addButton( 130 + j * 160, 65, 2103, 2104, 1 + entries[k][0] )
# recall button return code = 301 + rune number
! runebook.addButton( 135 + j * 160, 140, 2271, 2271, 301 + entries[k][0] )
# gate button return code = 401 + rune number
! runebook.addButton( 205 + j * 160, 140, 2291, 2291, 401 + entries[k][0] )
! namecolor = 10
! runebook.addText( 145 + j * 160, 60, entries[k][1], namecolor )
!
! # Drop button return code = 201 + rune number
! runebook.addButton( 135 + j * 160, 115, 2437, 2438, 201 + entries[k][0] )
! runebook.addText( 150 + j * 160, 115, tr("Drop rune") )
!
! runebook.setArgs( [ item.serial ] )
runebook.setType( 0x87654322 )
runebook.setCallback( "magic.runebook.callback" )
***************
*** 292,408 ****
# callback function - process gump callback
def callback( char, args, target ):
! # close the book
! char.socket.closegump( 0x87654322 )
!
! # error checkings - will be removed later
! if( len( args ) < 1 ):
! char.socket.sysmessage( "script error 1. contact GM." )
! return False
! item = args[0]
! if not item:
! char.socket.sysmessage( "script error 2. contact GM." )
! return False
!
! # distance check
! if( char.distanceto( item ) > 2 and item.getoutmostchar() != char ):
! char.socket.clilocmessage( 502400 )
! return False
! button = int( target.button )
! # rename book
! if( button == 1000 ):
! # "Please enter a title for the runebook:"
! char.socket.clilocmessage( 502414 )
! # how do we request input and catch the response ?
! char.socket.sysmessage( "not implemented yet - will be added." )
! return True
! runes = [ -1 ] * 16
! for i in range( 0, 16 ):
! # should not occur - will be removed later
! if not item.hastag( "rune %i" % i ):
! item.settag( "rune %i" % i, -1 )
! else:
! runes[ i ] = item.gettag( "rune %i" % i )
! # selected rune number
runenum = ( button - 1 ) % 100
! if( runenum < 0 or runenum > 15 ):
! # "Request cancelled."
! char.socket.clilocmessage( 502415 )
! return True
!
! # there's no rune
! if( runes[ runenum ] < 0 ):
! # "This place in the book is empty."
! char.socket.clilocmessage( 502411 )
return True
! # recall button - using charges : 1 - 16
if( button > 0 and button < 17 ):
! charges = item.gettag( "charges" )
! if( charges < 1 ):
! # "There are no charges left on that item."
! #char.socket.clilocmessage( 502412 )
! wolfpack.addtimer( 0, "magic.runebook.recall1", [ char.serial, runes[ runenum ] ] )
! return False
! else:
! # recall to the rune
char.say( "Kal Ort Por", 5 )
! wolfpack.addtimer( 2000, "magic.runebook.recall0", [ char.serial, runes[ runenum ], item.serial, charges ] )
! return True
! # set default button : 101 - 116
! elif( button > 100 and button < 117 ):
! item.settag( "default", int( runenum ) )
! return True
! # drop button : 201 - 216
elif( button > 200 and button < 217 ):
! # will be added
! droprune( char, item, runenum )
! return True
# recall button - spell : 301 - 316
elif( button > 300 and button < 317 ):
! # char action / power word
! wolfpack.addtimer( 0, "magic.runebook.recall1", [ char.serial, runes[ runenum ] ] )
! return True
# gate button : 401 - 416
elif( button > 400 and button < 417 ):
! wolfpack.addtimer( 0, "magic.runebook.gate", [ char.serial, runes[ runenum ] ] )
! return True
! # button number error - should not occur
! else:
! char.socket.sysmessage( "script error 4. contact GM" )
! return False
!
! return True
# recall using charges
! def recall0( self, args ):
! if( len( args ) < 2 ):
! return False
! char = wolfpack.findchar( args[ 0 ] )
! rune = wolfpack.finditem( args[ 1 ] )
! runebook = wolfpack.finditem( args[ 2 ] )
! charges = args[ 3 ]
! if not char:
! return False
! if not rune:
! char.socket.sysmessage( "runebook script error." )
! return False
!
if not char.gm:
if char.iscriminal():
if char.socket:
char.socket.clilocmessage(1005561)
! return False
if char.attacktarget:
if char.socket:
char.socket.clilocmessage(1005564)
! return False
! location = rune.gettag('location')
! location = location.split(",")
! location = wolfpack.coord(int(location[0]), int(location[1]), int(location[2]), int(location[3]))
region = None
--- 321,407 ----
# callback function - process gump callback
def callback( char, args, target ):
! item = wolfpack.finditem(args[0])
! closeGump(char, item)
! if target.button == 0:
! return
!
! if not char.canreach(item, 1):
! return
! button = target.button
! # Get selected rune number
runenum = ( button - 1 ) % 100
!
! target = getEntry(item, runenum)
!
! if not target:
! char.socket.clilocmessage(502411) # No such rune
return True
! # Use a charge or use the recall spell
if( button > 0 and button < 17 ):
! (charges, maxcharges) = getCharges(item)
! if charges > 0:
char.say( "Kal Ort Por", 5 )
! char.addtimer( 2000, "magic.runebook.recall0", [ item.serial, target ] )
! else:
! # Fall back to the Recall Spell
! char.addtimer( 0, "magic.runebook.recall1", [item.serial, target] )
!
! # Drop Rune
elif( button > 200 and button < 217 ):
! name = ''
! if item.hastag('entry%uname' % runenum):
! name = unicode(item.gettag('entry%uname' % runenum))
!
! RUNEIDS = ['1f14', '1f15', '1f16', '1f17']
! rune = wolfpack.additem(random.choice(RUNEIDS))
! rune.settag('marked', 1)
! rune.settag('location', str(target))
! rune.name = name
!
! if not wolfpack.utilities.tobackpack(rune, char):
! rune.update()
!
! char.socket.clilocmessage(502421)
!
! closeGump(char, item)
! sendGump(char, item)
!
# recall button - spell : 301 - 316
elif( button > 300 and button < 317 ):
! char.addtimer( 0, "magic.runebook.recall1", [item.serial, target] )
!
# gate button : 401 - 416
elif( button > 400 and button < 417 ):
! char.addtimer( 0, "magic.runebook.gate", [item.serial, target] )
# recall using charges
! def recall0( char, args ):
! runebook = wolfpack.finditem(args[0])
! location = args[1]
!
! if not runebook or not char:
! return
!
if not char.gm:
if char.iscriminal():
if char.socket:
char.socket.clilocmessage(1005561)
! return
if char.attacktarget:
if char.socket:
char.socket.clilocmessage(1005564)
! return
!
! (charges, maxcharges) = getCharges(runebook)
!
! if charges <= 0:
! return # No charges left
! runebook.settag('charges', charges - 1) # Reduce runebook charges
region = None
***************
*** 425,459 ****
char.socket.resendworld()
char.soundeffect(0x1fc)
- # Remove Runebook Charges
- charges = charges - 1
- runebook.settag( "charges", int( charges ) )
return True
! # recall spell to the selected rune
! def recall1( self, args ):
! char = wolfpack.findchar( args[ 0 ] )
! rune = wolfpack.finditem( args[ 1 ] )
!
! if not char:
! return False
!
! if not rune:
! char.socket.sysmessage( "Missing recall rune." )
! return False
!
! magic.castSpell( char, 32, MODE_BOOK, args = [], target = rune )
! return True
!
! def gate( self, args ):
! char = wolfpack.findchar( args[ 0 ] )
! rune = wolfpack.finditem( args[ 1 ] )
!
! if not char:
! return False
!
! if not rune:
! char.socket.sysmessage( "Missing recall rune." )
! return False
! magic.castSpell( char, 52, MODE_BOOK, args = [], target = rune )
! return True
--- 424,442 ----
char.socket.resendworld()
char.soundeffect(0x1fc)
return True
! # Use the Recall spell to recall to the selected rune
! def recall1( char, args ):
! runebook = wolfpack.finditem(args[0])
! target = args[1]
!
! if char and runebook:
! magic.castSpell( char, 32, MODE_BOOK, args = [target], target = runebook )
! # Use the Gate spell to open a gate to the selected rune
! def gate( char, args ):
! runebook = wolfpack.finditem(args[0])
! target = args[1]
!
! if char and runebook:
! magic.castSpell( char, 52, MODE_BOOK, args = [target], target = runebook )
Index: circle7.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle7.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** circle7.py 27 Sep 2004 22:33:22 -0000 1.17
--- circle7.py 21 Oct 2004 17:59:07 -0000 1.18
***************
*** 139,153 ****
char.turnto(target)
! # We can only recall from recall runes
! if not target.hasscript( 'magic.rune' ):
! char.message(502357)
! return
! if not self.consumerequirements(char, mode, args, target, item):
! return
! if not target.hastag('marked') or target.gettag('marked') != 1:
! char.message(502354)
! fizzle(char)
return
--- 139,164 ----
char.turnto(target)
! # Runebook recall support
! runebook = magic.runebook.isRunebook(target) and len(args) == 1
! # We can only recall from recall runes or via the runebook
! if not runebook:
! if not target.hasscript('magic.rune'):
! char.message(502357)
! return
!
! if not target.hastag('marked') or target.gettag('marked') != 1:
! char.message(502354)
! return
! location = target.gettag('location')
! location = location.split(",")
! location = wolfpack.coord(int(location[0]), int(location[1]), int(location[2]), int(location[3]))
! char.log(LOG_MESSAGE, 'Tries to gate to %s using rune.\n' % str(location))
! else:
! location = args[0]
! char.log(LOG_MESSAGE, 'Tries to gate to %s using runebook.\n' % str(location))
!
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 159,166 ****
return
- location = target.gettag('location')
- location = location.split(",")
- location = wolfpack.coord(int(location[0]), int(location[1]), int(location[2]), int(location[3]))
-
region = wolfpack.region(location.x, location.y, location.map)
--- 170,173 ----
***************
*** 185,189 ****
gate.settag('dispellable_field', 1)
gate.addscript( 'magic.gate' )
! gate.settag('target', target.gettag('location'))
gate.update()
gate.soundeffect(0x20e)
--- 192,196 ----
gate.settag('dispellable_field', 1)
gate.addscript( 'magic.gate' )
! gate.settag('target', str(location))
gate.update()
gate.soundeffect(0x20e)
Index: circle4.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle4.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** circle4.py 27 Sep 2004 22:33:22 -0000 1.16
--- circle4.py 21 Oct 2004 17:59:07 -0000 1.17
***************
*** 126,140 ****
char.turnto(target)
! # We can only recall from recall runes
! if not target.hasscript( 'magic.rune' ):
! char.message(502357)
! return
! if not self.consumerequirements(char, mode, args, target, item):
! return
! if not target.hastag('marked') or target.gettag('marked') != 1:
! char.message(502354)
! fizzle(char)
return
--- 126,151 ----
char.turnto(target)
! # Runebook recall support
! runebook = magic.runebook.isRunebook(target) and len(args) == 1
! # We can only recall from recall runes or via the runebook
! if not runebook:
! if not target.hasscript('magic.rune'):
! char.message(502357)
! return
!
! if not target.hastag('marked') or target.gettag('marked') != 1:
! char.message(502354)
! return
! location = target.gettag('location')
! location = location.split(",")
! location = wolfpack.coord(int(location[0]), int(location[1]), int(location[2]), int(location[3]))
! char.log(LOG_MESSAGE, 'Tries to recall to %s using rune.\n' % str(location))
! else:
! location = args[0]
! char.log(LOG_MESSAGE, 'Tries to recall to %s using runebook.\n' % str(location))
!
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 147,154 ****
return
- location = target.gettag('location')
- location = location.split(",")
- location = wolfpack.coord(int(location[0]), int(location[1]), int(location[2]), int(location[3]))
-
region = None
region = wolfpack.region(location.x, location.y, location.map)
--- 158,161 ----
|