Esempio n. 1
0
def onUse(char, item):
    if not item.getoutmostchar() == char:
        char.socket.clilocmessage(
            1042001)  # That must be in your pack for you to use it.
        return True

    if char.incognito:
        char.socket.clilocmessage(
            501698)  # You cannot disguise yourself while incognitoed.
    elif char.polymorph:
        char.socket.clilocmessage(
            501699)  # You cannot disguise yourself while polymorphed.
    elif necromancy.transformed(char):
        char.socket.clilocmessage(
            501699)  # You cannot disguise yourself while polymorphed.
    # wearing an orkish kin mask
    elif char.itemonlayer(LAYER_HELM) and char.itemonlayer(
            LAYER_HELM).baseid == '141b':
        char.socket.clilocmessage(501605)  # You are already disguised.
    else:
        if char.gender:
            char.id = 184
        else:
            char.id = 183
        char.update()
        char.addtimer(duration, paint_expire, [], True, False, 'tribal_paint',
                      dispel_callback)
        char.socket.clilocmessage(
            1042537
        )  # You now bear the markings of the savage tribe.  Your body paint will last about a week or you can remove it with an oil cloth.
        item.delete()
    return True
Esempio n. 2
0
    def cast(self, char, mode, args=[], target=None, item=None):
        if not self.consumerequirements(char, mode, args, target, item):
            return False
        char.effect(0x37c4, 10, 7, 4, 3)
        char.soundeffect(0x299)
        char.effect(0x37c4, 1, 25, 14, 3)

        dispelSkill = ComputePowerValue(char, 2)

        chiv = char.skill[self.skill]

        chars = wolfpack.chars(char.pos.x, char.pos.y, char.pos.map, 8)
        for target in chars:
            if not target == char:
                dispellable = target.summoned  # and not target.IsAnimatedDead
                if dispellable:
                    dispelChance = (50.0 + (
                        (100 *
                         (chiv -
                          (target.getintproperty('dispeldifficulty', 1) / 10)))
                        / ((target.getintproperty('dispelfocus', 1) / 10) * 2))
                                    ) / 10
                    dispelChance *= dispelSkill / 100.0

                    if dispelChance > random.random():
                        target.pos.effect(0x3728, 8, 20)
                        target.pos.soundeffect(0x201)
                        target.delete()
                        continue

                # We have no "flee" method
                #evil = not target.owner and target.karma < 0

                #if evil:
                #	# TODO: Is this right?
                #	fleeChance = (100 - math.sqrt( target.fame / 2 )) * chiv * dispelSkill
                #	fleeChance /= 1000000

                #	if fleeChance > random.random():
                #		# guide says 2 seconds, it's longer
                #		target.BeginFlee( TimeSpan.FromSeconds( 30.0 ) )

            if necromancy.transformed(target):
                drainChance = 0.5 * (char.skill[self.skill] / max(
                    (target.skill[NECROMANCY] / 10), 1))

                if drainChance > random.random():
                    drain = (5 * dispelSkill) / 100

                    target.stamina -= drain
                    target.mana -= drain
Esempio n. 3
0
	def checkrequirements(self, char, mode, args=[], target=None, item=None):
		if char.polymorph:
			if char.socket:
				char.socket.clilocmessage(1005559)
			return 0
		if char.incognito:
			if char.socket:
				char.socket.clilocmessage(502167)
			return 0
		if necromancy.transformed(char):
			if char.socket:
				char.socket.clilocmessage(1061633 ) # You cannot polymorph while in that form.
			return 0
		if len(args) == 0:
			polymorph.showmenu(char)
			return 0
		return Spell.checkrequirements(self, char, mode, args, target, item)
Esempio n. 4
0
	def cast(self, char, mode, args=[], target=None, item=None):
		if not self.consumerequirements(char, mode, args, target, item):
			return False
		char.effect( 0x37c4, 10, 7, 4, 3 )
		char.soundeffect( 0x299 );
		char.effect( 0x37c4, 1, 25, 14, 3 )

		dispelSkill = ComputePowerValue( char, 2 )

		chiv = char.skill[self.skill]

		chars = wolfpack.chars(char.pos.x, char.pos.y, char.pos.map, 8)
		for target in chars:
			if not target == char:
				dispellable = target.summoned # and not target.IsAnimatedDead
				if dispellable:
					dispelChance = (50.0 + ((100 * (chiv - (target.getintproperty('dispeldifficulty', 1) / 10))) / ((target.getintproperty('dispelfocus', 1) / 10)*2))) / 10
					dispelChance *= dispelSkill / 100.0

					if dispelChance > random.random():
						target.pos.effect( 0x3728, 8, 20 )
						target.pos.soundeffect( 0x201 )
						target.delete()
						continue

				# We have no "flee" method
				#evil = not target.owner and target.karma < 0

				#if evil:
				#	# TODO: Is this right?
				#	fleeChance = (100 - math.sqrt( target.fame / 2 )) * chiv * dispelSkill
				#	fleeChance /= 1000000

				#	if fleeChance > random.random():
				#		# guide says 2 seconds, it's longer
				#		target.BeginFlee( TimeSpan.FromSeconds( 30.0 ) )

			if necromancy.transformed(target):
				drainChance = 0.5 * (char.skill[self.skill] / max( (target.skill[NECROMANCY]/10), 1 ))

				if drainChance >random.random():
					drain = (5 * dispelSkill) / 100

					target.stamina -= drain
					target.mana -= drain
Esempio n. 5
0
 def checkrequirements(self, char, mode, args=[], target=None, item=None):
     if char.polymorph:
         if char.socket:
             char.socket.clilocmessage(1005559)
         return 0
     if char.incognito:
         if char.socket:
             char.socket.clilocmessage(502167)
         return 0
     if necromancy.transformed(char):
         if char.socket:
             char.socket.clilocmessage(
                 1061633)  # You cannot polymorph while in that form.
         return 0
     if len(args) == 0:
         polymorph.showmenu(char)
         return 0
     return Spell.checkrequirements(self, char, mode, args, target, item)
def onUse( char, item ):
	if not item.getoutmostchar() == char:
		char.socket.clilocmessage( 1042001 ) # That must be in your pack for you to use it.
		return True

	if char.incognito:
		char.socket.clilocmessage( 501698 ) # You cannot disguise yourself while incognitoed.
	elif char.polymorph:
		char.socket.clilocmessage( 501699 ) # You cannot disguise yourself while polymorphed.
	elif necromancy.transformed(char):
		char.socket.clilocmessage( 501699 ) # You cannot disguise yourself while polymorphed.
	# wearing an orkish kin mask
	elif char.itemonlayer(LAYER_HELM) and char.itemonlayer(LAYER_HELM).baseid == '141b':
		char.socket.clilocmessage( 501605 ) # You are already disguised.
	else:
		if char.gender:
			char.id = 184
		else:
			char.id = 183
		char.update()
		char.addtimer( duration, paint_expire, [], True, False, 'tribal_paint', dispel_callback  )
		char.socket.clilocmessage( 1042537 ) # You now bear the markings of the savage tribe.  Your body paint will last about a week or you can remove it with an oil cloth.
		item.delete()
	return True