[wpdev-commits] xmlscripts/scripts key.py,1.13,1.14
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-10-05 11:54:28
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7334 Modified Files: key.py Log Message: exploit bugfix Index: key.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/key.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** key.py 25 Aug 2004 17:03:05 -0000 1.13 --- key.py 5 Oct 2004 11:54:16 -0000 1.14 *************** *** 7,17 **** def gump_response(char, args, response): if len(args) < 1 or response.button != 1: ! return key = wolfpack.finditem(args[0]) if not char.canreach(key, 5): ! char.socket.clilocmessage(501661) ! return # Rename --- 7,17 ---- def gump_response(char, args, response): if len(args) < 1 or response.button != 1: ! return key = wolfpack.finditem(args[0]) if not char.canreach(key, 5): ! char.socket.clilocmessage(501661) ! return # Rename *************** *** 22,33 **** # Rekey if char.gm: ! new_lock = response.text[2] if len(new_lock) != 0: ! key.settag('lock', new_lock) ! char.socket.sysmessage('This key now unlocks: ' + new_lock) else: ! key.deltag('lock') ! char.socket.sysmessage('You erase the lock information from the key.') key.resendtooltip() --- 22,33 ---- # Rekey if char.gm: ! new_lock = response.text[2] if len(new_lock) != 0: ! key.settag('lock', new_lock) ! char.socket.sysmessage('This key now unlocks: ' + new_lock) else: ! key.deltag('lock') ! char.socket.sysmessage('You erase the lock information from the key.') key.resendtooltip() *************** *** 43,49 **** if char.gm: ! text = '<basefont color="#FECECE"><h3>Manage Key</h3><br><basefont color="#FEFEFE">This dialog will help you to manage or rename this key.' else: ! text = '<basefont color="#FECECE"><h3>Manage Key</h3><br><basefont color="#FEFEFE">This dialog will help you to rename this key.' gump.addHtmlGump(x=20, y=20, width=410, height=90, html=text) --- 43,49 ---- if char.gm: ! text = '<basefont color="#FECECE"><h3>Manage Key</h3><br><basefont color="#FEFEFE">This dialog will help you to manage or rename this key.' else: ! text = '<basefont color="#FECECE"><h3>Manage Key</h3><br><basefont color="#FEFEFE">This dialog will help you to rename this key.' gump.addHtmlGump(x=20, y=20, width=410, height=90, html=text) *************** *** 55,65 **** # InputField for the key id if char.gm: ! lock = '' ! if key.hastag('lock'): ! lock = str(key.gettag('lock')) ! gump.addText(x=235, y=65, text='The lock id of this key:', hue=0x835) ! gump.addResizeGump(x=235, y=88, id=0xBB8, width=160, height=25) ! gump.addInputField(x=240, y=90, width=150, height=20, hue=0x834, id=2, starttext=lock) gump.addText(x=50, y=130, text='Modify key', hue=0x835) --- 55,65 ---- # InputField for the key id if char.gm: ! lock = '' ! if key.hastag('lock'): ! lock = str(key.gettag('lock')) ! gump.addText(x=235, y=65, text='The lock id of this key:', hue=0x835) ! gump.addResizeGump(x=235, y=88, id=0xBB8, width=160, height=25) ! gump.addInputField(x=240, y=90, width=150, height=20, hue=0x834, id=2, starttext=lock) gump.addText(x=50, y=130, text='Modify key', hue=0x835) *************** *** 73,100 **** def lock_response(char, args, target): if len(args) != 1: ! return key = wolfpack.finditem(args[0]) if not key or not char.canreach(key,5): ! char.socket.clilocmessage(501661) ! return # Check for an item target. if not target.item or not char.canreach(target.item,5): ! char.socket.clilocmessage(501666) ! return if target.item == key: ! rename_key(char,key) ! elif target.item.hasscript( 'lock' ): ! if target.item.hastag('locked') and int(target.item.gettag('locked')) == 1: ! target.item.deltag('locked') ! else: ! target.item.settag('locked',1) ! char.soundeffect(0x241) else: ! char.socket.clilocmessage(501666) return --- 73,104 ---- def lock_response(char, args, target): if len(args) != 1: ! return key = wolfpack.finditem(args[0]) if not key or not char.canreach(key,5): ! char.socket.clilocmessage(501661) ! return # Check for an item target. if not target.item or not char.canreach(target.item,5): ! char.socket.clilocmessage(501666) ! return if target.item == key: ! rename_key(char,key) ! elif target.item.hasscript( 'lock' ) and target.item.hastag('lock'): ! door_lock = str(target.item.gettag('lock')) ! key_lock = str(key.gettag('lock')) ! ! if door_lock == key_lock: ! if target.item.hastag('locked') and int(target.item.gettag('locked')) == 1: ! target.item.deltag('locked') ! else: ! target.item.settag('locked',1) ! char.soundeffect(0x241) else: ! char.socket.clilocmessage(501666) return *************** *** 102,149 **** def copy_response(char, args, target): if len(args) != 1: ! return key = wolfpack.finditem(args[0]) if not key or not char.canreach(key,5): ! char.socket.clilocmessage(501661) ! return # Check if the targetted item is a key if not target.item or not target.item.hasscript( 'key' ): ! char.socket.clilocmessage(501679) ! return # Also a blank key? if not target.item.hastag('lock'): ! char.socket.clilocmessage(501675) ! return # Check if the player can reach the item if not char.canreach(target.item,5): ! char.socket.clilocmessage(501661) ! return # Tinkering check (15%-30%, 25% chance of loosing the key on failure) if char.checkskill(TINKERING, 150, 300): ! key.settag('lock',target.item.gettag('lock')) ! key.resendtooltip() ! char.socket.clilocmessage(501676) else: ! char.socket.clilocmessage(501677) ! # 25% chance of destroying the blank key ! if random.randint(1,4) == 1: ! char.socket.clilocmessage(501678) ! key.remove() def onUse(char, key): # Does this key open a lock? if not key.hastag('lock'): ! # The key is blank so we wan't to make a copy of it ! char.socket.clilocmessage(501663) ! char.socket.attachtarget('key.copy_response',[key.serial]) else: ! char.socket.clilocmessage(501662) ! char.socket.attachtarget('key.lock_response',[key.serial]) return 1 --- 106,153 ---- def copy_response(char, args, target): if len(args) != 1: ! return key = wolfpack.finditem(args[0]) if not key or not char.canreach(key,5): ! char.socket.clilocmessage(501661) ! return # Check if the targetted item is a key if not target.item or not target.item.hasscript( 'key' ): ! char.socket.clilocmessage(501679) ! return # Also a blank key? if not target.item.hastag('lock'): ! char.socket.clilocmessage(501675) ! return # Check if the player can reach the item if not char.canreach(target.item,5): ! char.socket.clilocmessage(501661) ! return # Tinkering check (15%-30%, 25% chance of loosing the key on failure) if char.checkskill(TINKERING, 150, 300): ! key.settag('lock',target.item.gettag('lock')) ! key.resendtooltip() ! char.socket.clilocmessage(501676) else: ! char.socket.clilocmessage(501677) ! # 25% chance of destroying the blank key ! if random.randint(1,4) == 1: ! char.socket.clilocmessage(501678) ! key.remove() def onUse(char, key): # Does this key open a lock? if not key.hastag('lock'): ! # The key is blank so we wan't to make a copy of it ! char.socket.clilocmessage(501663) ! char.socket.attachtarget('key.copy_response',[key.serial]) else: ! char.socket.clilocmessage(501662) ! char.socket.attachtarget('key.lock_response',[key.serial]) return 1 *************** *** 155,165 **** # The user defined name if len(item.name) > 0: ! tooltip.add(1050045, " \t" + "Unlocks: " + item.name + "\t ") # Add the lock id for gms if char.gm: ! if item.hastag('lock'): ! lock = str(item.gettag('lock')) ! tooltip.add(1050045, " \t" + "Lock: " + lock + "\t ") ! else: ! tooltip.add(1050045, " \tThis key is blank\t ") --- 159,169 ---- # The user defined name if len(item.name) > 0: ! tooltip.add(1050045, " \t" + "Unlocks: " + item.name + "\t ") # Add the lock id for gms if char.gm: ! if item.hastag('lock'): ! lock = str(item.gettag('lock')) ! tooltip.add(1050045, " \t" + "Lock: " + lock + "\t ") ! else: ! tooltip.add(1050045, " \tThis key is blank\t ") |