示例#1
0
    def effect(self, char, target, mode, args, item):
        # Remove an old bonus
        if target.hastag('nightsight'):
            bonus = target.gettag('nightsight')
            target.lightbonus = max(0, target.lightbonus - bonus)

        # With 100% magery you gain a 18 light level bonus
        bonus = max(8, min(18, math.floor(18 * (char.skill[MAGERY] / 1000.0))))

        target.addscript('magic.nightsight')
        target.settag("nightsight", bonus)
        target.settag("nightsight_start", time.minutes())
        target.lightbonus += bonus

        if target.socket:
            target.socket.updatelightlevel()

        target.soundeffect(0x1e3)
        target.effect(0x376a, 9, 32)
示例#2
0
	def effect(self, char, target, mode, args, item):
		# Remove an old bonus
		if target.hastag('nightsight'):
			bonus = target.gettag('nightsight')
			target.lightbonus = max(0, target.lightbonus - bonus)

		# With 100% magery you gain a 18 light level bonus
		bonus = min(18, math.floor(18 * (char.skill[MAGERY] / 1000.0)))

		target.addscript( 'magic.nightsight' )
		target.settag("nightsight", bonus)
		target.settag("nightsight_start", time.minutes())
		target.lightbonus += bonus

		if target.socket:
			target.socket.updatelightlevel()

		target.soundeffect(0x1e3)
		target.effect(0x376a, 9, 32)
示例#3
0
def nightsightPotion( char, potion ):
	socket = char.socket
	# Remove an old bonus
	if char.hastag('nightsight'):
		bonus = char.gettag('nightsight')
		char.lightbonus = max(0, char.lightbonus - bonus)

	# With 100% magery you gain a 18 light level bonus
	bonus = min(18, math.floor(18 * (char.skill[MAGERY] / 1000.0)))

	char.addscript( 'magic.nightsight' )
	char.settag( 'nightsight', bonus)
	char.settag( 'nightsight_start', time.minutes())
	char.lightbonus += bonus

	if char.socket:
		socket.updatelightlevel()

	char.soundeffect(0x1e3)
	char.effect(0x376a, 9, 32)
	consumePotion( char, potion, POTIONS[ potion.gettag('potiontype') ][ POT_RETURN_BOTTLE ] )
	return True
示例#4
0
def uotime(socket, command, arguments):
	socket.sysmessage('Current Time: %02u:%02u' % (time.hour(), time.minute()))
	socket.sysmessage('Elapsed Minutes: %u. Elapsed Days: %u.' % (time.minutes(), time.days()))
	socket.sysmessage('Current Lightlevel: %u' % (time.currentlightlevel()))