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: # 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) # Enumerate chars chars = wolfpack.chars(target.x, target.y, char.pos.map, 3) for target in chars: if not target.player: continue # Check if we should affect the char if not mayAreaBenefit(char, target): continue # Toggle Protection if target.propertyflags & 0x20000: target.propertyflags &= ~0x20000 target.effect(0x375a, 9, 20) target.soundeffect(0x1ed) try: if target.hastag('protection_skill'): skill = int(target.gettag('protection_skill')) if target.skill[ MAGICRESISTANCE] + skill > target.skillcap[ MAGICRESISTANCE]: target.skill[MAGICRESISTANCE] = target.skillcap[ MAGICRESISTANCE] else: target.skill[MAGICRESISTANCE] += skill except: pass target.deltag('protection_skill') else: target.propertyflags |= 0x20000 target.effect(0x375a, 9, 20) target.soundeffect(0x1e9) # Remove Magic Resistance Skill amount = 35 - int(target.skill[INSCRIPTION] / 200) if target.skill[MAGICRESISTANCE] - amount < 0: amount = target.skill[MAGICRESISTANCE] target.settag('protection_skill', amount) target.skill[MAGICRESISTANCE] -= amount if target.socket: target.socket.resendstatus()
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) # Enumerate chars chars = wolfpack.chars(target.x, target.y, char.pos.map, 3) for target in chars: if not target.player: continue # Check if we should affect the char if not mayAreaBenefit(char, target): continue # Toggle Protection if target.propertyflags & 0x20000: target.propertyflags &= ~ 0x20000 target.effect(0x375a, 9, 20) target.soundeffect(0x1ed) try: if target.hastag('protection_skill'): skill = int(target.gettag('protection_skill')) if target.skill[MAGICRESISTANCE] + skill > target.skillcap[MAGICRESISTANCE]: target.skill[MAGICRESISTANCE] = target.skillcap[MAGICRESISTANCE] else: target.skill[MAGICRESISTANCE] += skill except: pass target.deltag('protection_skill') else: target.propertyflags |= 0x20000 target.effect(0x375a, 9, 20) target.soundeffect(0x1e9) # Remove Magic Resistance Skill amount = 35 - int(target.skill[INSCRIPTION] / 200) if target.skill[MAGICRESISTANCE] - amount < 0: amount = target.skill[MAGICRESISTANCE] target.settag('protection_skill', amount) target.skill[MAGICRESISTANCE] -= amount if target.socket: target.socket.resendstatus()