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:
        char.socket.clilocmessage(502412)
        return  # No charges left

    runebook.settag("charges", charges - 1)  # Reduce runebook charges

    region = None
    region = wolfpack.region(location.x, location.y, location.map)

    if not location.validspawnspot():
        char.message(501942)
        fizzle(char)
        return

    if region and region.norecallin:
        char.message(1019004)
        fizzle(char)
        return False

        # Move his pets if he has any
    if char.player:
        for follower in char.followers:
            if follower.wandertype == 4 and follower.distanceto(char) < 5:
                follower.removefromview()
                follower.moveto(location)
                follower.update(0)

    char.soundeffect(0x1FC)
    char.removefromview()
    char.moveto(location)
    char.update()
    char.socket.resendworld()
    char.soundeffect(0x1FC)
    return True
Example #2
0
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:
        char.socket.clilocmessage(502412)
        return  # No charges left

    region = None
    region = wolfpack.region(location.x, location.y, location.map)

    if not location.validspawnspot():
        char.message(501942)
        fizzle(char)
        return

    if region and region.norecallin:
        char.message(1019004)
        fizzle(char)
        return False

    runebook.settag('charges', charges - 1)  # Reduce runebook charges

    # Move his pets if he has any
    if char.player:
        for follower in char.followers:
            if follower.wandertype == 4 and follower.distanceto(char) < 5:
                follower.removefromview()
                follower.moveto(location)
                follower.update(0)

    char.soundeffect(0x1fc)
    char.removefromview()
    char.moveto(location)
    char.update()
    char.socket.resendworld()
    char.soundeffect(0x1fc)
    return True
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
	location = rune.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)

	if not location.validspawnspot():
		char.message(501942)
		fizzle(char)
		return

	if region and region.norecallin:
		char.message(1019004)
		fizzle(char)
		return False

	char.soundeffect(0x1fc)
	char.removefromview()
	char.moveto(location)
	char.update()
	char.socket.resendworld()
	char.soundeffect(0x1fc)
	# Remove Runebook Charges
	charges = charges - 1
	runebook.settag( "charges", int( charges ) )
	return True
def recall1( self, args ):
	if( len( args ) < 2 ):
		return 1
	char = wolfpack.findchar( args[ 0 ] )
	rune = wolfpack.finditem( args[ 1 ] )

	if not char:
		return False
	if not rune:
		char.socket.sysmessage( "runebook script error." )
		return False
	# Check for Recall
	if not magic.utilities.hasSpell(char, 32):
		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
	region = wolfpack.region(char.pos.x, char.pos.y, char.pos.map)

	if region and region.norecallout:
		char.message(501802)
		fizzle(char)
		return False
		region = None
		region = wolfpack.region(location.x, location.y, location.map)

	if not location.validspawnspot():
			char.message(501942)
			fizzle(char)
			return False

	if region and region.norecallin:
			char.message(1019004)
			fizzle(char)
			return False

	# cast spell
	if( char.mana < 11 ):
		char.socket.sysmessage( "You lack the mana to recall." )
		return False

	# Insert link to Recall Spell!
	char.socket.sysmessage( "not implemented yet" )

	return True