示例#1
0
def carve_corpse( char, corpse ):
	if corpse.container:
		char.socket.sysmessage( "You can't carve corpses in a container" )
		return

	if not char.canreach(corpse, 3):
		char.socket.clilocmessage( 0x7A258, "", 0x3b2, 3, corpse ) # You cannot reach that
		return

	# Human Bodies can always be carved
	if corpse.bodyid == 0x190 or corpse.bodyid == 0x191:
		char.message( "You can't carve a human body right now" )
		return

	# Not carvable or already carved
	try:
		charbase = wolfpack.charbase(corpse.charbaseid)
		carve = charbase['carve']
	except:
		char.socket.clilocmessage( 0x7A305, "", 0x3b2, 3, corpse ) # You see nothing useful to carve..
		return

	if corpse.hastag('carved') or carve == '':
		char.socket.clilocmessage( 0x7A305, "", 0x3b2, 3, corpse ) # You see nothing useful to carve..
		return

	# Create all items in the carve list
	carve = wolfpack.list(str(carve))

	for id in carve:
		amount = 1
		# Is amount contained in it ?
		if id.find( "," ) != -1:
			parts = id.split( "," )
			id = parts[0]
			amount = int( parts[1] )

		item = wolfpack.additem( id )
		item.amount = amount
		if not utilities.tocontainer( item, corpse ):
			item.update()

	# Create Random Blood
	bloodid = whrandom.choice( blood )
	blooditem = wolfpack.additem( bloodid )
	blooditem.moveto( corpse.pos )
	blooditem.decay = 1
	blooditem.update()

	char.socket.clilocmessage( 0x7A2F3, "", 0x3b2, 3, corpse ) # You carve away some meat which remains on the corpse
	corpse.settag('carved', 1)
def playhurtsound(defender):
	if defender.id == 0x190:
		# Play a random soundeffect for a human male defender
		sounds = wolfpack.list('SOUNDS_COMBAT_HIT_HUMAN_MALE')

		if len(sounds) > 0:
			sound = hex2dec(random.choice(sounds))
			defender.soundeffect(sound)
		else:
			defender.soundeffect(0x156)

	elif defender.id == 0x191:
		# Play a random soundeffect for a human female defender
		sounds = wolfpack.list('SOUNDS_COMBAT_HIT_HUMAN_FEMALE')

		if len(sounds) > 0:
			sound = hex2dec(random.choice(sounds))
			defender.soundeffect(sound)
		else:
			defender.soundeffect(0x14b)
	else:
		# A standard monster defend sound
		defender.sound(SND_DEFEND)
示例#3
0
def playhurtsound(defender):
	if defender.id in PLAYER_BODIES_ALIVE_MALE:
		# Play a random soundeffect for a human male defender
		sounds = wolfpack.list('SOUNDS_COMBAT_HIT_HUMAN_MALE')

		if len(sounds) > 0:
			sound = hex2dec(random.choice(sounds))
			defender.soundeffect(sound)
		else:
			defender.soundeffect(0x156)

	elif defender.id == PLAYER_BODIES_ALIVE_FEMALE:
		# Play a random soundeffect for a human female defender
		sounds = wolfpack.list('SOUNDS_COMBAT_HIT_HUMAN_FEMALE')

		if len(sounds) > 0:
			sound = hex2dec(random.choice(sounds))
			defender.soundeffect(sound)
		else:
			defender.soundeffect(0x14b)
	else:
		# A standard monster defend sound
		defender.sound(SND_DEFEND)
示例#4
0
    def cast(self, char, mode, args=[], target=None, item=None):
        if char.incognito or char.polymorph:
            char.socket.clilocmessage(1005559)
            return

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

        char.orgid = char.id
        if char.id in PLAYER_BODIES_ALIVE_HUMAN:
            char.id = random.choice(PLAYER_BODIES_ALIVE_HUMAN)
        elif char.id in PLAYER_BODIES_ALIVE_ELVEN:
            char.id = random.choice(PLAYER_BODIES_ALIVE_ELVEN)
        else:
            return

        duration = int(1 + (6 * char.skill[MAGERY]) / 50.0) * 1000

        char.orgskin = char.skin
        char.skin = random.randint(1002, 1058)

        char.orgname = char.name

        newbeard = ''
        newhair = ''
        newhaircolor = random.randint(1102, 1150)

        if char.id in PLAYER_BODIES_ALIVE_MALE:
            char.name = random.choice(wolfpack.list("NAMES_MALE"))

            # Create new hair
            if char.id in PLAYER_BODIES_ALIVE_ELVEN:
                # All Elven get hair
                newhair = random.choice(wolfpack.list("HAIR_ELF"))
            else:
                # Most Humans get hair
                if random.random() > 0.1:
                    newhair = random.choice(wolfpack.list("HAIR"))
                # Some Humans get a beard
                if random.random() > 0.5:
                    newbeard = random.choice(wolfpack.list("FACIAL_HAIR"))
        else:
            char.name = random.choice(wolfpack.list("NAMES_FEMALE"))

            # Create new hair
            if char.id in PLAYER_BODIES_ALIVE_ELVEN:
                # All Elven get hair
                newhair = random.choice(wolfpack.list("HAIR_ELF"))
            else:
                # All Human Females get hair
                newhair = random.choice(wolfpack.list("HAIR_FEMALE"))

        hair = char.itemonlayer(LAYER_HAIR)
        if hair:
            hairid = hair.baseid
            haircolor = hair.color
            hair.delete()
        else:
            hairid = ''
            haircolor = 0

        beard = char.itemonlayer(LAYER_BEARD)
        if beard:
            facialid = beard.baseid
            facialcolor = beard.color
            beard.delete()
        else:
            facialid = ''
            facialcolor = 0

        if newhair != '':
            hair = wolfpack.additem(newhair)
            hair.color = newhaircolor
            char.additem(LAYER_HAIR, hair)

        if newbeard != '':
            beard = wolfpack.additem(newbeard)
            beard.color = newhaircolor
            char.additem(LAYER_BEARD, beard)

        if hair:
            hair.update()
        if beard:
            beard.update()

        char.incognito = 1

        char.update()
        char.resendtooltip()
        char.addtimer(duration, incognito_expire,
                      [hairid, haircolor, facialid, facialcolor], 1)

        char.effect(0x373A, 10, 15)
        char.soundeffect(0x3bd)
示例#5
0
	def cast(self, char, mode, args=[], target=None, item=None):
		if char.incognito or char.polymorph:
			char.socket.clilocmessage(1005559)
			return

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

		char.orgid = char.id
		if char.id in PLAYER_BODIES_ALIVE_HUMAN:
			char.id = random.choice( PLAYER_BODIES_ALIVE_HUMAN )
		elif char.id in PLAYER_BODIES_ALIVE_ELVEN:
			char.id = random.choice( PLAYER_BODIES_ALIVE_ELVEN )
		else:
			return

		duration = int(1 + (6 * char.skill[MAGERY]) / 50.0) * 1000

		char.orgskin = char.skin
		char.skin = random.randint(1002, 1058)

		char.orgname = char.name

		newbeard = ''
		newhair = ''
		newhaircolor = random.randint(1102, 1150)

		if char.id in PLAYER_BODIES_ALIVE_MALE:
			char.name = random.choice( wolfpack.list( "NAMES_MALE" ) )

			# Create new hair
			if char.id in PLAYER_BODIES_ALIVE_ELVEN:
				# All Elven get hair
				newhair = random.choice( wolfpack.list( "HAIR_ELF" ) )
			else:
				# Most Humans get hair
				if random.random() > 0.1:		
					newhair = random.choice( wolfpack.list( "HAIR" ) )
				# Some Humans get a beard
				if random.random() > 0.5:		
					newbeard = random.choice( wolfpack.list( "FACIAL_HAIR" ) )
		else:
			char.name = random.choice( wolfpack.list( "NAMES_FEMALE" ) )

			# Create new hair
			if char.id in PLAYER_BODIES_ALIVE_ELVEN:
				# All Elven get hair
				newhair = random.choice( wolfpack.list( "HAIR_ELF" ) )
			else:
				# All Human Females get hair
				newhair = random.choice( wolfpack.list( "HAIR_FEMALE" ) )

		hair = char.itemonlayer(LAYER_HAIR)
		if hair:
			hairid = hair.baseid
			haircolor = hair.color
			hair.delete()
		else:
			hairid = ''
			haircolor = 0

		beard = char.itemonlayer(LAYER_BEARD)
		if beard:
			facialid = beard.baseid
			facialcolor = beard.color
			beard.delete()
		else:
			facialid = ''
			facialcolor = 0

		if newhair != '':
			hair = wolfpack.additem(newhair)
			hair.color = newhaircolor
			char.additem(LAYER_HAIR, hair)

		if newbeard != '':
			beard = wolfpack.additem(newbeard)
			beard.color = newhaircolor
			char.additem(LAYER_BEARD, beard)

		if hair:
			hair.update()
		if beard:
			beard.update()

		char.incognito = 1

		char.update()
		char.resendtooltip()
		char.addtimer(duration, incognito_expire, [hairid, haircolor, facialid, facialcolor], 1)

		char.effect(0x373A, 10, 15)
		char.soundeffect(0x3bd)
示例#6
0
	def cast(self, char, mode, args=[], target=None, item=None):
		if char.incognito or char.polymorph:
			char.socket.clilocmessage(1005559)
			return

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

		duration = int(1 + (6 * char.skill[MAGERY]) / 50.0) * 1000

		char.orgskin = char.skin
		char.skin = random.randint(1002, 1059)

		char.orgid = char.id
		char.id = random.choice([0x190, 0x191])

		char.orgname = char.name

		newbeard = ''
		newhair = ''
		newhaircolor = random.randint(1102, 1150)

		if char.id == 0x190:
			char.name = random.choice( wolfpack.list( "NAMES_MALE" ) )

			# Create new hair
			newhair = random.choice(['2044', '2045', '2046', '203c', '203b', '203d', '2047', '2048', '2049', '204a', ''])
			newbeard = random.choice(['203e', '203f', '2040', '2041', '204b', '204c', '204d', ''])
		else:
			char.name = random.choice( wolfpack.list( "NAMES_FEMALE" ) )
			newhair = random.choice(['2044', '2045', '2046', '203c', '203b', '203d', '2047', '2048', '2049', '204a', ''])

		hair = char.itemonlayer(LAYER_HAIR)
		if hair:
			hairid = hair.baseid
			haircolor = hair.color
			hair.delete()
		else:
			hairid = ''
			haircolor = 0

		beard = char.itemonlayer(LAYER_BEARD)
		if beard:
			facialid = beard.baseid
			facialcolor = beard.color
			beard.delete()
		else:
			facialid = ''
			facialcolor = 0

		if newhair != '':
			hair = wolfpack.additem(newhair)
			hair.color = newhaircolor
			char.additem(LAYER_HAIR, hair)

		if newbeard != '':
			beard = wolfpack.additem(newbeard)
			beard.color = newhaircolor
			char.additem(LAYER_BEARD, beard)

		hair.update()
		beard.update()

		char.incognito = 1

		char.update()
		char.resendtooltip()
		char.addtimer(duration, "magic.circle5.incognito_expire", [hairid, haircolor, facialid, facialcolor], 1)

		char.effect(0x373A, 10, 15)
		char.soundeffect(0x3bd)