[wpdev-commits] xmlscripts/scripts blades.py,1.4,1.5
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-07-07 13:08:35
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27240 Modified Files: blades.py Log Message: Fixes for carving and sheering. Also added wolfpack.charbase. Index: blades.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/blades.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** blades.py 2 Jul 2004 13:40:44 -0000 1.4 --- blades.py 7 Jul 2004 13:08:20 -0000 1.5 *************** *** 14,17 **** --- 14,18 ---- from skills.lumberjacking import * import wolfpack.utilities + from wolfpack import settings import whrandom #import weapons.blades *************** *** 26,29 **** --- 27,36 ---- return 1 + def regrow_wool(char, arguments): + if char: + char.baseid = 'sheep_unsheered' + char.id = 207 + char.update() + def response( char, args, target ): item = wolfpack.finditem( args[0] ) *************** *** 60,68 **** # This is for sheering only elif target.char: ! if ( target.char.id == hex2dec(0xcf) ): ! target.char.id = 0xdf ! target.char.carve = "carve_sheep_sheered" target.char.update() ! elif target.char.id == hex2dec(0xdf): char.socket.clilocmessage( 0x7A2E1 ) # This sheep is not yet ready to be shorn. return --- 67,91 ---- # This is for sheering only elif target.char: ! if target.char.baseid == 'sheep_unsheered': ! target.char.id = 223 ! target.char.baseid = 'sheep_sheered' target.char.update() ! ! # Create Wool ! wool = wolfpack.additem("df8") ! wool.amount = 2 ! ! if not wolfpack.utilities.tobackpack(wool, char): ! wool.update() ! ! char.socket.clilocmessage( 0x7A2E4 ) # You place the gathered wool into your backpack. ! ! # Let the wool regrow (minutes) ! delay = settings.getnumber('Game Speed', 'Regrow Wool Minutes', 180, 1) ! delay *= 60000 # Miliseconds per Minute ! target.char.dispel(None, 1, "regrow_wool", []) ! target.char.addtimer(delay, "blades.regrow_wool", [], 1, 0, "regrow_wool") ! return ! elif target.char.id == 'sheep_sheered': char.socket.clilocmessage( 0x7A2E1 ) # This sheep is not yet ready to be shorn. return *************** *** 70,108 **** char.socket.clilocmessage( 0x7A2E2 ) # You can only skin dead creatures. return - - wool = wolfpack.additem( "df8" ) - wool.amount = 2 - - if not wolfpack.utilities.tocontainer( wool, char.getbackpack() ): - wool.update() - char.socket.clilocmessage( 0x7A2E4 ) # You place the gathered wool into your backpack. - return else: model = target.model ! if target.model == 0 or target.model != 0: ! ! if target.model == 0: ! map = wolfpack.map( target.pos.x, target.pos.y, target.pos.map ) ! treeid = map['id'] ! elif target.model != 0: ! treeid = target.model ! if istree(treeid): ! # Axes/Polearms get Logs, Swords get kindling. ! # Also allows a mace's war axe to be use. 0x13af and 0x13b0 ! if item.type == 1002 or item.id == 0x13af or item.id == 0x13b0: ! if not item or not item.container == char: ! char.message( "You must equip this item to use it on this target!" ) ! return ! else: ! skills.lumberjacking.response( [ target, item, char ] ) ! # Swords and Fencing Weapons: Get kindling ! elif item.type == 1001 or item.type == 1005: ! skills.lumberjacking.hack_kindling( char, target.pos ) ! else: ! # You can't use a bladed item on that. ! char.socket.clilocmessage( 500494, "", GRAY ) ! return False # CARVE CORPSE --- 93,121 ---- char.socket.clilocmessage( 0x7A2E2 ) # You can only skin dead creatures. return else: model = target.model ! if target.model == 0: ! map = wolfpack.map( target.pos.x, target.pos.y, target.pos.map ) ! treeid = map['id'] ! elif target.model != 0: ! treeid = target.model ! if istree(treeid): ! # Axes/Polearms get Logs, Swords get kindling. ! # Also allows a mace's war axe to be use. 0x13af and 0x13b0 ! if item.type == 1002 or item.id == 0x13af or item.id == 0x13b0: ! if not item or not item.container == char: ! char.message( "You must equip this item to use it on this target!" ) ! return ! else: ! skills.lumberjacking.response( [ target, item, char ] ) ! # Swords and Fencing Weapons: Get kindling ! elif item.type == 1001 or item.type == 1005: ! skills.lumberjacking.hack_kindling( char, target.pos ) ! else: ! # You can't use a bladed item on that. ! char.socket.clilocmessage( 500494, "", GRAY ) ! return False # CARVE CORPSE *************** *** 122,131 **** # Not carvable or already carved ! if corpse.carve == '': char.socket.clilocmessage( 0x7A305, "", 0x3b2, 3, corpse ) # You see nothing useful to carve.. return # Create all items in the carve list ! carve = wolfpack.list( str(corpse.carve) ) for id in carve: --- 135,151 ---- # Not carvable or already carved ! try: ! charbase = wolfpack.charbase(corpse.charbaseid) ! carve = charbase['carve'] ! except: ! char.socket.clilocmessage( 0x7A305, "", 0x3b2, 3, corpse ) # You see nothing useful to carve.. ! return ! ! if corpse.hastag('carved') or carve == '': char.socket.clilocmessage( 0x7A305, "", 0x3b2, 3, corpse ) # You see nothing useful to carve.. return # Create all items in the carve list ! carve = wolfpack.list(str(carve)) for id in carve: *************** *** 147,155 **** blooditem.moveto( corpse.pos ) blooditem.decay = 1 - blooditem.decaytime = wolfpack.time.servertime() + ( 30 * 1000 ) # Decay after 30 Seconds blooditem.update() char.socket.clilocmessage( 0x7A2F3, "", 0x3b2, 3, corpse ) # You carve away some meat which remains on the corpse ! corpse.carve = '' # CUT FISH --- 167,174 ---- blooditem.moveto( corpse.pos ) blooditem.decay = 1 blooditem.update() char.socket.clilocmessage( 0x7A2F3, "", 0x3b2, 3, corpse ) # You carve away some meat which remains on the corpse ! corpse.settag('carved', 1) # CUT FISH |