Пример #1
0
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
Пример #2
0
def placement(player, arguments, target):
	deed = wolfpack.finditem(arguments[0])
	(dispid, xoffset, yoffset, zoffset) = arguments[1:] # Get the rest of the arguments

	if not checkDeed(player, deed):
		return	

        region = wolfpack.region( target.pos.x, target.pos.y, target.map )
        if region.cave:
		player.socket.clilocmessage( 502488 ) # You can not place a ship inside a dungeon.
		return
                
	(canplace, moveout) = wolfpack.canplaceboat(target.pos, dispid - 0x4000)

	if not canplace or player.pos.distance( target.pos ) > 30:
		player.socket.clilocmessage( 1043284 ) # A ship can not be created here.
		return

        createBoat( player, deed, target.pos )
	deed.delete()

	for obj in moveout:
		obj.removefromview()
		obj.moveto(player.pos)
		obj.update()
		if obj.ischar() and obj.socket:
			obj.socket.resendworld()
	return
Пример #3
0
def placement(player, arguments, target):
    deed = wolfpack.finditem(arguments[0])
    (dispid, xoffset, yoffset,
     zoffset) = arguments[1:]  # Get the rest of the arguments

    if not checkDeed(player, deed):
        return

    region = wolfpack.region(target.pos.x, target.pos.y, target.map)
    if region.cave:
        player.socket.clilocmessage(
            502488)  # You can not place a ship inside a dungeon.
        return

    (canplace, moveout) = wolfpack.canplaceboat(target.pos, dispid - 0x4000)

    if not canplace or player.pos.distance(target.pos) > 30:
        player.socket.clilocmessage(1043284)  # A ship can not be created here.
        return

    createBoat(player, deed, target.pos)
    deed.delete()

    for obj in moveout:
        obj.removefromview()
        obj.moveto(player.pos)
        obj.update()
        if obj.ischar() and obj.socket:
            obj.socket.resendworld()
    return
Пример #4
0
def where( socket, command, arguments ):
	char = socket.player
	pos = char.pos
	region = wolfpack.region( pos.x, pos.y, pos.map )
	name = None

	if region and region.name and len( region.name ) > 0:
		name = region.name

	multi = char.multi

	if multi and len(multi.name) > 0:
		if not name:
			name = multi.name
		else:
			name += ' (%s)' % multi.name

	if pos.map == 0:
		map = 'Felucca'
	elif pos.map == 1:
		map = 'Trammel'
	elif pos.map == 2:
		map = 'Ilshenar'
	elif pos.map == 3:
		map = 'Malas'
	else:
		map = 'Map %d' % pos.map

	if name:
		socket.sysmessage( "You are in %s at %d,%d,%d on %s" % ( name, pos.x, pos.y, pos.z, map ) )
	else:
		socket.sysmessage( "You are at %d,%d,%d on %s" % ( pos.x, pos.y, pos.z, map ) )
Пример #5
0
    def target(self, char, mode, targettype, target, args, item):
        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

        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

        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)

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

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

        char.soundeffect(0x1FC)
        char.removefromview()
        char.moveto(location)
        char.update()
        char.socket.resendworld()
        char.soundeffect(0x1FC)
Пример #6
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

    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
Пример #7
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
Пример #8
0
    def target(self, char, mode, targettype, target, args, item):
        char.turnto(target)

        # Check if the target tile is blocked or in a multi
        # target.validspawnspot() will automatically set the z
        # of the coord to the nearest top
        if (not target.validspawnspot()
                or wolfpack.findmulti(target)) and not char.gm:
            if char.socket:
                char.socket.clilocmessage(501942)
            return

        # Line of Sight (touch!! or else we can teleport trough windows)
        if not char.canreach(target, 12):
            if char.socket:
                char.socket.clilocmessage(500237)
            return

        # New Location
        region = wolfpack.region(target.x, target.y, target.map)

        # NoTeleport Region?
        if region and region.noteleport:
            if char.socket:
                char.socket.sysmessage(
                    tr("Teleport is not allowed in that Region"))
            return

        if not self.consumerequirements(char, mode, args, target, item):
            return

        source = char.pos

        char.removefromview()
        char.moveto(target)
        char.update()
        if char.socket:
            char.socket.resendworld()

        smokepuff(char, source)
        smokepuff(char, target)
Пример #9
0
	def target(self, char, mode, targettype, target, args, item):
		char.turnto(target)

		# Check if the target tile is blocked or in a multi
		# target.validspawnspot() will automatically set the z
		# of the coord to the nearest top
		if (not target.validspawnspot() or wolfpack.findmulti(target)) and not char.gm:		
			if char.socket:
				char.socket.clilocmessage(501942)
			return

		# Line of Sight (touch!! or else we can teleport trough windows)
		if not char.canreach(target, 12):
			if char.socket:
				char.socket.clilocmessage(500237)
			return

		# New Location
		region = wolfpack.region(target.x, target.y, target.map)

		# NoTeleport Region?
		if region and region.noteleport:
			if char.socket:
				char.socket.sysmessage(tr("Teleport is not allowed in that Region"))
			return

		if not self.consumerequirements(char, mode, args, target, item):
			return

		source = char.pos

		char.removefromview()
		char.moveto(target)
		char.update()
		if char.socket:
			char.socket.resendworld()

		smokepuff(char, source)
		smokepuff(char, target)
Пример #10
0
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
Пример #11
0
def where(socket, command, arguments):
    char = socket.player
    pos = char.pos
    region = wolfpack.region(pos.x, pos.y, pos.map)
    name = None

    if region and region.name and len(region.name) > 0:
        name = region.name

    multi = char.multi

    if multi and len(multi.name) > 0:
        if not name:
            name = multi.name
        else:
            name += ' (%s)' % multi.name

    if pos.map == 0:
        map = 'Felucca'
    elif pos.map == 1:
        map = 'Trammel'
    elif pos.map == 2:
        map = 'Ilshenar'
    elif pos.map == 3:
        map = 'Malas'
    else:
        map = 'Map %d' % pos.map

    if name:
        socket.sysmessage("You are in %s at %d,%d,%d on %s" %
                          (name, pos.x, pos.y, pos.z, map))
    else:
        socket.sysmessage("You are at %d,%d,%d on %s" %
                          (pos.x, pos.y, pos.z, map))

    return
Пример #12
0
	def target(self, char, mode, targettype, target, args, item):
		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

		region = wolfpack.region(char.pos.x, char.pos.y, char.pos.map)

		if region.nogate:
			char.message(501802)
			fizzle(char)
			return

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

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

		if region.nogate:
			char.message(1019004)
			fizzle(char)
			return

		if char.socket:
			char.socket.clilocmessage(501024)

		serials = []

		# Create the two gates
		gate1 = wolfpack.additem('f6c')
		gate1.moveto(char.pos)
		gate1.settag('dispellable_field', 1)
		gate1.addscript( 'magic.gate' )
		gate1.settag('target', str(location))
		gate1.update()
		gate1.soundeffect(0x20e)
		serials.append(gate1.serial)

		gate2 = wolfpack.additem('f6c')
		gate2.moveto(location)
		gate2.settag('target', '%u,%u,%d,%u' % (char.pos.x, char.pos.y, char.pos.z, char.pos.map))
		gate2.settag('dispellable_field', 1)
		gate2.addscript( 'magic.gate' )
		gate2.update()
		gate2.soundeffect(0x20e)
		serials.append(gate2.serial)
	
		gate1.settag('other_gate', gate2.serial)
		gate2.settag('other_gate', gate1.serial)

		wolfpack.addtimer(30000, field_expire, serials, 1)
Пример #13
0
    def target(self, char, mode, targettype, target, args, item):
        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

        region = wolfpack.region(char.pos.x, char.pos.y, char.pos.map)

        if region.nogate:
            char.message(501802)
            fizzle(char)
            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)

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

        if region.nogate:
            char.message(1019004)
            fizzle(char)
            return

        if char.socket:
            char.socket.clilocmessage(501024)

        serials = []

        # Create the two gates
        gate = wolfpack.additem("f6c")
        gate.moveto(char.pos)
        gate.settag("dispellable_field", 1)
        gate.addscript("magic.gate")
        gate.settag("target", target.gettag("location"))
        gate.update()
        gate.soundeffect(0x20E)
        serials.append(gate.serial)

        gate = wolfpack.additem("f6c")
        gate.moveto(location)
        gate.settag("target", "%u,%u,%d,%u" % (char.pos.x, char.pos.y, char.pos.z, char.pos.map))
        gate.settag("dispellable_field", 1)
        gate.addscript("magic.gate")
        gate.update()
        gate.soundeffect(0x20E)
        serials.append(gate.serial)

        wolfpack.addtimer(30000, "magic.utilities.field_expire", serials, 1)
Пример #14
0
	def target(self, char, mode, targettype, target, args, item):
		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))

		# Check if we can go there.
		if not isMapAvailableTo(char, location.map):
			return

		if not self.consumerequirements(char, mode, args, target, item):
			return

		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

		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

		# 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)
Пример #15
0
    def target(self, char, mode, targettype, target, args, item):
        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') and not target.hastag(
                    'recall.link'):
                char.message(502357)
                return

            if (not target.hastag('marked') or target.gettag('marked') != 1
                ) and not target.hastag('recall.link'):
                char.message(502354)
                return

            if target.hastag('recall.link'):
                litem = wolfpack.finditem(target.gettag('recall.link'))
                if not litem:
                    char.message(502357)
                    return
                else:
                    location = wolfpack.coord(litem.pos.x, litem.pos.y,
                                              litem.pos.z, litem.pos.map)
            else:
                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))

        # Check if we can go there.
        if not isMapAvailableTo(char, location.map):
            return

        if not self.consumerequirements(char, mode, args, target, item):
            return

        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

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

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

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

        # 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)
Пример #16
0
    def target(self, char, mode, targettype, target, args, item):
        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

        region = wolfpack.region(char.pos.x, char.pos.y, char.pos.map)

        if region.nogate:
            char.message(501802)
            fizzle(char)
            return

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

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

        if region.nogate:
            char.message(1019004)
            fizzle(char)
            return

        if char.socket:
            char.socket.clilocmessage(501024)

        serials = []

        # Create the two gates
        gate1 = wolfpack.additem('f6c')
        gate1.moveto(char.pos)
        gate1.settag('dispellable_field', 1)
        gate1.addscript('magic.gate')
        gate1.settag('target', str(location))
        gate1.update()
        gate1.soundeffect(0x20e)
        serials.append(gate1.serial)

        gate2 = wolfpack.additem('f6c')
        gate2.moveto(location)
        gate2.settag(
            'target',
            '%u,%u,%d,%u' % (char.pos.x, char.pos.y, char.pos.z, char.pos.map))
        gate2.settag('dispellable_field', 1)
        gate2.addscript('magic.gate')
        gate2.update()
        gate2.soundeffect(0x20e)
        serials.append(gate2.serial)

        gate1.settag('other_gate', gate2.serial)
        gate2.settag('other_gate', gate1.serial)

        wolfpack.addtimer(30000, field_expire, serials, 1)