def effect(self, char, target, mode, args, item): # Cures the target of poisons, but causes the caster to be burned by fire damage for 13-55 hit points. # The amount of fire damage is lessened if the caster has high Karma. chanceToCure = 10000 + char.skill[CHIVALRY] * 75 - ( (target.poison + 1) * 2000) chanceToCure /= 100 if chanceToCure > random.randint(0, 101): poison.cure(target) if not char == target and char.socket: char.socket.clilocmessage( 1010058) # You have cured the target of all poisons! if target.socket: target.socket.clilocmessage( 1010059) # You have been cured of all poisons. else: char.socket.clilocmessage( 1010060) # You have failed to cure your target! target.soundeffect(0x1e0) target.effect(0x373a, 1, 15, 3, 2) target.effect(0x374b, 5, 10, 63, 2) # should move from feet to head... char.soundeffect(0x208) char.effect(0x3709, 1, 30, 0, 7) damage = 50 - ComputePowerValue(char, 4) if damage < 13: damage = 13 elif damage > 55: damage = 55 char.damage(1, damage, char)
def target(self, char, mode, targettype, target, args, item): if not self.consumerequirements(char, mode, args, target, item): return char.turnto(target) char.soundeffect(0x299) cured = 0 # Enumerate chars chars = wolfpack.chars(target.x, target.y, char.pos.map, 3) for target in chars: # Check if we should affect the char if not mayAreaBenefit(char, target, includeinnocents = True): continue target.effect(0x373a, 10, 15) target.soundeffect(0x1e0) if target.poison != -1: chance = (10000 + int(char.skill[MAGERY] * 7.5) - ((target.poison + 1) * 1750)) / 10000.0 if chance >= random.random(): poison.cure(target) cured += 1 if target.socket: target.socket.clilocmessage(1010059) if cured > 0 and char.socket: char.socket.clilocmessage(1010058)
def target(self, char, mode, targettype, target, args, item): if not self.consumerequirements(char, mode, args, target, item): return char.turnto(target) char.soundeffect(0x299) cured = 0 # Enumerate chars chars = wolfpack.chars(target.x, target.y, char.pos.map, 3) for target in chars: target.effect(0x373A, 10, 15) target.soundeffect(0x1E0) if target.poison != -1: chance = (10000 + int(char.skill[MAGERY] * 7.5) - ((target.poison + 1) * 1750)) / 10000.0 if chance >= random.random(): poison.cure(target) cured += 1 if target.socket: target.socket.clilocmessage(1010059) if cured > 0: if char.socket: char.socket.clilocmessage(1010058)
def effect(self, char, target, mode, args, item): # Cures the target of poisons, but causes the caster to be burned by fire damage for 13-55 hit points. # The amount of fire damage is lessened if the caster has high Karma. chanceToCure = 10000 + char.skill[CHIVALRY] * 75 - ((target.poison + 1) * 2000); chanceToCure /= 100 if chanceToCure > random.randint(0, 101): poison.cure( target ) if not char == target and char.socket: char.socket.clilocmessage(1010058) # You have cured the target of all poisons! if target.socket: target.socket.clilocmessage( 1010059 ) # You have been cured of all poisons. else: char.socket.clilocmessage(1010060) # You have failed to cure your target! target.soundeffect( 0x1e0 ); target.effect(0x373a, 1, 15, 3, 2) target.effect(0x374b, 5, 10, 63, 2) # should move from feet to head... char.soundeffect( 0x208 ); char.effect(0x3709, 1, 30, 0, 7) damage = 50 - ComputePowerValue( char, 4 ) if damage < 13: damage = 13 elif damage > 55: damage = 55 char.damage(1, damage, char)
def target(self, char, mode, targettype, target, args, item): if not self.consumerequirements(char, mode, args, target, item): return char.turnto(target) char.soundeffect(0x299) cured = 0 # Enumerate chars chars = wolfpack.chars(target.x, target.y, char.pos.map, 3) for target in chars: # Check if we should affect the char if not mayAreaBenefit(char, target, includeinnocents=True): continue target.effect(0x373a, 10, 15) target.soundeffect(0x1e0) if target.poison != -1: chance = (10000 + int(char.skill[MAGERY] * 7.5) - ((target.poison + 1) * 1750)) / 10000.0 if chance >= random.random(): poison.cure(target) cured += 1 if target.socket: target.socket.clilocmessage(1010059) if cured > 0 and char.socket: char.socket.clilocmessage(1010058)
def potion( char, potion, curetype ): socket = char.socket if not canUsePotion( char, potion ): return False if char.poison == -1: # You are not poisoned. socket.clilocmessage( 1042000 ) return False if char.hasscript('magic.vampiricembrace'): char.socket.clilocmessage(1061652 ) # The garlic in the potion would surely kill you. return False if curetype == 4: curelevel = 0 elif curetype == 5: curelevel = 1 elif curetype == 6: curelevel = 2 if curelevel >= char.poison: poison.cure( char ) char.effect( 0x373a, 10, 15 ) char.soundeffect( 0x1e0 ) # curelevel now must be lower than char.poison else: chance = 0.0 if ( char.poison - curelevel ) == 1: chance = 0.5 elif ( char.poison - curelevel ) == 2: chance = 0.25 elif ( char.poison - curelevel ) == 3: chance = 0.1 if chance > random(): poison.cure(char) char.effect( 0x373a, 10, 15 ) char.soundeffect( 0x1e0 ) # Drinking and consume char.action( ANIM_FIDGET3 ) char.soundeffect( SOUND_DRINK1 ) consumePotion( char, potion, POTIONS[ curetype ][ POT_RETURN_BOTTLE ] ) # If we succeeded, special effects if char.poison == -1: char.effect( 0x373a, 10, 15 ) char.soundeffect( 0x1e0 ) socket.clilocmessage( 500231 ) # You feel cured of poison! else: socket.clilocmessage( 500232 ) # That potion was not strong enough to cure your ailment! return True
def effect(self, char, target, mode, args, item): if target.poison != -1: chance = (10000 + int(char.skill[MAGERY] * 7.5) - ((target.poison + 1) * 1750)) / 10000.0 if chance >= random.random(): poison.cure(target) if char != target and char.socket: char.socket.clilocmessage(1010058) if target.socket: target.socket.clilocmessage(1010059) else: if char.socket: char.socket.clilocmessage(1010060) target.effect(0x373a, 10, 15) target.soundeffect(0x1e0)
def cast(self, char, mode, args=[], target=None, item=None): if not self.consumerequirements(char, mode, args, target, item): return targets = [] chars = wolfpack.chars(char.pos.x, char.pos.y, char.pos.map, 3) for target in chars: if target.npc: continue if not char == target: targets.append(target) char.soundeffect(0x244) char.effect(0x3709, 1, 30, 5, 7) char.effect(0x376A, 1, 30, 5, 3) # Attempts to Resurrect, Cure and Heal all targets in a radius around the caster. # If any target is successfully assisted, the Paladin's current # Hit Points, Mana and Stamina are set to 1. # Amount of damage healed is affected by the Caster's Karma, from 8 to 24 hit points. sacrifice = False # TODO: Is there really a resurrection chance? resChance = 0.1 + (0.9 * (char.karma / 10000)) for target in targets: if char.dead: if char.region and char.region.name == "Khaldun": char.socket.clilocmessage( 1010395 ) # The veil of death in this area is too strong and resists thy efforts to restore life. elif resChance > Utility.RandomDouble(): target.effect(0x375A, 1, 15, 5, 3) # we need a resurrect gump here... #target.SendGump( new ResurrectGump( m, Caster ) ) sacrifice = True else: sendEffect = False if target.poison: poison.cure(target) if not target == char: char.socket.clilocmessage( 1010058 ) # You have cured the target of all poisons! if target.socket: target.socket.clilocmessage( 1010059) # You have been cured of all poisons. sendEffect = True sacrifice = True if target.hitpoints < target.maxhitpoints: toHeal = ComputePowerValue(10) + random.randint(0, 3) if toHeal < 8: toHeal = 8 elif toHeal > 24: toHeal = 24 if (char.hitpoints + toHeal) > char.maxhitpoints: char.hitpoints = char.maxhitpoints else: char.hitpoints += toHeal char.updatehealth() sendEffect = true # negative stat modifiers should be removed from the target if target.frozen: target.frozen = False target.resendtooltip() if target.hasscript('magic.evilomen'): target.dispel(target, True, 'EVILOMEN') sendEffect = True if target.hasscript('magic.strangle'): target.dispel(target, True, 'STRANGLE') sendEffect = True if target.hasscript('magic.corpseskin'): target.dispel(target, True, 'COPRSESKIN') sendEffect = True if sendEffect: target.effect(0x375A, 1, 15, 5, 3) sacrifice = True if sacrifice: char.soundeffect(0x423) char.hitpoints = 1 char.stamina = 1 char.mana = 1 char.updatestats()
def cast(self, char, mode, args=[], target=None, item=None): if not self.consumerequirements(char, mode, args, target, item): return targets = [] chars = wolfpack.chars(char.pos.x, char.pos.y, char.pos.map, 3) for target in chars: if target.npc: continue if not char == target: targets.append(target) char.soundeffect( 0x244 ) char.effect( 0x3709, 1, 30, 5, 7 ) char.effect( 0x376A, 1, 30, 5, 3 ) # Attempts to Resurrect, Cure and Heal all targets in a radius around the caster. # If any target is successfully assisted, the Paladin's current # Hit Points, Mana and Stamina are set to 1. # Amount of damage healed is affected by the Caster's Karma, from 8 to 24 hit points. sacrifice = False # TODO: Is there really a resurrection chance? resChance = 0.1 + (0.9 * (char.karma / 10000)) for target in targets: if char.dead: if char.region and char.region.name == "Khaldun": char.socket.clilocmessage( 1010395 ) # The veil of death in this area is too strong and resists thy efforts to restore life. elif resChance > Utility.RandomDouble(): target.effect( 0x375A, 1, 15, 5, 3 ) # we need a resurrect gump here... #target.SendGump( new ResurrectGump( m, Caster ) ) sacrifice = True else: sendEffect = False if target.poison: poison.cure( target ) if not target == char: char.socket.clilocmessage( 1010058 ) # You have cured the target of all poisons! if target.socket: target.socket.clilocmessage( 1010059 ) # You have been cured of all poisons. sendEffect = True sacrifice = True if target.hitpoints < target.maxhitpoints: toHeal = ComputePowerValue( 10 ) + random.randint( 0, 3 ) if toHeal < 8: toHeal = 8 elif toHeal > 24: toHeal = 24 if (char.hitpoints + toHeal) > char.maxhitpoints: char.hitpoints = char.maxhitpoints else: char.hitpoints += toHeal char.updatehealth() sendEffect = true # negative stat modifiers should be removed from the target if target.frozen: target.frozen = False target.resendtooltip() if target.hasscript('magic.evilomen'): target.dispel(target, True, 'EVILOMEN') sendEffect = True if target.hasscript('magic.strangle'): target.dispel(target, True, 'STRANGLE') sendEffect = True if target.hasscript('magic.corpseskin'): target.dispel(target, True, 'COPRSESKIN') sendEffect = True if sendEffect: target.effect( 0x375A, 1, 15, 5, 3 ) sacrifice = True if sacrifice: char.soundeffect( 0x423 ); char.hitpoints = 1 char.stamina = 1 char.mana = 1 char.updatestats()