[wpdev-commits] xmlscripts/scripts/skills __init__.py,1.9,1.10 mining.py,1.11,1.12
Brought to you by:
rip,
thiagocorrea
|
From: <dr...@pr...> - 2004-01-26 21:02:48
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21903/scripts/skills Modified Files: __init__.py mining.py Log Message: I found cliloc messages. Woo! (Should probably make an index or something... Index: __init__.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/__init__.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** __init__.py 25 Jan 2004 01:26:04 -0000 1.9 --- __init__.py 26 Jan 2004 21:00:41 -0000 1.10 *************** *** 4,7 **** --- 4,8 ---- import wolfpack.settings from wolfpack.consts import * + from random import randrange STRGAIN = 0 *************** *** 16,23 **** { ALCHEMY: [0, 0.5, 0.5, 1, 1000, FALSE], ! ANATOMY: [0.15, 0.15, 0.7, 1, 1000, FALSE ], ANIMALLORE: [0, 0, 1, 1, 1000, FALSE ], ITEMID: [0, 0, 1, 1, 1000, FALSE ], ! ARMSLORE: [0.75, 0.15, 0.1, 1, 1000, FALSE ], PARRYING: [0.75, 0.25, 0, 1, 1000, FALSE], BEGGING: [0, 0, 0, 1, 1000, FALSE ], --- 17,24 ---- { ALCHEMY: [0, 0.5, 0.5, 1, 1000, FALSE], ! ANATOMY: [0.1, 0.1, 0.8, 1, 1000, FALSE ], ANIMALLORE: [0, 0, 1, 1, 1000, FALSE ], ITEMID: [0, 0, 1, 1, 1000, FALSE ], ! ARMSLORE: [0.8, 0.1, 0.1, 1, 1000, FALSE ], PARRYING: [0.75, 0.25, 0, 1, 1000, FALSE], BEGGING: [0, 0, 0, 1, 1000, FALSE ], *************** *** 100,105 **** mult = 0.2 ! gainchance = float( skillscap - chartotalskills ) / skillscap ! gainchance += float( charskillcap - skillvalue ) / charskillcap / 2 gainchance = ( ( gainchance + ( 1.0 - chance ) * mult ) / 2 ) * skilltable[ skillid ][ GAINFACTOR ] --- 101,106 ---- mult = 0.2 ! gainchance = ( float( skillscap - chartotalskills ) / skillscap ) ! gainchance += ( ( float( charskillcap - skillvalue ) / charskillcap ) / 2 ) gainchance = ( ( gainchance + ( 1.0 - chance ) * mult ) / 2 ) * skilltable[ skillid ][ GAINFACTOR ] *************** *** 108,112 **** #If you lucky and antimacro is agree so let's gain this skill ! if ( gainchance >= whrandom.random() ) or skillvalue < 100: skillgain( char, skillid ) --- 109,114 ---- #If you lucky and antimacro is agree so let's gain this skill ! # 3/5 chance to gain if below 10.0 skill. ! if ( gainchance >= whrandom.random() ) or ( ( skillvalue < 100 ) and ( randrange( 1, 5 ) > 2 ) ): skillgain( char, skillid ) Index: mining.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/mining.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** mining.py 26 Jan 2004 13:48:49 -0000 1.11 --- mining.py 26 Jan 2004 21:00:47 -0000 1.12 *************** *** 99,103 **** # Player can reach that ? if char.pos.map != pos.map or char.pos.distance( pos ) > MINING_MAX_DISTANCE: ! socket.clilocmessage( 500446, "", GRAY, NORMAL ) # That is too far away return OK --- 99,104 ---- # Player can reach that ? if char.pos.map != pos.map or char.pos.distance( pos ) > MINING_MAX_DISTANCE: ! # That is too far away ! socket.clilocmessage( 500446, "", GRAY ) return OK *************** *** 107,111 **** #Mine char ?! if target.char: ! socket.clilocmessage( 501863, "", GRAY, NORMAL ) # You can't mine that. return OK --- 108,113 ---- #Mine char ?! if target.char: ! # You can't mine that. ! socket.clilocmessage( 501863, "", GRAY ) return OK *************** *** 123,127 **** mining( char, target.pos, tool ) else: ! socket.clilocmessage( 501862, "", GRAY, NORMAL ) # You can't mine there. return OK --- 125,130 ---- mining( char, target.pos, tool ) else: ! # You can't mine there. ! socket.clilocmessage( 501862, "", GRAY ) return OK *************** *** 132,136 **** mining( char, target.pos, tool ) else: ! socket.clilocmessage( 501862, "", GRAY, NORMAL ) # You can't mine there. return OK else: --- 135,139 ---- mining( char, target.pos, tool ) else: ! socket.clilocmessage( 501862, "", GRAY ) # You can't mine there. return OK else: *************** *** 189,210 **** # Are you skilled enough ? And here is ore ? if ( resourcecount >= 1 ) and ( char.skill[ MINING ] >= reqskill ): ! skills.checkskill( char, veingem, MINING, 0 ) ! if resourcecount >= 5: # Digs up the large ore. ! successmining( char, veingem, oretable, resname, 1, oredefs[3] ) ! elif resourcecount == 3 or resourcecount == 4: # Picks one of the smaller ore types ! randomore = randrange( 1, 2 ) ! successmining( char, veingem, oretable, resname, 1, oredefs[randomore] ) ! elif resourcecount == 1 or resourcecount == 2: # Smallest ore only ! successmining( char, veingem, oretable, resname, 1, oredefs[0] ) ! # tool durability drain ! if tool.health > 1: ! tool.health -= 1 ! tool.update() ! elif tool.health == 1: ! tool.delete() ! success = 1 elif resourcecount == 0: ! socket.sysmessage( "There is no ore left here to mine...", GRAY, NORMAL ) if not veingem.hastag( 'resource_empty' ): wolfpack.addtimer( orerespawndelay, "skills.mining.respawnvein", [ veingem ] ) --- 192,220 ---- # Are you skilled enough ? And here is ore ? if ( resourcecount >= 1 ) and ( char.skill[ MINING ] >= reqskill ): ! if not skills.checkskill( char, veingem, MINING, 0 ): ! # You loosen some rocks but fail to find any usable ore. ! socket.clilocmessage( 501869, "", GRAY ) ! success = 0 ! return ! else: ! if resourcecount >= 5: # Digs up the large ore. ! successmining( char, veingem, oretable, resname, 1, oredefs[3] ) ! elif resourcecount == 3 or resourcecount == 4: # Picks one of the smaller ore types ! randomore = randrange( 1, 2 ) ! successmining( char, veingem, oretable, resname, 1, oredefs[randomore] ) ! elif resourcecount == 1 or resourcecount == 2: # Smallest ore only ! successmining( char, veingem, oretable, resname, 1, oredefs[0] ) ! # tool durability drain ! if tool.health > 1: ! tool.health -= 1 ! tool.update() ! elif tool.health == 1: ! tool.delete() ! # You have worn out your tool! ! socket.clilocmessage( 1044038, '', GRAY ) ! success = 1 elif resourcecount == 0: ! socket.sysmessage( "There is no metal here to mine.", GRAY ) if not veingem.hastag( 'resource_empty' ): wolfpack.addtimer( orerespawndelay, "skills.mining.respawnvein", [ veingem ] ) *************** *** 214,218 **** if success == 0: ! socket.clilocmessage( 501869, "", GRAY, NORMAL ) # You loosen some rocks but fail to find any usable ore. char.deltag('is_mining') --- 224,229 ---- if success == 0: ! # You loosen some rocks but fail to find any usable ore. ! socket.clilocmessage( 501869, "", GRAY ) char.deltag('is_mining') *************** *** 247,253 **** if resname == 'silver' or resname == 'merkite' or resname == 'mythril': ! socket.sysmessage( "You dig some " + table[ resname ][ RESOURCENAME ] + " and put it in your backpack.", GRAY, NORMAL ) else: ! socket.clilocmessage( message, "", GRAY, NORMAL ) return OK --- 258,265 ---- if resname == 'silver' or resname == 'merkite' or resname == 'mythril': ! socket.sysmessage( "You dig some " + table[ resname ][ RESOURCENAME ] + " and put it in your backpack.", GRAY ) else: ! # You dig some %s and put it in your backpack. ! socket.clilocmessage( message, "", GRAY ) return OK |