Exemple #1
0
    def checkmaterial(self, player, arguments, silent=0):
        result = CraftItemAction.checkmaterial(self, player, arguments, silent)
        if not result:
            return False

        if self.flour:
            found = False
            backpack = player.getbackpack()
            amount = 0
            for item in backpack.content:
                if item.baseid in flour and item.hastag('quantity'):
                    quantity = int(item.gettag('quantity'))
                    if quantity > 0:
                        amount += quantity
                        found = True
            if not found:
                if not silent:
                    player.socket.clilocmessage(
                        1044253
                    )  # You don't have the components needed to make that.
                return False

            if amount < self.flouramount:
                player.socket.sysmessage(
                    tr("You don't have enough material to make that."))
                return False

        # Check if we have enough water in our backpack
        if self.water:
            found = False  # Found at least one unit of water?
            backpack = player.getbackpack()
            for item in backpack.content:
                if item.hasscript('beverage') and item.gettag(
                        'fluid') == 'water' and item.hastag('quantity'):
                    quantity = int(item.gettag('quantity'))
                    if quantity > 0:
                        found = True
                        break

            if not found:
                if not silent:
                    player.socket.clilocmessage(
                        1044253
                    )  # You don't have the components needed to make that.
                return False

        if self.needheat and not find(player, fires):
            player.socket.clilocmessage(
                1044487)  # You must be near a fire source to cook.
            return False

        if self.needoven and not find(player, ovens):
            player.socket.clilocmessage(
                1044493)  # You must be near an oven to bake that.
            return False

        return result
	def checkmaterial(self, player, arguments, silent = 0):
		result = CraftItemAction.checkmaterial(self, player, arguments, silent)
		
		if result:
			# Check for mana
			if self.mana > 0 and player.mana < self.mana:
				player.socket.clilocmessage(1044380) # You don't have enough mana to inscribe that spell.
				return False
			
			# Check for availability of spell
			if self.spellid > 0 and not magic.utilities.hasSpell(player, self.spellid - 1, False):
				return False
		
		return result
Exemple #3
0
	def checkmaterial(self, player, arguments, silent = 0):
		result = CraftItemAction.checkmaterial(self, player, arguments, silent)
		
		if result:
			# Check for mana
			if self.mana > 0 and player.mana < self.mana:
				player.socket.clilocmessage(1044380) # You don't have enough mana to inscribe that spell.
				return False
			
			# Check for availability of spell
			if self.spellid > 0 and not hasSpell(player, self.spellid - 1, False):
				return False
		
		return result
    def checkmaterial(self, player, arguments, silent=0):
        result = CraftItemAction.checkmaterial(self, player, arguments, silent)
        if not result:
            return False

        if self.flour:
            found = False
            backpack = player.getbackpack()
            amount = 0
            for item in backpack.content:
                if item.baseid in flour and item.hastag("quantity"):
                    quantity = int(item.gettag("quantity"))
                    if quantity > 0:
                        amount += quantity
                        found = True
            if not found:
                if not silent:
                    player.socket.clilocmessage(1044253)  # You don't have the components needed to make that.
                return False

            if amount < self.flouramount:
                player.socket.sysmessage(tr("You don't have enough material to make that."))
                return False

                # Check if we have enough water in our backpack
        if self.water:
            found = False  # Found at least one unit of water?
            backpack = player.getbackpack()
            for item in backpack.content:
                if item.hasscript("beverage") and item.gettag("fluid") == "water" and item.hastag("quantity"):
                    quantity = int(item.gettag("quantity"))
                    if quantity > 0:
                        found = True
                        break

            if not found:
                if not silent:
                    player.socket.clilocmessage(1044253)  # You don't have the components needed to make that.
                return False

        if self.needheat and not find(player, fires):
            player.socket.clilocmessage(1044487)  # You must be near a fire source to cook.
            return False

        if self.needoven and not find(player, ovens):
            player.socket.clilocmessage(1044493)  # You must be near an oven to bake that.
            return False

        return result
	def checkmaterial(self, player, arguments, silent = 0):
		result = CraftItemAction.checkmaterial(self, player, arguments, silent)
		
		# Check for cloth
		if result and self.cloth > 0:
			assert(len(arguments) >= 2)
			cloth = wolfpack.finditem(arguments[1])
			if not player.canreach(cloth, -1):
				player.socket.clilocmessage(1044456) # You don't have any ready cloth...
				return False
			elif cloth.amount < self.cloth:
				player.socket.clilocmessage(1044287) # You don't have enough...
				return False
		
		return result
	def checkmaterial(self, player, arguments, silent = 0):
		result = CraftItemAction.checkmaterial(self, player, arguments, silent)
		
		# Check for runes
		backpack = player.getbackpack()
		if result and self.runes > 0:
			runes = 0
			for item in backpack.content:
				if item.baseid in ['1f14', '1f15', '1f16', '1f17'] and not item.hastag('location') and item.gettag('marked') == 0:
					runes += 1
					if runes >= self.runes:
						return True
						
			player.socket.clilocmessage(1044253)
			return False
		
		return result
Exemple #7
0
	def checkmaterial(self, player, arguments, silent = 0):
		result = CraftItemAction.checkmaterial(self, player, arguments, silent)
		
		# Check for runes
		backpack = player.getbackpack()
		if result and self.runes > 0:
			runes = 0
			for item in backpack.content:
				if item.baseid in ['1f14', '1f15', '1f16', '1f17'] and not item.hastag('location') and item.gettag('marked') == 0:
					runes += 1
					if runes >= self.runes:
						return True
						
			player.socket.clilocmessage(1044253)
			return False
		
		return result
Exemple #8
0
    def checkmaterial(self, player, arguments, silent=0):
        result = CraftItemAction.checkmaterial(self, player, arguments, silent)

        # Check for cloth
        if result and self.cloth > 0:
            assert (len(arguments) >= 2)
            cloth = wolfpack.finditem(arguments[1])
            if not player.canreach(cloth, -1):
                player.socket.clilocmessage(
                    1044456)  # You don't have any ready cloth...
                return False
            elif cloth.amount < self.cloth:
                player.socket.clilocmessage(
                    1044287)  # You don't have enough...
                return False

        return result
	def checkmaterial(self, player, arguments, silent = 0):
		result = CraftItemAction.checkmaterial(self, player, arguments, silent)
		
		# Check if we have enough water in our backpack
		if result and self.water:
			found = False # Found at laest one unit of water?
			backpack = player.getbackpack()
			for item in backpack.content:
				if item.hasscript('beverage') and item.gettag('fluid') == 'water' and item.hastag('quantity'):
					quantity = int(item.gettag('quantity'))
					if quantity > 0:
						found = True
						break
						
			if not found:
				if not silent:
					player.socket.clilocmessage(1044253) # You don't have the components needed to make that.
				return False

		return result