[wpdev-commits] xmlscripts/scripts bandages.py,1.8,1.9
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-08-31 22:10:17
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27489/scripts Modified Files: bandages.py Log Message: Fixes from spddmn Index: bandages.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/bandages.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** bandages.py 9 Jul 2004 21:47:45 -0000 1.8 --- bandages.py 31 Aug 2004 22:10:08 -0000 1.9 *************** *** 3,7 **** import random import wolfpack.utilities ! from wolfpack.consts import HEALING, ANATOMY --- 3,7 ---- import random import wolfpack.utilities ! from wolfpack.consts import HEALING, ANATOMY, VETERINARY, ANIMALLORE *************** *** 91,104 **** return 0 - # No resurrection feature in yet - if target.dead: - char.socket.sysmessage( 'You can''t heal a ghost.' ) - return 0 - - if target.poison != -1: - char.socket.clilocmessage(1010060) - # Already at full health ! if target.health >= target.strength: if target == char: char.socket.sysmessage( 'You are healthy.' ) --- 91,96 ---- return 0 # Already at full health ! if not target.poison and target.health >= target.maxhitpoints: if target == char: char.socket.sysmessage( 'You are healthy.' ) *************** *** 129,132 **** --- 121,132 ---- return + if target.char and target.char.dead and ( char.skill[ HEALING ] < 800 or char.skill[ ANATOMY ] < 800 ): + char.socket.sysmessage( 'You are not skilled enough to resurrect.' ) + return + + if target.char and target.char.poison and ( char.skill[ HEALING ] < 600 or char.skill[ ANATOMY ] < 600 ): + char.socket.sysmessage( 'You are not skilled enough to cure poison.' ) + return + # Consume Bandages bandages = wolfpack.finditem( args[0] ) *************** *** 147,171 **** # SkillCheck (0% to 80%) ! if not corpse: success = char.checkskill( HEALING, 0, 800 ) ! else: reschance = int( ( char.skill[ HEALING ] + char.skill[ ANATOMY ] ) * 0.17 ) rescheck = random.randint( 1, 100 ) ! ! if char.checkskill( HEALING, 800, 1000 ) and char.checkskill( ANATOMY, 800, 1000 ) and reschance < rescheck: success = 1 ! char.action( 0x09 ) if corpse: char.addtimer( random.randint( 2500, 5000 ), 'bandages.bandage_timer', [ 1, success, target.item.serial, baseid ] ) # It takes 5 seconds to bandage else: ! if char == target.char: char.socket.sysmessage( 'You start applying bandages on yourself' ) else: char.socket.sysmessage( 'You start applying bandages on %s' % target.char.name ) char.turnto( target.char ) ! ! char.addtimer( random.randint( 1500, 2500 ), 'bandages.bandage_timer', [ 0, success, target.char.serial, baseid ] ) # It takes 5 seconds to bandage char.socket.settag( 'using_bandages', 1 ) --- 147,182 ---- # SkillCheck (0% to 80%) ! if not corpse and not target.char.dead and not target.char.poison: success = char.checkskill( HEALING, 0, 800 ) ! elif corpse or target.char.dead: reschance = int( ( char.skill[ HEALING ] + char.skill[ ANATOMY ] ) * 0.17 ) rescheck = random.randint( 1, 100 ) ! if char.checkskill( HEALING, 800, 1000 ) and char.checkskill( ANATOMY, 800, 1000 ) and reschance > rescheck: ! success = 1 ! else: # must be poisoned ! reschance = int( ( char.skill[ HEALING ] + char.skill[ ANATOMY ] ) * 0.27 ) ! rescheck = random.randint( 1, 100 ) ! if char.checkskill( HEALING, 600, 1000 ) and char.checkskill( ANATOMY, 600, 1000 ) and reschance > rescheck: success = 1 ! ! #this is non osi, but cool! ! #char.action( 0x09 ) if corpse: char.addtimer( random.randint( 2500, 5000 ), 'bandages.bandage_timer', [ 1, success, target.item.serial, baseid ] ) # It takes 5 seconds to bandage else: ! if target.char.dead: ! target.char.socket.sysmessage( char.name + ' begins applying a bandage to you.' ) ! char.addtimer( random.randint( 2500, 5000 ), 'bandages.bandage_timer', [ 2, success, target.char.serial, baseid ] ) # It takes 5 seconds to bandage ! elif char == target.char: char.socket.sysmessage( 'You start applying bandages on yourself' ) + char.addtimer( random.randint( 1500, 2500 ), 'bandages.bandage_timer', [ 0, success, target.char.serial, baseid ] ) # It takes 5 seconds to bandage else: char.socket.sysmessage( 'You start applying bandages on %s' % target.char.name ) + if target.char.player: + target.char.socket.sysmessage( char.name + ' begins applying a bandage to you.' ) char.turnto( target.char ) ! char.addtimer( random.randint( 1500, 2500 ), 'bandages.bandage_timer', [ 0, success, target.char.serial, baseid ] ) # It takes 5 seconds to bandage char.socket.settag( 'using_bandages', 1 ) *************** *** 178,183 **** baseid = args[3] ! # Corpse Target ! if resurrect: target = wolfpack.finditem( args[2] ) --- 189,195 ---- baseid = args[3] ! ! if resurrect == 1: ! # Corpse Target target = wolfpack.finditem( args[2] ) *************** *** 215,249 **** target = wolfpack.findchar( args[2] ) if not validCharTarget( char, target ): return ! if not success: ! if target != char: ! char.socket.sysmessage( 'You fail applying bandages to %s.' % target.name ) ! else: ! char.socket.sysmessage( 'You fail applying bandages to yourself.' ) ! return ! # Human target ? ! if target.id == 0x190 or target.id == 0x191: ! firstskill = HEALING ! secondskill = ANATOMY else: ! firstskill = VETERINARY ! secondskill = ANIMALLORE ! # Heal a bit ! healmin = int( char.skill[ firstskill ] / 5 ) + int( char.skill[ secondskill ] / 5 ) + 3 ! healmax = int( char.skill[ firstskill ] / 5 ) + int( char.skill[ secondskill ] / 2 ) + 10 ! amount = random.randint( healmin, healmax ) ! target.health = min( target.maxhitpoints, target.health + amount ) ! target.updatehealth() ! if char == target: ! char.socket.sysmessage( 'You successfully apply bandages on yourself.' ) ! else: ! char.socket.sysmessage( 'You successfully apply bandages on %s' % target.name ) # Create bloody bandages --- 227,282 ---- target = wolfpack.findchar( args[2] ) + if not validCharTarget( char, target ): return + + if target.dead: + if not success: + char.socket.sysmessage( 'You fail to resurrect the target.' ) + return ! target.resurrect() ! target.update() ! char.socket.sysmessage( 'You successfully resurrect ' + target.name ) ! elif target.poison: ! if not success: ! char.socket.sysmessage( 'You fail to cure the target.' ) ! char.socket.clilocmessage(1010060) ! return ! ! target.poison=-1 ! target.update() ! ! char.socket.sysmessage( 'You successfully cured ' + target.name ) else: ! if not success: ! if target != char: ! char.socket.sysmessage( 'You fail applying bandages to %s.' % target.name ) ! else: ! char.socket.sysmessage( 'You fail applying bandages to yourself.' ) ! return ! # Human target ? ! if target.id == 0x190 or target.id == 0x191: ! firstskill = HEALING ! secondskill = ANATOMY ! else: ! firstskill = VETERINARY ! secondskill = ANIMALLORE ! # Heal a bit ! healmin = int( char.skill[ firstskill ] / 5 ) + int( char.skill[ secondskill ] / 5 ) + 3 ! healmax = int( char.skill[ firstskill ] / 5 ) + int( char.skill[ secondskill ] / 2 ) + 10 ! amount = random.randint( healmin, healmax ) ! target.health = min( target.maxhitpoints, target.health + amount ) ! target.updatehealth() ! ! if char == target: ! char.socket.sysmessage( 'You successfully apply bandages on yourself.' ) ! else: ! char.socket.sysmessage( 'You successfully apply bandages on %s' % target.name ) # Create bloody bandages *************** *** 257,259 **** item = wolfpack.additem( 'e22' ) if not wolfpack.utilities.tobackpack( item, char ): ! item.update() --- 290,292 ---- item = wolfpack.additem( 'e22' ) if not wolfpack.utilities.tobackpack( item, char ): ! item.update() \ No newline at end of file |