[wpdev-commits] xmlscripts/scripts/skills poisoning.py,1.8,1.9
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-10-24 23:12:27
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21828/skills Modified Files: poisoning.py Log Message: poisoning fix Index: poisoning.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/poisoning.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** poisoning.py 13 Oct 2004 19:47:48 -0000 1.8 --- poisoning.py 24 Oct 2004 23:12:18 -0000 1.9 *************** *** 16,19 **** --- 16,23 ---- POISONING_DELAY = 1000 + # Min/Max-Skills for the various poison levels + MINSKILLS = [0, 300, 600, 950] + MAXSKILLS = [600, 700, 1000, 1000] + # Button for AnimalTaming pressed on skill gump def poisoning( char, skill ): *************** *** 42,45 **** --- 46,52 ---- char.socket.attachtarget( "skills.poisoning.selecttarget", [ potion.serial ] ) return 1 + + # Check for the following weapons: Butchers Knife, Cleaver, Dagger, Double Bladed Staff, Pike, Kryss + ALLOWED = [ 0x13f6, 0x13f7, 0xec2, 0xec3, 0xf51, 0xf52, 0x26bf, 0x26c9, 0x26be, 0x26c8, 0x1400, 0x1401 ] def selecttarget( char, args, target ): *************** *** 53,73 **** return - # target item must exists in backpack - #if not target.item.getoutmostitem() == char.backpack: - # char.socket.clilocmessage( 500295 ) - # return - - # check target type : food / blades if not target.item: char.socket.clilocmessage( 502145 ) return ! if not ( target.item.hasscript( 'food' ) or target.item.hasscript( 'blades' ) ): ! char.socket.clilocmessage( 502145 ) return ! ! # already poisoned ! #if target.hastag( 'poisoning' ): ! # return ! # sound / effect char.soundeffect( 0x4F ) --- 60,72 ---- return if not target.item: char.socket.clilocmessage( 502145 ) return ! ! global ALLOWED ! if not target.item.id in ALLOWED: ! char.socket.clilocmessage(1060204) return ! # sound / effect char.soundeffect( 0x4F ) *************** *** 84,89 **** skill = char.skill[ POISONING ] ! # poison strength : lesser(1), normal, greater, deadly(4) ! strength = int( potion.gettag( 'potiontype' ) ) - 13 # consume the potion / add a blank bottle --- 83,88 ---- skill = char.skill[ POISONING ] ! # poison strength : lesser(0), normal, greater, deadly(3) ! strength = int( potion.gettag( 'potiontype' ) ) - 14 # consume the potion / add a blank bottle *************** *** 91,116 **** bottle = wolfpack.additem( 'f0e' ) if not tobackpack( bottle, char ): ! bottle.moveto( char.pos.x, char.pos.y, char.pos.z, char.pos.map ) ! bottle.update() ! # FIXME : success / fail chance ! if skill < ( strength + 0.8 ) * 200: ! # failed to poison item char.socket.clilocmessage( 1010518 ) return 1 ! # check skill advance ! char.checkskill( POISONING, 0, 1000 ) ! ! # FIXME : less / strong chance ! if random.randint( 0, 20 ) > ( skill - strength * 200 ): ! strength = strength - 1 ! if strength < 1: ! # failed to poison ! char.socket.clilocmessage( 502148 ) ! return 1 ! char.socket.clilocmessage( 1010518 ) ! else: ! char.socket.clilocmessage( 1010517 ) # decrease karma / fame --- 90,100 ---- bottle = wolfpack.additem( 'f0e' ) if not tobackpack( bottle, char ): ! bottle.update() ! if not char.checkskill( POISONING, MINSKILLS[strength], MAXSKILLS[strength] ): char.socket.clilocmessage( 1010518 ) return 1 ! char.socket.clilocmessage(1010517) # decrease karma / fame *************** *** 123,127 **** # number of uses before the poison wears off if item.hasscript( 'blades' ): ! item.settag( 'poisoning_uses', 20 - strength * 2 ) return 1 --- 107,111 ---- # number of uses before the poison wears off if item.hasscript( 'blades' ): ! item.settag( 'poisoning_uses', 18 - strength * 2 ) return 1 |