[wpdev-commits] xmlscripts/scripts ore.py,1.3,1.4 potions.py,1.8,1.9
Brought to you by:
rip,
thiagocorrea
|
From: <dr...@pr...> - 2004-01-26 21:02:36
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21903/scripts Modified Files: ore.py potions.py Log Message: I found cliloc messages. Woo! (Should probably make an index or something... Index: ore.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/ore.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ore.py 26 Jan 2004 13:48:49 -0000 1.3 --- ore.py 26 Jan 2004 21:00:40 -0000 1.4 *************** *** 50,69 **** if ore.getoutmostchar() != char: if char.pos.distance( ore.pos ) > 2: ! char.socket.clilocmessage( 0x7A258 ) # You can't reach... return OK else: if not ore.hastag( 'resname' ): ! char.socket.sysmessage( "This ore is not of workable quality...", GRAY ) return OK else: ! char.socket.sysmessage( "Where do you want to smelt the ore?", GRAY ) char.socket.attachtarget( "ore.response", [ ore.serial ] ) return OK else: if not ore.hastag( 'resname' ): ! char.socket.sysmessage( "This ore is not of workable quality...", GRAY ) return OK else: ! char.socket.sysmessage( "Where do you want to smelt the ore?", GRAY ) char.socket.attachtarget( "ore.response", [ ore.serial ] ) return OK --- 50,71 ---- if ore.getoutmostchar() != char: if char.pos.distance( ore.pos ) > 2: ! char.socket.clilocmessage( 501976, '', GRAY ) # You can't reach... return OK else: if not ore.hastag( 'resname' ): ! char.socket.clilocmessage( 501986, '', GRAY ) # Strange ore. return OK else: ! # Where do you want to smelt the ore? ! char.socket.clilocmessage( 501971, '', GRAY, NORMAL ) char.socket.attachtarget( "ore.response", [ ore.serial ] ) return OK else: if not ore.hastag( 'resname' ): ! char.socket.clilocmessage( 501986, '', GRAY ) return OK else: ! # Where do you want to smelt the ore? ! char.socket.clilocmessage( 501971, '', GRAY, NORMAL ) char.socket.attachtarget( "ore.response", [ ore.serial ] ) return OK *************** *** 105,112 **** elif target.item.id in oreids: if targetitem.serial == item.serial: - char.socket.sysmessage( "You can not combine a pile of ore with itself...", GRAY ) return OOPS if not targetitem.hastag('resname'): ! char.socket.sysmessage( "That ore is not of workable quality...", GRAY ) return OOPS # Largest Ore Pile --- 107,113 ---- elif target.item.id in oreids: if targetitem.serial == item.serial: return OOPS if not targetitem.hastag('resname'): ! char.socket.clilocmessage( 501986, '', GRAY ) return OOPS # Largest Ore Pile *************** *** 114,118 **** if targetitem.getoutmostchar() != char: if char.pos.distance( target.pos ) > 2: ! char.socket.clilocmessage( 0x7A258 ) # You can't reach... return OK else: --- 115,120 ---- if targetitem.getoutmostchar() != char: if char.pos.distance( target.pos ) > 2: ! # The ore is too far away. ! char.socket.clilocmessage( 501976, '', GRAY) return OK else: *************** *** 122,136 **** targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 4 ) targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == item.id: targetitem.amount += item.amount targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) return OK else: --- 124,141 ---- targetitem.update() item.delete() ! # Select the forge on which to smelt the ore, or another pile of ore with which to combine it. ! char.socket.clilocmessage( 501971, '', GRAY, NORMAL ) elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 4 ) targetitem.update() item.delete() ! # Select the forge on which to smelt the ore, or another pile of ore with which to combine it. ! char.socket.clilocmessage( 501971, '', GRAY, NORMAL ) elif targetitem.id == item.id: targetitem.amount += item.amount targetitem.update() item.delete() ! # Select the forge on which to smelt the ore, or another pile of ore with which to combine it. ! char.socket.clilocmessage( 501971, '', GRAY, NORMAL ) return OK else: *************** *** 140,154 **** targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 4 ) targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == item.id: ! targetitem.amount += item.amount ! targetitem.update() ! item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) return OK --- 145,162 ---- targetitem.update() item.delete() ! # Select the forge on which to smelt the ore, or another pile of ore with which to combine it. ! char.socket.clilocmessage( 501971, '', GRAY, NORMAL ) elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 4 ) targetitem.update() item.delete() ! # Select the forge on which to smelt the ore, or another pile of ore with which to combine it. ! char.socket.clilocmessage( 501971, '', GRAY, NORMAL ) elif targetitem.id == item.id: ! targetitem.amount += item.amount ! targetitem.update() ! item.delete() ! # Select the forge on which to smelt the ore, or another pile of ore with which to combine it. ! char.socket.clilocmessage( 501971, '', GRAY, NORMAL ) return OK *************** *** 157,161 **** if targetitem.getoutmostchar() != char: if char.pos.distance( target.pos ) > 2: ! char.socket.clilocmessage( 0x7A258 ) # You can't reach... return OK else: --- 165,170 ---- if targetitem.getoutmostchar() != char: if char.pos.distance( target.pos ) > 2: ! # The ore is too far away. ! char.socket.clilocmessage( 501976, '', GRAY) return OK else: *************** *** 165,176 **** targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 2 ) targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == oreids[3]: ! char.socket.sysmessage( "You can not create a larger pile from a small pile of ore.", GRAY ) return OK else: --- 174,185 ---- targetitem.update() item.delete() ! return OK elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 2 ) targetitem.update() item.delete() ! return OK elif targetitem.id == oreids[3]: ! return OOPS return OK else: *************** *** 180,191 **** targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 2 ) targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == oreids[3]: ! char.socket.sysmessage( "You can not create a larger pile from a small pile of ore.", GRAY ) return OK --- 189,200 ---- targetitem.update() item.delete() ! return OK elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 2 ) targetitem.update() item.delete() ! return OK elif targetitem.id == oreids[3]: ! return OOPS return OK *************** *** 197,213 **** return OK else: - # Merge the ore piles if targetitem.id == oreids[1]: targetitem.amount += item.amount targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 2 ) targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == oreids[2] or targetitem.id == oreids[3]: ! char.socket.sysmessage( "You can not create a larger pile from a small pile of ore.", GRAY ) return OK else: --- 206,221 ---- return OK else: if targetitem.id == oreids[1]: targetitem.amount += item.amount targetitem.update() item.delete() ! return OK elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 2 ) targetitem.update() item.delete() ! return OK elif targetitem.id == oreids[2] or targetitem.id == oreids[3]: ! return OOPS return OK else: *************** *** 217,228 **** targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 2 ) targetitem.update() item.delete() ! char.socket.sysmessage( "You combine the two ore piles to create a single pile of ore.", GRAY ) elif targetitem.id == oreids[2] or targetitem.id == oreids[3]: ! char.socket.sysmessage( "You can not create a larger pile from a small pile of ore.", GRAY ) return OK --- 225,236 ---- targetitem.update() item.delete() ! return OK elif targetitem.id == oreids[0]: targetitem.amount += ( item.amount * 2 ) targetitem.update() item.delete() ! return OK elif targetitem.id == oreids[2] or targetitem.id == oreids[3]: ! return OOPS return OK *************** *** 231,235 **** if targetitem.getoutmostchar() != char: if char.pos.distance( target.pos ) > 2: ! char.socket.clilocmessage( 0x7A258 ) # You can't reach... return OK else: --- 239,244 ---- if targetitem.getoutmostchar() != char: if char.pos.distance( target.pos ) > 2: ! # The ore is too far away. ! char.socket.clilocmessage( 501976 ) return OK else: *************** *** 262,294 **** reqskill = ingottable[ resname ][ REQSKILL ] if ore.amount >= 1 and char.skill[ MINING ] >= reqskill: ! skills.checkskill( char, forge, MINING, 0 ) ! if ore.id == oreids[3]: ! amount = ( ore.amount * 2 ) ! successsmelt( char, ingottable, resname, amount, ingotdef ) ! ore.delete() ! elif ore.id == oreids[2] or ore.id == oreids[1]: ! amount = ore.amount ! successsmelt( char, ingottable, resname, amount, ingotdef ) ! ore.delete() ! elif ore.id == oreids[0]: ! if evenorodd( ore.amount ) == "even": ! amount = ( ore.amount / 2 ) successsmelt( char, ingottable, resname, amount, ingotdef ) ore.delete() ! elif evenorodd( ore.amount ) == "odd" and ore.amount > 1: ! amount = ( ( ore.amount - 1 ) / 2 ) successsmelt( char, ingottable, resname, amount, ingotdef ) ! ore.amount = 1 ! ore.update() ! elif ore.amount == 1: ! char.socket.sysmessage( "You require more ore to produce any ingots.", GRAY ) ! success = 1 if success == 0: ! char.socket.sysmessage( "You smelt the ore but fail to produce any ingots.", GRAY ) ! ore.amount -= ( ore.amount / 2 ) ! ore.update() ! return OK --- 271,318 ---- reqskill = ingottable[ resname ][ REQSKILL ] + if not char.skill[ MINING ] >= reqskill: + # You have no idea how to smelt this strange ore! + char.socket.clilocmessage( 501986, '', GRAY ) + return OOPS + if ore.amount >= 1 and char.skill[ MINING ] >= reqskill: ! if not skills.checkskill( char, forge, MINING, 0 ): ! success = 0 ! return ! else: ! if ore.id == oreids[3]: ! amount = ( ore.amount * 2 ) successsmelt( char, ingottable, resname, amount, ingotdef ) ore.delete() ! elif ore.id == oreids[2] or ore.id == oreids[1]: ! amount = ore.amount successsmelt( char, ingottable, resname, amount, ingotdef ) ! ore.delete() ! elif ore.id == oreids[0]: ! if evenorodd( ore.amount ) == "even": ! amount = ( ore.amount / 2 ) ! successsmelt( char, ingottable, resname, amount, ingotdef ) ! ore.delete() ! elif evenorodd( ore.amount ) == "odd" and ore.amount > 1: ! amount = ( ( ore.amount - 1 ) / 2 ) ! successsmelt( char, ingottable, resname, amount, ingotdef ) ! ore.amount = 1 ! ore.update() ! elif ore.amount == 1: ! successsmelt( char, ingottable, resname, amount, ingotdef ) ! ore.delete() ! success = 1 if success == 0: ! if ore.amount >= 2: ! # You burn away the impurities but are left with less useable metal. ! char.socket.clilocmessage( 501990, '', GRAY ) ! ore.amount -= ( ore.amount / 2 ) ! ore.update() ! else: ! # You burn away the impurities but are left with no useable metal. ! char.socket.clilocmessage( 501989, '', GRAY ) ! ore.delete() ! return OK *************** *** 304,313 **** resourceitem.amount = amount resourceitem.settag( 'resname', str( resname ) ) # Used when smelting - message = "You smelt the ore and place some " + table[ resname ][ NAME] + "s into your backpack." if not wolfpack.utilities.tocontainer( resourceitem, char.getbackpack() ): resourceitem.update() ! socket.sysmessage( message, GRAY ) char.soundeffect( SOUND_HAMMER_1 ) --- 328,337 ---- resourceitem.amount = amount resourceitem.settag( 'resname', str( resname ) ) # Used when smelting if not wolfpack.utilities.tocontainer( resourceitem, char.getbackpack() ): resourceitem.update() ! # You smelt the ore removing the impurities and put the metal in your backpack. ! char.socket.clilocmessage( 501988, '', GRAY ) char.soundeffect( SOUND_HAMMER_1 ) Index: potions.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/potions.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** potions.py 26 Jan 2004 11:40:42 -0000 1.8 --- potions.py 26 Jan 2004 21:00:41 -0000 1.9 *************** *** 75,80 **** if potiontype == 'lesser_heal' or potiontype == 'heal' or potiontype == 'greater_heal': if canUsePotion( char, item ): if char.hitpoints >= char.maxhitpoints: ! socket.sysmessage( 'You are already at full health!' ) else: healPotion( char, item, potiontype ) --- 75,85 ---- if potiontype == 'lesser_heal' or potiontype == 'heal' or potiontype == 'greater_heal': if canUsePotion( char, item ): + if char.hastag( 'poisoned' ): + # You can not heal yourself in your current state. + char.socket.clilocmessage( 1005000, '', GRAY ) + return OOPS if char.hitpoints >= char.maxhitpoints: ! # You decide against drinking this potion, as you are already at full health. ! char.socket.clilocmessage( 1049547, '', GRAY ) else: healPotion( char, item, potiontype ) *************** *** 91,95 **** agilityPotion( char, item, potiontype ) else: ! char.socket.sysmessage( 'You are already under a similar effect!', GRAY ) # Strength Potions --- 96,101 ---- agilityPotion( char, item, potiontype ) else: ! # You are already under a similar effect. ! char.socket.clilocmessage( 502173, '', GRAY ) # Strength Potions *************** *** 99,103 **** strengthPotion( char, item, potiontype ) else: ! char.socket.sysmessage( 'You are already under a similar effect!', GRAY ) # Poison Potions --- 105,110 ---- strengthPotion( char, item, potiontype ) else: ! # You are already under a similar effect. ! char.socket.clilocmessage( 502173, '', GRAY ) # Poison Potions *************** *** 170,174 **** elapsed = int( char.gettag( "heal_timer" ) ) if elapsed > wolfpack.time.servertime(): ! char.socket.clilocmessage( 0x7A20B, GRAY ) # You must wait 10 seconds before using another healing potion. return OOPS else: --- 177,181 ---- elapsed = int( char.gettag( "heal_timer" ) ) if elapsed > wolfpack.time.servertime(): ! char.socket.clilocmessage( 500235, '', GRAY ) # You must wait 10 seconds before using another healing potion. return OOPS else: *************** *** 200,204 **** # Resend Health char.updatehealth() ! char.socket.sysmessage( 'You healed ' + str( amount ) + ' hitpoints.', GRAY ) drinkAnim( char ) --- 207,212 ---- # Resend Health char.updatehealth() ! #char.socket.clilocmessage( 1060203, str(amount) , GRAY, NORMAL ) # broken ! char.socket.sysmessage( 'You have had ' + str( amount ) + ' hit points of damage healed.', GRAY ) drinkAnim( char ) |