rem stringlengths 0 322k | add stringlengths 0 2.05M | context stringlengths 8 228k |
|---|---|---|
self.includePath = "" self.librarySearchPath = "" self.toolPath = "" | self.incPath = "" self.libSearchPath = "" self._toolPath = "" | def __init__( self, output = sys.stdout ): self.output = output self.includePath = "" self.librarySearchPath = "" self.toolPath = "" self.libs = [] |
return self.includePath | return self.incPath | def includePath( self ): return self.includePath |
return self.librarySearchPath | return self.libSearchPath | def librarySearchPath( self ): return self.librarySearchPath |
return self.toolPath | return self._toolPath | def toolPath( self ): return self.toolPath |
self.includePath = path | self.incPath = path | def check( self, options ): self.out( "Checking Python Configuration:\n" ) |
self.librarySearchPath = path | self.libSearchPath = path | def check( self, options ): self.out( "Checking Python Configuration:\n" ) |
self.librarySearchPath = qt_dir | self.libSearchPath = qt_dir | def check( self, options ): self.out("Checking QT Configuration:\n") |
self.toolPath = qmake_path | self._toolPath = qmake_path | def check( self, options ): self.out("Checking QT Configuration:\n") |
qmakeFullPath = os.path.join(self.toolPath(), self.qmakeExecutable) | qt_qmake = os.path.join(self.toolPath(), self.qmakeExecutable) | def runQMake( self, projectfile, options ): qmakeFullPath = os.path.join(self.toolPath(), self.qmakeExecutable) if options: return os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, projectfile, options]) else: return os.spawnv(os.P_WAIT, qt_qmake, [qt_qmake, projectfile]) |
PY_LIBDIR = buildLibLine( checkPython.librarySearchPath(), checkPython.libraryFiles() ) | PY_LIBDIR = buildLibLine( checkPython.librarySearchPath(), checkPython.libraryFiles()[0] ) | def main(): """ Entry Point """ parser = OptionParser(version="%prog 1.0") parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable color output support on this script") parser.add_opt... |
config.write("QTDIR = %s\n" % checkQt.librarySearchPath() ) | def main(): """ Entry Point """ parser = OptionParser(version="%prog 1.0") parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable color output support on this script") parser.add_opt... | |
container = found[i].getoutmostitem() | item = found[i] container = item.getoutmostitem() | def goitem(socket, command, arguments): if len(arguments) == 0: socket.sysmessage('Usage: goitem <name>') return items = wolfpack.itemiterator() item = items.first name = hash(arguments.lower()) found = [] while item: if hash(item.name.lower()) == name: found.append( item ) item = items.next if socket.hastag( "goi... |
socket.sysmessage("Going to item '%s' [Serial: 0x%x; Top: 0x%x]." % (found[i].name, found[i].serial, container.serial)) pos = found[i].pos | socket.sysmessage("Going to item '%s' [Serial: 0x%x; Top: 0x%x]." % (item.name, item.serial, container.serial)) pos = container.pos | def goitem(socket, command, arguments): if len(arguments) == 0: socket.sysmessage('Usage: goitem <name>') return items = wolfpack.itemiterator() item = items.first name = hash(arguments.lower()) found = [] while item: if hash(item.name.lower()) == name: found.append( item ) item = items.next if socket.hastag( "goi... |
if item.container.isitem(): | if item.container: | def gouid(socket, command, arguments): try: uid = hex2dec(arguments) except: socket.symsessage('Usage: gouid <serial>') return if uid > 0x40000000: item = wolfpack.finditem(uid) if item: container = item.getoutmostitem() if container.container: container = container.container # Going to container socket.sysmessage('... |
else: char.addtimer( 0, "magic.runebook.recall1", [item.serial, target] ) | elif hasSpell(char, 32): char.addtimer( 0, "magic.runebook.recall1", [item.serial, target] ) else: char.socket.clilocmessage(502412) | def callback( char, args, target ): item = wolfpack.finditem(args[0]) closeGump(char, item) if target.button == 0: return if not char.canreach(item, 1): return button = target.button # Get selected rune number runenum = ( button - 1 ) % 100 target = getEntry(item, runenum) if not target: char.socket.clilocmessage... |
sys.stdout.write("Checking QT Configuration:\n") | def checkQt(): if sys.platform == "win32": QMAKE_EXECUTABLE = "qmake.exe" else: QMAKE_EXECUTABLE = "qmake" sys.stdout.write( "Checking QTDIR enviroment variable..." ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): sys.stdout.write( green("ok\n") ) else: sys.stdout.write( red("failed") +... | |
sys.stdout.write( "Checking QTDIR enviroment variable..." ) | sys.stdout.write( " Checking QTDIR enviroment variable: " ) | def checkQt(): if sys.platform == "win32": QMAKE_EXECUTABLE = "qmake.exe" else: QMAKE_EXECUTABLE = "qmake" sys.stdout.write( "Checking QTDIR enviroment variable..." ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): sys.stdout.write( green("ok\n") ) else: sys.stdout.write( red("failed") +... |
sys.stdout.write( green("ok\n") ) else: sys.stdout.write( red("failed") + "\n" ) sys.stdout.write( "You must properly setup QTDIR" ) | sys.stdout.write( green("Pass\n") ) sys.stdout.write( " Found value for QTDIR: %s\n" % os.environ["QTDIR"] ) else: sys.stdout.write( red("Fail") + "\n" ) sys.stdout.write( " You must properly setup the QTDIR environment variable!\n" ) | def checkQt(): if sys.platform == "win32": QMAKE_EXECUTABLE = "qmake.exe" else: QMAKE_EXECUTABLE = "qmake" sys.stdout.write( "Checking QTDIR enviroment variable..." ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): sys.stdout.write( green("ok\n") ) else: sys.stdout.write( red("failed") +... |
sys.stdout.write( "Searching for qmake..." ) | sys.stdout.write( " Searching for qmake executable: " ) | def checkQt(): if sys.platform == "win32": QMAKE_EXECUTABLE = "qmake.exe" else: QMAKE_EXECUTABLE = "qmake" sys.stdout.write( "Checking QTDIR enviroment variable..." ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): sys.stdout.write( green("ok\n") ) else: sys.stdout.write( red("failed") +... |
sys.stdout.write("\n") | def checkQt(): if sys.platform == "win32": QMAKE_EXECUTABLE = "qmake.exe" else: QMAKE_EXECUTABLE = "qmake" sys.stdout.write( "Checking QTDIR enviroment variable..." ) if ( os.environ.has_key("QTDIR") and os.path.exists( os.environ["QTDIR"] ) ): sys.stdout.write( green("ok\n") ) else: sys.stdout.write( red("failed") +... | |
elif sys.platform == "linux2": | elif sys.platform == "linux2" or sys.platform == "freebsd4" or sys.platform == "freebsd5": | def checkMySQL(options): if sys.platform == "win32": MySQL_LIBSEARCHPATH = [ sys.prefix + "\Libs\mysqlclient*.lib" ] MySQL_INCSEARCHPATH = [ sys.prefix + "\include\mysql.h" ] elif sys.platform == "linux2": MySQL_LIBSEARCHPATH = [ \ "/usr/local/lib/libmysqlclient*.so", \ "/usr/local/lib/mysql/libmysqlclient*.so", \ "/us... |
elif sys.platform == "freebsd4" or sys.platform == "freebsd5": MySQL_LIBSEARCHPATH = [ \ "/usr/local/lib/libmysqlclient*.so", \ "/usr/local/lib/mysql/libmysqlclient*.so", \ "/usr/lib/libmysqlclient*.so", \ "/usr/lib/mysql/libmysqlclient*.so" ] MySQL_LIBSTATICSEARCHPATH = [ \ "/usr/local/lib/libmysqlclient*.a", \ "/usr/... | def checkMySQL(options): if sys.platform == "win32": MySQL_LIBSEARCHPATH = [ sys.prefix + "\Libs\mysqlclient*.lib" ] MySQL_INCSEARCHPATH = [ sys.prefix + "\include\mysql.h" ] elif sys.platform == "linux2": MySQL_LIBSEARCHPATH = [ \ "/usr/local/lib/libmysqlclient*.so", \ "/usr/local/lib/mysql/libmysqlclient*.so", \ "/us... | |
sys.stdout.write("%s\n" % os.path.join( py_libpath, py_libfile ) ) | sys.stdout.write("%s\n" % os.path.join( mysql_libpath, mysql_libfile ) ) | def checkMySQL(options): if sys.platform == "win32": MySQL_LIBSEARCHPATH = [ sys.prefix + "\Libs\mysqlclient*.lib" ] MySQL_INCSEARCHPATH = [ sys.prefix + "\include\mysql.h" ] elif sys.platform == "linux2": MySQL_LIBSEARCHPATH = [ \ "/usr/local/lib/libmysqlclient*.so", \ "/usr/local/lib/mysql/libmysqlclient*.so", \ "/us... |
sys.stdout.write( "Searching for MySQL includes... " ) | sys.stdout.write( " Searching for MySQL includes: " ) | def checkMySQL(options): if sys.platform == "win32": MySQL_LIBSEARCHPATH = [ sys.prefix + "\Libs\mysqlclient*.lib" ] MySQL_INCSEARCHPATH = [ sys.prefix + "\include\mysql.h" ] elif sys.platform == "linux2": MySQL_LIBSEARCHPATH = [ \ "/usr/local/lib/libmysqlclient*.so", \ "/usr/local/lib/mysql/libmysqlclient*.so", \ "/us... |
else: PYTHONLIBSEARCHPATH = [] PYTHONLIBSTATICSEARCHPATH = [] | def checkPython( options, lookForHeaders, lookForLib ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] els... | |
elif sys.platform == "linux2": | elif sys.platform == "linux2" or sys.platform == "freebsd4" or sys.platform == "freebsd5": | def checkPython( options, lookForHeaders, lookForLib ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] els... |
elif sys.platform == "freebsd4" or sys.platform == "freebsd5": PYTHONLIBSEARCHPATH += [ \ "/usr/local/lib/libpython2.3*.so", \ "/usr/local/lib/[Pp]ython2.3*/libpython2.3*.so", \ "/usr/local/lib/[Pp]ython2.3*/config/libpython2.3*.so", \ "/usr/lib/libpython2.3*.so", \ "/usr/lib/[Pp]ython2.3*/libpython2.3*.so", \ "/usr/li... | def checkPython( options, lookForHeaders, lookForLib ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] els... | |
sys.stdout.write( "Checking Python version... " ) | sys.stdout.write( " Checking Python version: " ) | def checkPython( options, lookForHeaders, lookForLib ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] els... |
sys.stdout.write( bold("Wolfpack requires Python version greater than 2.2.0 ") ) | sys.stdout.write( bold(" Wolfpack requires Python version >= 2.3.0\n") ) | def checkPython( options, lookForHeaders, lookForLib ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] els... |
sys.stdout.write( "Checking CPU byte order... %s\n" % sys.byteorder ) | sys.stdout.write( " Checking CPU byte order: %s\n" % sys.byteorder ) | def checkPython( options, lookForHeaders, lookForLib ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] els... |
if lookForLib: sys.stdout.write( "Searching for Python library... " ) global py_libpath global py_libfile py_libfile = None py_libpath = None py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) if ( py_libfile ): sys.stdout.write("%s\n" % os.path.join( py_libpath, py_libfile ) ) else: sys.stdout.write(red("Not Fou... | def checkPython( options, lookForHeaders, lookForLib ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] els... | |
py_incfile = None py_incpath = None sys.stdout.write( "Searching for Python includes... " ) | sys.stdout.write( " Searching for Python includes: " ) | def checkPython( options, lookForHeaders, lookForLib ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] els... |
if lookForLib: sys.stdout.write( " Searching for Python library: " ) global py_libpath global py_libfile py_libfile, py_libpath = findFile( PYTHONLIBSEARCHPATH ) if ( py_libfile ): sys.stdout.write( "%s\n" % os.path.join( py_libpath, py_libfile ) ) else: sys.stdout.write(red("Not Found!") + "\n") sys.exit() s... | def checkPython( options, lookForHeaders, lookForLib ): PYTHONINCSEARCHPATH = [ distutils.sysconfig.get_python_inc() + os.path.sep + "Python.h" ] if distutils.sysconfig.get_config_vars().has_key("DESTSHARED"): PYTHONLIBSEARCHPATH = [ distutils.sysconfig.get_config_vars()["DESTSHARED"] + os.path.sep + "libpython*" ] els... | |
checkQt() | sys.stdout.write("\n") | def main(): # Options for qmake DEFINES = "" CONFIG = "" # Setup command line parser parser = OptionParser(version="%prog 0.2") parser.add_option("--dsp", action="store_true", dest="dsp", help="also Generate Visual Studio project files") parser.add_option("--nocolor", action="store_true", dest="nocolor", help="disable... |
item.id = ids[ item.id ] if not wolfpack.utilities.tocontainer(item, container): item.update() | item.id = ids[item.id] | def onDropOnItem( container, item ): dropper = item.container # Turn off the lightsource if item.id in burning and ids.has_key( item.id ): item.id = ids[ item.id ] if not wolfpack.utilities.tocontainer(item, container): item.update() dropper.soundeffect(0x226) return True |
minskill = min(char.skill[skill], (1.0 - chance) * 1200) | minskill = min(char.skill[skill], int((1.0 - chance) * 1200) ) | def checkskill(char, skill, chance): # Normalize chance = min(1.0, max(0.02, chance)) minskill = min(char.skill[skill], (1.0 - chance) * 1200) maxskill = 1200 char.checkskill(skill, minskill, maxskill) return chance >= random.random() |
char.log(LOG_TRACE, 'Gainchance for skill %s is %f.\n' % (SKILLNAMES[skill], gainchance)) | def onSkillGain(char, skill, lower, higher, success): # See if we can gain at all # GMs don't gain skills if char.dead or char.gm or char.polymorph: return if not SKILLS.has_key(skill): char.log(LOG_ERROR, "Is using an unidentified skill: %u\n" % skill) return info = SKILLS[skill] skills = char.skill value = skills[s... | |
if not text.lower().startswith( listener.name.lower() ) and not text.lower.startswith( 'vendor' ): return 0 if 369 not in keywords and 60 not in keywords: return 0 | def onSpeech( listener, speaker, text, keywords ): # Check if our name is in the beginning of the string #if not text.lower().startswith( listener.name.lower() ): # return 0 if ( speaker.distanceto( listener ) > 4 ): return 0 if ( abs( speaker.pos.z - listener.pos.z ) > 5 ): return 0 if speaker.id != 0x190 and speake... | |
player.update(0, 1) if player.socket: player.socket.updateplayer() | player.update(0) if player.socket: | def onCollide(player, item): if item.hastag('playersonly') and player.npc: return 0 if not item.hastag('target'): if player.socket: player.socket.sysmessage('This gate leads nowhere...') else: console.log(LOG_ERROR, "NPC [%x] using gate [%x] without target.\n" % (player.serial, item.serial)) return 0 target = item.ge... |
return if (not target.validspawnspot() or wolfpack.findmulti(target)) and not char.gm: if char.socket: char.socketclilocmessage(501942) | def target(self, char, mode, targettype, target, args, item): char.turnto(target) | |
chance = chance * -1 | chance = 0 | def getexceptionalchance(self, player, arguments): if not self.skills.has_key(BOWCRAFT): return False |
packet.setascii( offset, line ) offset += len( line ) + 1 | packet.setascii(offset, str(line)) offset += len(line) + 1 | def sendPage( char, serial, page, lines ): packetlength = 13 for line in lines: packetlength += len( line ) + 1 packet = wolfpack.packet( 0x66, packetlength ) packet.setshort( 1, packetlength ) packet.setint( 3, serial ) packet.setshort( 7, 1 ) # Always a single page # Page Info packet.setshort( 9, page ) packet.set... |
packet.setshort( 11, len( author ) + 1 ) packet.setascii( 13, author ) | packet.setshort( 11, len(title) + 1 ) packet.setascii( 13, title ) | def onUse( char, item ): char.objectdelay = 0 # Send BookOpen packet # Author / Title author = '' title = item.name if item.hastag( 'author' ): author = str( item.gettag( 'author' ) ) # Calculate Packet Length packetlength = 15 + len( author ) + 1 + len( title ) + 1 packet = wolfpack.packet( 0xd4, packetlength ) pa... |
packet.setshort( 13 + len( author ) + 1, len( title ) + 1 ) packet.setascii( 15 + len( author ) + 1, title ) | packet.setshort( 13 + len(title) + 1, len(author) + 1 ) packet.setascii( 15 + len(title) + 1, author ) | def onUse( char, item ): char.objectdelay = 0 # Send BookOpen packet # Author / Title author = '' title = item.name if item.hastag( 'author' ): author = str( item.gettag( 'author' ) ) # Calculate Packet Length packetlength = 15 + len( author ) + 1 + len( title ) + 1 packet = wolfpack.packet( 0xd4, packetlength ) pa... |
def onBookUpdatePage( char, item, page, content ): if item.hastag( 'protected' ): char.message( 'This book is protected' ) | def onBookUpdatePage(char, item, page, content): if item.hastag('protected'): char.message('This book is read only.') | def onBookUpdatePage( char, item, page, content ): if item.hastag( 'protected' ): char.message( 'This book is protected' ) return if item.hastag( 'pages' ): pages = int( item.gettag( 'pages' ) ) else: pages = 64 if page > pages or page < 1: return if len( content.strip() ) == 0: item.deltag( 'page%u' % page ) return... |
if str.upper() == "TRUE": | if str == "1" or str.upper() == "TRUE": | def str2bool( str ): if str.upper() == "TRUE": return True return False |
target.char.update() | target.char.logouttime = 1 target.char.removefromview() | def disconnecttarget( char, args, target ): if not target.char or target.char.npc: char.socket.sysmessage( "That is not a valid character." ) if target.char: if target.char.socket: target.char.socket.disconnect() target.char.update() return 1 |
duration = int(char.skill[MAGERY] / 100) | duration = int(char.skill[MAGERY] * 200) | def cast(self, char, mode, args): if char.polymorph: if char.socket: char.socket.clilocmessage(1005559) return 0 |
if len(new_lock) != 0: key.settag('lock', new_lock) char.socket.sysmessage(tr('This key now unlocks: ') + new_lock) else: key.deltag('lock') char.socket.sysmessage(tr('You erase the lock information from the key.')) | if old_lock != new_lock: char.log(LOG_TRACE, tr("Changing lock of key 0x%x from '%s' to '%s'.\n") % (key.serial, old_lock, new_lock)) if len(new_lock) != 0: key.settag('lock', new_lock) char.socket.sysmessage(tr('This key now unlocks: ') + new_lock) else: key.deltag('lock') char.socket.sysmessage(tr('You erase the lock... | 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 new_name = response.text[1][:30] # 30 Chars max. key.name = new_name char.socket.sysmessage(tr("You renamed the ke... |
text = '<basefont color=" | text = tr('<basefont color=" | def rename_key(char, key): |
gump.addText(x=20, y=65, text='The name of this key:', hue=0x835) | gump.addText(x=20, y=65, text=tr('The name of this key:'), hue=0x835) | def rename_key(char, key): |
gump.addText(x=235, y=65, text='The lock id of this key:', hue=0x835) | gump.addText(x=235, y=65, text=tr('The lock id of this key:'), hue=0x835) | def rename_key(char, key): |
gump.addText(x=50, y=130, text='Modify key', hue=0x835) | gump.addText(x=50, y=130, text=tr('Modify key'), hue=0x835) | def rename_key(char, key): |
gump.addText(x=50, y=170, text='Cancel', hue=0x835) | gump.addText(x=50, y=170, text=tr('Cancel'), hue=0x835) | def rename_key(char, key): |
gump.addText( 275, 80 + offset, tr("Category: ") + page.category, 0x844 + 5 * pagetype ) gump.addText( 275, 60 + offset, tr("Time: ") + time.strftime(FORMAT_DATETIME, time.localtime(page.created)), 0x844 + 5 * pagetype ) | gump.addText( 300, 80 + offset, tr("Category: ") + page.category, 0x844 + 5 * pagetype ) gump.addText( 300, 60 + offset, tr("Time: ") + time.strftime(FORMAT_DATETIME, time.localtime(page.created)), 0x844 + 5 * pagetype ) | def pages_gump(player, i=0): player.socket.closegump(0x87bde41a) global pages pages.check() # Make sure all pages are valid count = (pages.count() + 4) / 5 if count < 1: count = 1 if i >= count or i < 0: i = 0 gump = wolfpack.gumps.cGump() #gump.startPage(0) # Gump Background gump.addBackground( 0xE10, 480, 360 )... |
message = "Casting spell %u (%s) on character %s (0x%x).\n" % (spell.spellid, spell.__class__.__name__, target.char.name, target.char.serial) | if type(self.spellid) == int: message = "Casting spell %u (%s) on character %s (0x%x).\n" % (spell.spellid, spell.__class__.__name__, target.char.name, target.char.serial) else: message = "Casting spell %s on character %s (0x%x).\n" % (spell.__class__.__name__, target.char.name, target.char.serial) | def target_response( char, args, target ): # No more npc saftey from here char.socket.deltag('cast_target') spell = args[0] mode = args[1] item = args[3] args = args[2] if type(item) == int: item = wolfpack.findobject(item) # Object went out of scope if not item: fizzle(char) return # Char Targets if target.char and ... |
chance = ( (player.skill[BLACKSMITHING] - minskill) / (maxskill - minskill) ) / 10.0 | penalty = self.skills[BLACKSMITHING][2] if not penalty: penalty = 250 minskill += penalty maxskill += penalty chance = ( player.skill[BLACKSMITHING] - minskill ) / 10 if chance > 100: chance = 100 elif chance < 0: chance = chance * -1 chance = chance * .01 | def getexceptionalchance(self, player, arguments): # Only works if this item requires blacksmithing if not self.skills.has_key(BLACKSMITHING): return 0 |
action.skills[skill] = [minimum, maximum] | try: penalty = hex2dec(subchild.getattribute('penalty','0')) except: console.log(LOG_ERROR, "%s element with invalid max value in menu %s.\n" % (subchild.name, menu.id)) action.skills[skill] = [minimum, maximum, penalty] | itemdef = child.getattribute('definition') |
successsmelt( char, ingottable, resname, amount, ingotdef ) ore.delete() | char.socket.clilocmessage( 501987, '', GRAY ) return OOPS | successsmelt( char, ingottable, resname, amount, ingotdef ) |
target.effect(0x376A, 9, 32) target.soundeffect(0x202) | target.char.effect(0x376A, 9, 32) target.char.soundeffect(0x202) | def dorestore( char, args, target ): if target.item: char.socket.sysmessage( 'That was not a valid character!', GRAY ) elif target.char: target.char.hitpoints = int( target.char.maxhitpoints ) target.char.stamina = int( target.char.maxstamina ) target.char.mana = int( target.char.maxmana ) target.char.updatestats() tar... |
if target.char.priv & 0x04 or target.char.dead: | if target.char.dead: | def response( char, args, target ): socket = char.socket # Check for a valid target if not target.char: socket.clilocmessage( 0x7A263, "", 0x3b2, 3, char ) # Only living things have anatomies return if target.char == char: socket.clilocmessage( 0x7A264, "", 0x3b2, 3, char ) # You know yourself quite well enough alre... |
gump.addText( 250, 120, unicode( "%s" % player.region ), 0x834 ) | gump.addText( 250, 120, unicode( "%s" % unicode(player.region) ), 0x834 ) | def callbackWho( char, args, choice ): socket = char.socket wholist = args[0] if choice.button == 0: return False elif wholist[ choice.button - 10 ]: player = wolfpack.findchar( wholist[ choice.button - 10 ] ) pos = player.pos account = player.account # Socket Information gump = cGump( 0, 0, 0, 50, 50 ) gump.addBackgro... |
config.write("INCLUDEPATH += %s" % ( py_incpath ) ) | config.write("INCLUDEPATH += %s\n" % ( py_incpath ) ) | def main(): checkPython() checkQt() # Create config.pri global py_libpath global py_libfile global py_incpath global qt_qmake config = file("config.pri", "w") config.write("# WARNING: This file was automatically generated by configure.py\n ") config.write("# any changes to this file will be lost!\n") config... |
config.write("LIBS += %s" % LIBS) | config.write("LIBS += %s\n" % LIBS) | def main(): checkPython() checkQt() # Create config.pri global py_libpath global py_libfile global py_incpath global qt_qmake config = file("config.pri", "w") config.write("# WARNING: This file was automatically generated by configure.py\n ") config.write("# any changes to this file will be lost!\n") config... |
parser.parse("data/decoration.2.xml") | parser.parse("data/decoration.3.xml") | def decoration( socket, command, arguments ): if len(arguments) > 0: args = str(arguments) if args == 'save': saveObject = DecorationSaveHandler(socket) socket.sysmessage("Sorting items") saveObject.sort() saveObject.save() else: parser = xml.sax.make_parser() handler = DecorationHandler() parser.setContentHandler(han... |
return 1 | return True | def onContextCheckVisible( char, target, tag ): if (target.skill[tag - 1] >= 300): return 1 # visible return 0 # not visible |
return 0 | return False | def onContextCheckVisible( char, target, tag ): if (target.skill[tag - 1] >= 300): return 1 # visible return 0 # not visible |
return 0 | return False | def onContextCheckEnabled( char, target, tag ): skill = tag - 1 if ( skill == STEALTH and char.skill[ HIDING ] < 800 ): return 0 # disabled if ( skill == REMOVETRAPS and ( char.skill[ LOCKPICKING ] < 500 or char.skill[ DETECTINGHIDDEN ] < 500 ) ): return 0 # disabled if ( char.skill[ skill ] >= MAX_TEACHING ): return 0... |
return 0 | return False if ( char.skill[ skill ] >= char.skillcap[ skill ] ): return False | def onContextCheckEnabled( char, target, tag ): skill = tag - 1 if ( skill == STEALTH and char.skill[ HIDING ] < 800 ): return 0 # disabled if ( skill == REMOVETRAPS and ( char.skill[ LOCKPICKING ] < 500 or char.skill[ DETECTINGHIDDEN ] < 500 ) ): return 0 # disabled if ( char.skill[ skill ] >= MAX_TEACHING ): return 0... |
return 1 | return True | def onContextCheckEnabled( char, target, tag ): skill = tag - 1 if ( skill == STEALTH and char.skill[ HIDING ] < 800 ): return 0 # disabled if ( skill == REMOVETRAPS and ( char.skill[ LOCKPICKING ] < 500 or char.skill[ DETECTINGHIDDEN ] < 500 ) ): return 0 # disabled if ( char.skill[ skill ] >= MAX_TEACHING ): return 0... |
return 1 | return True | def onContextEntry( char, target, tag ): skill = tag - 1 if ( char.dead or skill < 0 ): return 1 baseToSet = target.skill[ skill ] / ( 1000 / MAX_TEACHING ) if ( baseToSet > MAX_TEACHING ): baseToSet = MAX_TEACHING elif ( baseToSet < MIN_TEACHING ): target.say( str( baseToSet ) ) return 1 pointsToLearn = baseToSet -... |
target.say( str( baseToSet ) ) return 1 | return True | def onContextEntry( char, target, tag ): skill = tag - 1 if ( char.dead or skill < 0 ): return 1 baseToSet = target.skill[ skill ] / ( 1000 / MAX_TEACHING ) if ( baseToSet > MAX_TEACHING ): baseToSet = MAX_TEACHING elif ( baseToSet < MIN_TEACHING ): target.say( str( baseToSet ) ) return 1 pointsToLearn = baseToSet -... |
if ( pointsToLearn < 0 ): return 1 | pointsToLearn = min( pointsToLearn, char.skillcap[ skill ] - char.skill[ skill ] ) if ( pointsToLearn <= 0 ): return True | def onContextEntry( char, target, tag ): skill = tag - 1 if ( char.dead or skill < 0 ): return 1 baseToSet = target.skill[ skill ] / ( 1000 / MAX_TEACHING ) if ( baseToSet > MAX_TEACHING ): baseToSet = MAX_TEACHING elif ( baseToSet < MIN_TEACHING ): target.say( str( baseToSet ) ) return 1 pointsToLearn = baseToSet -... |
return True | return False | def onDropOnItem( container, item ): dropper = item.container # Turn off the lightsource if item.id in burning and ids.has_key( item.id ): item.id = ids[item.id] wolfpack.queuecode(update_light, (item.serial, )) dropper.soundeffect(0x226) return True |
def checktool(char, item, wearout = 0): | def checktool(char, item, wearout = False): | def checktool(char, item, wearout = 0): if not item: return 0 # Has to be in our posession if item.getoutmostchar() != char: char.socket.clilocmessage(500364) return 0 # We do not allow "invulnerable" tools. if not item.hastag('remaining_uses'): char.socket.clilocmessage(1044038) item.delete() return 0 if wearout: u... |
return 0 | return False | def checktool(char, item, wearout = 0): if not item: return 0 # Has to be in our posession if item.getoutmostchar() != char: char.socket.clilocmessage(500364) return 0 # We do not allow "invulnerable" tools. if not item.hastag('remaining_uses'): char.socket.clilocmessage(1044038) item.delete() return 0 if wearout: u... |
return 1 | item.resendtooltip() return True | def checktool(char, item, wearout = 0): if not item: return 0 # Has to be in our posession if item.getoutmostchar() != char: char.socket.clilocmessage(500364) return 0 # We do not allow "invulnerable" tools. if not item.hastag('remaining_uses'): char.socket.clilocmessage(1044038) item.delete() return 0 if wearout: u... |
return 1 | return True | def onUse(char, item): if not checktool(char, item): return 1 menu = findmenu('TAILORING') if menu: menu.send(char, [item.serial]) return 1 |
return 0 | return False | def getexceptionalchance(self, player, arguments): # Only works if this item requires blacksmithing if not self.skills.has_key(TAILORING): return 0 |
checktool(player, wolfpack.finditem(arguments[0]), 1) | checktool(player, wolfpack.finditem(arguments[0]), True) | def applyproperties(self, player, arguments, item, exceptional): # All tailoring items crafted out of leather gain the special color if self.submaterial1 > 0: material = self.parent.getsubmaterial1used(player, arguments) material = self.parent.submaterials1[material] item.color = material[4] item.settag('resname', mate... |
return 0 | return False | def make(self, player, arguments, nodelay=0): assert(len(arguments) > 0, 'Arguments has to contain a tool reference.') |
return 0 | return False | def getsubmaterial1used(self, player, arguments): if not player.hastag('tailoring_leather'): return 0 else: material = int(player.gettag('tailoring_leather')) if material < len(self.submaterials1): return material else: return 0 |
def onShowToolTip( sender, target, tooltip ): | def onShowTooltip( sender, target, tooltip ): | def onShowToolTip( sender, target, tooltip ): if target.gettag( 'filled' ) == 1: filled( target, tooltip ) else: unfilled( target, tooltip) tooltip.send ( sender ) return True |
player.socket.sysmessage('There are %u members of your guild logged in.' % len(online)) | player.socket.sysmessage('There are %u other members of your guild logged on.' % len(online), 0x30) | def onLogin(player): if player.hastag('guildmessages'): count = int(player.gettag('guildmessages')) for i in range(0, count): name = 'guildmessage' + str(i) text = unicode(player.gettag(name)) player.socket.sysmessage(text) # Make sure that this event is removed as soon as we don't are in a guild anymore if not playe... |
player.socket.sysmessage('There is one member of your guild logged in.') | player.socket.sysmessage('There is one other member of your guild logged on.', 0x30) | def onLogin(player): if player.hastag('guildmessages'): count = int(player.gettag('guildmessages')) for i in range(0, count): name = 'guildmessage' + str(i) text = unicode(player.gettag(name)) player.socket.sysmessage(text) # Make sure that this event is removed as soon as we don't are in a guild anymore if not playe... |
if statusPacket == 1: status = 'olfpack, Clients=%i, Items=%i, Chars=%i, Version=%s' % ( wolfpack.sockets.count(), wolfpack.itemcount(), wolfpack.charcount(), wolfpack.serverversion() ) | if statusPacket: status = 'Wolfpack, Clients=%i, Items=%i, Chars=%i, Version=%s' % (wolfpack.sockets.count(), wolfpack.itemcount(), wolfpack.charcount(), wolfpack.serverversion()) | def handleStatus(socket, packet): statusPacket = 1 for i in range( 0, packet.size ): if ( packet.getbyte(i) != statusRequest[i] ): statusPacket = 0 if statusPacket == 1: status = 'olfpack, Clients=%i, Items=%i, Chars=%i, Version=%s' % ( wolfpack.sockets.count(), wolfpack.itemcount(), wolfpack.charcount(), wolfpack.se... |
gateGump = cGump( 1, 1, 0, 30, 30 ) | gateGump = cGump( 1, 1, 0, 100, 120 ) | def sendGump( char, item ): char.soundeffect( 0x58 ) # noclose, nomove gump gateGump = cGump( 1, 1, 0, 30, 30 ) # trammel gateGump.startPage( 1 ) gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination:" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCE... |
gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination:" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCEL" ) | gateGump.addBackground( 9200, 380, 280 ) gateGump.addText( 5, 10, "Pick your destination:" ) gateGump.addButton( 10, 210, 0xFA5, 0xFA7, 1 ) gateGump.addText( 45, 210, "OKAY", 0 ) gateGump.addButton( 10, 235, 0xFA5, 0xFA7, 0 ) gateGump.addText( 45, 235, "CANCEL" ) | def sendGump( char, item ): char.soundeffect( 0x58 ) # noclose, nomove gump gateGump = cGump( 1, 1, 0, 30, 30 ) # trammel gateGump.startPage( 1 ) gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination:" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCE... |
gateGump.addText( 70, 70, "Trammel", 12 ) gateGump.addPageButton( 48, 72, 0x4B9, 0x4BA, 1 ) gateGump.addText( 70, 90, "Felucca" ) gateGump.addPageButton( 48, 95, 0x4B9, 0x4BA, 2 ) gateGump.addText( 70, 110, "Ilshenar" ) gateGump.addPageButton( 48, 115, 0x4B9, 0x4BA, 3 ) | gateGump.addText( 35, 35, "Trammel", 61 ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca" ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar" ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) | def sendGump( char, item ): char.soundeffect( 0x58 ) # noclose, nomove gump gateGump = cGump( 1, 1, 0, 30, 30 ) # trammel gateGump.startPage( 1 ) gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination:" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCE... |
gateGump.addText( 170, 70, "Britain" ) gateGump.addButton( 150, 75, 0x837, 0x838, 5 ) gateGump.addText( 170, 90, "Magincia" ) gateGump.addButton( 150, 95, 0x837, 0x838, 6 ) gateGump.addText( 170, 110, "Moonglow" ) gateGump.addButton( 150, 115, 0x837, 0x838, 7 ) gateGump.addText( 170, 130, "Skara Brae" ) gateGump.addBut... | gateGump.addText( 225, 40, "Britain" ) gateGump.addRadioButton(200, 40, 210, 211, 10 ) gateGump.addText( 225, 65, "Magincia" ) gateGump.addRadioButton(200, 65, 210, 211, 11 ) gateGump.addText( 225, 90, "Moonglow" ) gateGump.addRadioButton(200, 90, 210, 211, 12 ) gateGump.addText( 225, 115, "Skara Brae" ) gateGump.addRa... | def sendGump( char, item ): char.soundeffect( 0x58 ) # noclose, nomove gump gateGump = cGump( 1, 1, 0, 30, 30 ) # trammel gateGump.startPage( 1 ) gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination:" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCE... |
gateGump.addText( 70, 70, "Trammel" ) gateGump.addPageButton( 48, 72, 0x4B9, 0x4BA, 1 ) gateGump.addText( 70, 90, "Felucca", 12 ) gateGump.addPageButton( 48, 95, 0x4B9, 0x4BA, 2 ) gateGump.addText( 70, 110, "Ilshenar" ) gateGump.addPageButton( 48, 115, 0x4B9, 0x4BA, 3 ) | gateGump.addText( 35, 35, "Trammel" ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca", 61 ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar" ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) | def sendGump( char, item ): char.soundeffect( 0x58 ) # noclose, nomove gump gateGump = cGump( 1, 1, 0, 30, 30 ) # trammel gateGump.startPage( 1 ) gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination:" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCE... |
gateGump.addText( 170, 70, "Britain" ) gateGump.addButton( 150, 75, 0x837, 0x838, 13 ) gateGump.addText( 170, 90, "Magincia" ) gateGump.addButton( 150, 95, 0x837, 0x838, 14 ) gateGump.addText( 170, 110, "Moonglow" ) gateGump.addButton( 150, 115, 0x837, 0x838, 15 ) gateGump.addText( 170, 130, "Skara Brae" ) gateGump.add... | gateGump.addText( 225, 40, "Britain" ) gateGump.addRadioButton(200, 40, 210, 211, 18 ) gateGump.addText( 225, 65, "Magincia" ) gateGump.addRadioButton(200, 65, 210, 211, 19 ) gateGump.addText( 225, 90, "Moonglow" ) gateGump.addRadioButton(200, 90, 210, 211, 20 ) gateGump.addText( 225, 115, "Skara Brae" ) gateGump.addRa... | def sendGump( char, item ): char.soundeffect( 0x58 ) # noclose, nomove gump gateGump = cGump( 1, 1, 0, 30, 30 ) # trammel gateGump.startPage( 1 ) gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination:" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCE... |
gateGump.addText( 70, 70, "Trammel" ) gateGump.addPageButton( 48, 72, 0x4B9, 0x4BA, 1 ) gateGump.addText( 70, 90, "Felucca" ) gateGump.addPageButton( 48, 95, 0x4B9, 0x4BA, 2 ) gateGump.addText( 70, 110, "Ilshenar", 12 ) gateGump.addPageButton( 48, 115, 0x4B9, 0x4BA, 3 ) | gateGump.addText( 35, 35, "Trammel" ) gateGump.addPageButton( 10, 35, 0x4B9, 0x4BA, 1 ) gateGump.addText( 35, 60, "Felucca" ) gateGump.addPageButton( 10, 60, 0x4B9, 0x4BA, 2 ) gateGump.addText( 35, 85, "Ilshenar", 61 ) gateGump.addPageButton( 10, 85, 0x4B9, 0x4BA, 3 ) | def sendGump( char, item ): char.soundeffect( 0x58 ) # noclose, nomove gump gateGump = cGump( 1, 1, 0, 30, 30 ) # trammel gateGump.startPage( 1 ) gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination:" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCE... |
gateGump.addText( 170, 70, "Compassion" ) gateGump.addButton( 150, 75, 0x837, 0x838, 21 ) gateGump.addText( 170, 90, "Honesty" ) gateGump.addButton( 150, 95, 0x837, 0x838, 22 ) gateGump.addText( 170, 110, "Honor" ) gateGump.addButton( 150, 115, 0x837, 0x838, 23 ) gateGump.addText( 170, 130, "Humility" ) gateGump.addBut... | gateGump.addText( 225, 40, "Compassion" ) gateGump.addRadioButton( 200, 40, 210, 211, 26 ) gateGump.addText( 225, 65, "Honesty" ) gateGump.addRadioButton( 200, 65, 210, 211, 27 ) gateGump.addText( 225, 90, "Honor" ) gateGump.addRadioButton( 200, 90, 210, 211, 28 ) gateGump.addText( 225, 115, "Humility" ) gateGump.addRa... | def sendGump( char, item ): char.soundeffect( 0x58 ) # noclose, nomove gump gateGump = cGump( 1, 1, 0, 30, 30 ) # trammel gateGump.startPage( 1 ) gateGump.addBackground( 9200, 300, 255 ) gateGump.addText( 40, 40, "Pick your destination:" ) gateGump.addButton( 47, 207, 0xFA5, 0xFA7, 0 ) gateGump.addText( 80, 210, "CANCE... |
wolfpack.effect(0x3728, target.pos, 8, 20) target.soundeffect(0x201) target.delete() | if self.checkresist(char, tgarget): target.effect(0x3779, 10, 20) else: wolfpack.effect(0x3728, target.pos, 8, 20) target.soundeffect(0x201) target.delete() items = wolfpack.items(target.x, target.y, char.pos.map, 8) for item in items: if target.hastag('dispellable_field'): wolfpack.effect(0x376a, target.pos, 9, 20) ... | def target(self, char, mode, targettype, target, args=[]): if not self.consumerequirements(char, mode): return |
( baseid, id, x, y, z, map, color ) = line.split( ' ' ) baseid = baseid | ( id, x, y, z, color ) = line.split( ' ' ) | def parseTxt( file, map ): warnings = '' count = 0 parseTickCount = 0 createTickCount = 0 propTickCount = 0 moveTickCount = 0 for line in file: step1 = wolfpack.tickcount() # Replace \r and \n's line = line.replace( "\r", "" ) line = line.replace( "\n", "" ) ( baseid, id, x, y, z, map, color ) = line.split( ' ' ) ... |
map = int( map ) | def parseTxt( file, map ): warnings = '' count = 0 parseTickCount = 0 createTickCount = 0 propTickCount = 0 moveTickCount = 0 for line in file: step1 = wolfpack.tickcount() # Replace \r and \n's line = line.replace( "\r", "" ) line = line.replace( "\n", "" ) ( baseid, id, x, y, z, map, color ) = line.split( ' ' ) ... | |
server_address = ( '', self.port ) time.sleep( 5 ) print "Remote Admin running on port %u\n" % self.port try: filepath = os.path.normpath( os.path.abspath( 'web/' ) ) self.httpd = Webserver( ( '', self.port ), filepath ) except: traceback.print_exc() return while 1: self.httpd.handle_request() self.stopped.wait( 0... | server_address = ( '', self.port ) if not wolfpack.isreloading(): wolfpack.console.send( "Remote Admin running on port %u\n" % self.port ) try: filepath = os.path.normpath( os.path.abspath( 'web/' ) ) self.httpd = Webserver( ( '', self.port ), filepath ) except: traceback.print_exc() return while 1: self.httpd.hand... | def run( self ): |
if type(self.spellid) == int: | if type(spell.spellid) == int: | def target_response( char, args, target ): # No more npc saftey from here char.socket.deltag('cast_target') spell = args[0] mode = args[1] item = args[3] args = args[2] if type(item) == int: item = wolfpack.findobject(item) # Object went out of scope if not item: fizzle(char) return # Char Targets if target.char and ... |
char.socket.deltag( 'wood_gem' ) | def successlumberjacking( char, args ): socket = char.socket pos = args[0] # Target POS resource = args[1] amount = args[2] tool = args[3] resname = args[4] table = args[5] # Lets make sure we stayed next to the tree # Player can reach that ? if char.pos.map != pos.map or char.pos.distance( pos ) > chopdistance: socke... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.