def make(self, player, arguments, nodelay=0):
		assert(len(arguments) > 0, 'Arguments has to contain a tool reference.')

		if not checktool(player, wolfpack.finditem(arguments[0])):
			return False

		return CraftItemAction.make(self, player, arguments, nodelay)
	def make(self, player, arguments, nodelay=0, clothitem = None):
		global CLOTH

		# We have not been passed a cloth reference.
		# Try to statisfy it automatically
		if self.cloth > 0:
			if not clothitem:
				backpack = player.getbackpack()
				count = 0 # Valid piles of cloth
				for item in backpack.content:
					if item.baseid in CLOTH and item.amount >= self.cloth:
						clothitem = item
						count += 1
	
				# This makes the user select a pile of cloth
				if count > 1:
					player.socket.clilocmessage(502928) # Which material would you like to work ...
					player.socket.attachtarget('skills.tailoring.ClothSelectResponse', [self, arguments])
					return
				elif count < 1:
					player.socket.clilocmessage(1044456) # You don't have any ready cloth
					return

			# Pass the clothitem on to the next function as an argument
			if len(arguments) < 2:
				arguments.append(clothitem.serial)
			else:
				arguments[1] = clothitem.serial

		return CraftItemAction.make(self, player, arguments, nodelay)
Exemple #3
0
    def make(self, player, arguments, nodelay=0, clothitem=None):
        global CLOTH

        # We have not been passed a cloth reference.
        # Try to statisfy it automatically
        if self.cloth > 0:
            if not clothitem:
                backpack = player.getbackpack()
                count = 0  # Valid piles of cloth
                for item in backpack.content:
                    if item.baseid in CLOTH and item.amount >= self.cloth:
                        clothitem = item
                        count += 1

                # This makes the user select a pile of cloth
                if count > 1:
                    player.socket.clilocmessage(
                        502928)  # Which material would you like to work ...
                    player.socket.attachtarget(
                        'skills.tailoring.ClothSelectResponse',
                        [self, arguments])
                    return
                elif count < 1:
                    player.socket.clilocmessage(
                        1044456)  # You don't have any ready cloth
                    return

            # Pass the clothitem on to the next function as an argument
            if len(arguments) < 2:
                arguments.append(clothitem.serial)
            else:
                arguments[1] = clothitem.serial

        return CraftItemAction.make(self, player, arguments, nodelay)
    def make(self, player, arguments, nodelay=0):
        if self.useallres:
            found = False
            for item in player.getbackpack().content:
                if item.baseid == self.materials[0][0][0]:
                    found = True
                    nodelay = True
                    # stop if making fails
                    if not CraftItemAction.make(self, player, arguments, nodelay):
                        break

            if not found:
                # we have no material, but call make method do display error message
                # and reopen the crafting dialog
                return CraftItemAction.make(self, player, arguments, nodelay)

        else:
            return CraftItemAction.make(self, player, arguments, nodelay)
Exemple #5
0
    def make(self, player, arguments, nodelay=0):
        if self.useallres:
            found = False
            for item in player.getbackpack().content:
                if item.baseid == self.materials[0][0][0]:
                    found = True
                    nodelay = True
                    # stop if making fails
                    if not CraftItemAction.make(self, player, arguments,
                                                nodelay):
                        break

            if not found:
                # we have no material, but call make method do display error message
                # and reopen the crafting dialog
                return CraftItemAction.make(self, player, arguments, nodelay)

        else:
            return CraftItemAction.make(self, player, arguments, nodelay)
	def make(self, player, arguments, nodelay=0):
		assert(len(arguments) > 0, 'Arguments has to contain a tool reference.')

		# Look for forge and anvil
		if not checkanvilandforge(player):
			player.socket.clilocmessage(1044267)
			return False

		if not checktool(player, wolfpack.finditem(arguments[0])):
			return False

		return CraftItemAction.make(self, player, arguments, nodelay)
	def make(self, player, arguments, nodelay=0):
		assert(len(arguments) > 0, 'Arguments has to contain a tool reference.')

		return CraftItemAction.make(self, player, arguments, nodelay)
Exemple #8
0
    def make(self, player, arguments, nodelay=0):
        assert (len(arguments) > 0,
                'Arguments has to contain a tool reference.')

        return CraftItemAction.make(self, player, arguments, nodelay)