wpdev-commits Mailing List for Wolfpack Emu (Page 22)
Brought to you by:
rip,
thiagocorrea
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(121) |
Sep
(256) |
Oct
(59) |
Nov
(73) |
Dec
(120) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(259) |
Feb
(381) |
Mar
(501) |
Apr
(355) |
May
(427) |
Jun
(270) |
Jul
(394) |
Aug
(412) |
Sep
(724) |
Oct
(578) |
Nov
(65) |
Dec
|
From: Sebastian H. <dar...@us...> - 2004-10-05 16:25:06
|
Update of /cvsroot/wpdev/wolfpack/tools/translationupdate In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9967/tools/translationupdate Modified Files: fetchtrwp.cpp Log Message: updated python translations Index: fetchtrwp.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/tools/translationupdate/fetchtrwp.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fetchtrwp.cpp 26 Sep 2004 12:45:54 -0000 1.2 --- fetchtrwp.cpp 5 Oct 2004 16:24:19 -0000 1.3 *************** *** 18,23 **** void fetchtr_py( const char* fileName, MetaTranslator* tor, const char* /*defaultContext*/, bool mustExist ) { ! static QRegExp matchtr("\\W(tr)\\s{0,1}\\("); ! static QRegExp stringDelimiter("(\"?|\'?)"); static QString context("@pythonscript"); --- 18,25 ---- void fetchtr_py( const char* fileName, MetaTranslator* tor, const char* /*defaultContext*/, bool mustExist ) { ! static QRegExp matchtr1("\\btr\\s{0,1}\\(\\s*\""); // Escaped by " ! static QRegExp matchtr2("\\btr\\s{0,1}\\(\\s*'"); // Escaped by " ! //static QRegExp stringDelimiter("(\"?|\'?)"); ! //static QRegExp stringDelimiter2("(\"?|\'?)"); static QString context("@pythonscript"); *************** *** 30,58 **** } QString content = QString( f.readAll() ); ! content.replace( QRegExp("#[^\n]*"), "" );; // remove single line comments int pos = 0; ! while ( ( pos = matchtr.search(content, pos) ) != -1 ) { ! QString message = content.mid(pos + matchtr.matchedLength()); ! int start = 0, end = 0; ! if ( ( start = stringDelimiter.search(message) ) == -1 ) ! { ! pos += matchtr.matchedLength(); ! continue; } ! QString startDelimiter = message.mid( start, stringDelimiter.matchedLength() ); ! end = message.find( startDelimiter, start + startDelimiter.length() ); ! if ( end == -1 ) ! { ! fprintf( stderr, "translationUpdate error: Open string in tr() '%s': %i\n", fileName, pos ); ! return; } ! ! QString source = message.mid( start + startDelimiter.length(), end - startDelimiter.length() ); ! if ( !source.isEmpty() ) ! tor->insert( MetaTranslatorMessage( context.utf8(), source.utf8(), QString(fileName).utf8(), QString::null, TRUE ) ); ! pos += QMAX( end, matchtr.matchedLength() ); } - } --- 32,131 ---- } QString content = QString( f.readAll() ); ! //content.replace( QRegExp("^#[^\n]*"), "" );; // remove single line comments ! ! int pos = 0; ! while ( ( pos = matchtr1.search(content, pos) ) != -1 ) { ! QString message = content.mid(pos + matchtr1.matchedLength()); ! QString realMessage; ! ! // Process the following string char-by-char ! unsigned int i = 0; ! while (i < message.length()) { ! QCharRef cref = message.at(i); ! ! // An escaped character ! if (cref == '\\' && i + 1 < message.length()) { ! // Get the next character ! QCharRef next = message.at(i+1); ! if (next == 'n') { ! realMessage.append('\n'); ! } else if ( next == '\t' ) { ! realMessage.append('\t'); ! } else if ( next == '\n' ) { ! // Skip escaped newlines ! } else { ! realMessage.append(next); ! } ! ! ++i; // Skip the next character ! // End of string ! } else if ( cref == '\n' ) { ! // This is an error, an unescaped newline breaks the string ! fprintf( stderr, "translationUpdate error: Open string in tr() '%s': %i\n", fileName, pos ); ! return; ! } else if ( cref == '"' ) { ! break; ! } else { ! realMessage.append(cref); ! } ! ! ++i; } ! ! if (!realMessage.isEmpty()) { ! tor->insert( MetaTranslatorMessage( context.utf8(), realMessage.utf8(), QString(fileName).utf8(), QString::null, TRUE ) ); } ! ! pos += matchtr1.matchedLength() + i; ! } ! ! pos = 0; ! while ( ( pos = matchtr2.search(content, pos) ) != -1 ) ! { ! QString message = content.mid(pos + matchtr2.matchedLength()); ! QString realMessage; ! ! // Process the following string char-by-char ! unsigned int i = 0; ! while (i < message.length()) { ! QCharRef cref = message.at(i); ! ! // An escaped character ! if (cref == '\\' && i + 1 < message.length()) { ! // Get the next character ! QCharRef next = message.at(i+1); ! if (next == 'n') { ! realMessage.append('\n'); ! } else if ( next == '\t' ) { ! realMessage.append('\t'); ! } else if ( next == '\n' ) { ! // Skip escaped newlines ! } else { ! realMessage.append(next); ! } ! ! ++i; // Skip the next character ! // End of string ! } else if ( cref == '\n' ) { ! // This is an error, an unescaped newline breaks the string ! fprintf( stderr, "translationUpdate error: Open string in tr() '%s': %i\n", fileName, pos ); ! return; ! } else if ( cref == '\'' ) { ! break; ! } else { ! realMessage.append(cref); ! } ! ! ++i; ! } ! ! if (!realMessage.isEmpty()) { ! tor->insert( MetaTranslatorMessage( context.utf8(), realMessage.utf8(), QString(fileName).utf8(), QString::null, TRUE ) ); ! } ! ! pos += matchtr2.matchedLength() + i; } } |
From: Sebastian H. <dar...@us...> - 2004-10-05 13:23:17
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28830/commands Modified Files: boom.py Log Message: go boom now uses less boom of server cpu ^^ Index: boom.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/boom.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** boom.py 5 Oct 2004 13:02:12 -0000 1.1 --- boom.py 5 Oct 2004 13:22:03 -0000 1.2 *************** *** 13,35 **** if 0.5 >= random.random(): t = random.randint(0, 2) - - item = wolfpack.additem('eed') - item.moveto(x, y, z, map) # Fire Column if t == 0: ! wolfpack.effect(0x3709, pos, 10, 30) ! item.soundeffect(0x208) # Explosion elif t == 1: ! wolfpack.effect(0x36bd, pos, 20, 10) ! item.soundeffect(0x307) # Ball of fire elif t == 2: ! wolfpack.effect(0x36fe, pos, 10, 10) ! ! item.delete() # Go boom --- 13,30 ---- if 0.5 >= random.random(): t = random.randint(0, 2) # Fire Column if t == 0: ! pos.effect(0x3709, 10, 30) ! pos.soundeffect(0x208) # Explosion elif t == 1: ! pos.effect(0x36bd, 20, 10) ! pos.soundeffect(0x307) # Ball of fire elif t == 2: ! pos.effect(0x36fe, 10, 10) # Go boom |
From: Sebastian H. <dar...@us...> - 2004-10-05 13:22:47
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28604/python Modified Files: pycoord.cpp Log Message: additions Index: pycoord.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/pycoord.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** pycoord.cpp 16 Sep 2004 01:40:19 -0000 1.25 --- pycoord.cpp 5 Oct 2004 13:21:22 -0000 1.26 *************** *** 31,34 **** --- 31,37 ---- #include "../items.h" #include "../basechar.h" + #include "../player.h" + #include "../network/uosocket.h" + #include "../network/network.h" /* *************** *** 178,181 **** --- 181,241 ---- } + /* + \method coord.effect + \param id The art id of the effect to play. + \param speed The speed of the effect. + \param duration The duration of the effect. + \description Shows a graphical effect at the given position. + */ + static PyObject* wpCoord_effect( wpCoord* self, PyObject* args ) + { + unsigned short id, duration, speed; + if (!PyArg_ParseTuple(args, "hhh:coord.effect(id, speed, duration)", &id, &speed, &duration)) { + return 0; + } + + cUOTxEffect effect; + effect.setType( ET_STAYSOURCEPOS ); + effect.setId( id ); + effect.setSourcePos( self->coord ); + effect.setDuration( duration ); + effect.setSpeed( speed ); + + cUOSocket* mSock; + for ( mSock = Network::instance()->first(); mSock; mSock = Network::instance()->next() ) + { + if ( mSock->player() && mSock->player()->pos().distance( self->coord ) <= mSock->player()->visualRange() ) + mSock->send( &effect ); + } + + Py_RETURN_NONE; + } + + /* + \method coord.soundeffect + \param id The id of the sound. + \description Plays a soundeffect at the position. + */ + static PyObject* wpCoord_soundeffect( wpCoord* self, PyObject* args ) + { + unsigned short id; + if (!PyArg_ParseTuple(args, "h:coord.soundeffect(id)", &id)) { + return 0; + } + + cUOTxSoundEffect effect; + effect.setSound(id); + effect.setCoord(self->coord); + + cUOSocket* mSock; + for ( mSock = Network::instance()->first(); mSock; mSock = Network::instance()->next() ) + { + if ( mSock->player() && mSock->player()->pos().distance( self->coord ) <= mSock->player()->visualRange() ) + mSock->send( &effect ); + } + + Py_RETURN_NONE; + } + static PyMethodDef wpCoordMethods[] = { *************** *** 184,187 **** --- 244,249 ---- { "validspawnspot", ( getattrofunc ) wpCoord_validspawnspot, METH_VARARGS, NULL }, { "lineofsight", ( getattrofunc ) wpCoord_lineofsight, METH_VARARGS, NULL }, + { "effect", (getattrofunc) wpCoord_effect, METH_VARARGS, NULL }, + { "soundeffect", (getattrofunc) wpCoord_soundeffect, METH_VARARGS, NULL }, { 0, 0, 0, 0 } }; |
From: Sebastian H. <dar...@us...> - 2004-10-05 13:22:47
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28604 Modified Files: ChangeLog Log Message: additions Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** ChangeLog 3 Oct 2004 13:51:39 -0000 1.94 --- ChangeLog 5 Oct 2004 13:21:21 -0000 1.95 *************** *** 27,30 **** --- 27,31 ---- - Guards now run towards their targets. - Fixed bug #0000345. + - Python now allows effects and sounds on coords. Wolfpack 12.9.11 Beta (26. September 2004) |
From: Sebastian H. <dar...@us...> - 2004-10-05 13:22:46
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28604/network Modified Files: asyncnetio.cpp Log Message: additions Index: asyncnetio.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/asyncnetio.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** asyncnetio.cpp 19 Sep 2004 22:13:35 -0000 1.54 --- asyncnetio.cpp 5 Oct 2004 13:21:22 -0000 1.55 *************** *** 450,457 **** } } ! else if ( nread == 0 ) { d->socket->close(); ! } } else --- 450,457 ---- } } ! /*else if ( nread == 0 ) { d->socket->close(); ! }*/ } else |
From: Sebastian H. <dar...@us...> - 2004-10-05 13:02:22
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24374/commands Added Files: boom.py Log Message: locks --- NEW FILE: boom.py --- import wolfpack from math import sqrt import random def boom_timer(object, args): (x, y, map) = args z = wolfpack.map(x, y, map)['z'] pos = wolfpack.coord(x, y, z, map) if 0.5 >= random.random(): t = random.randint(0, 2) item = wolfpack.additem('eed') item.moveto(x, y, z, map) # Fire Column if t == 0: wolfpack.effect(0x3709, pos, 10, 30) item.soundeffect(0x208) # Explosion elif t == 1: wolfpack.effect(0x36bd, pos, 20, 10) item.soundeffect(0x307) # Ball of fire elif t == 2: wolfpack.effect(0x36fe, pos, 10, 10) item.delete() # Go boom def boom(socket, command, arguments): pos = socket.player.pos # Go boom for x in range(-12, 13): for y in range(-12, 13): dist = sqrt(x*x+y*y) if dist <= 12: delay = int(random.random() * 10000) wolfpack.addtimer(delay, 'commands.boom.boom_timer', [pos.x + x, pos.y + y, pos.map]) def onLoad(): wolfpack.registercommand('boom', boom) |
From: Sebastian H. <dar...@us...> - 2004-10-05 13:02:19
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24275 Modified Files: scripts.xml Log Message: locks Index: scripts.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/scripts.xml,v retrieving revision 1.165 retrieving revision 1.166 diff -C2 -d -r1.165 -r1.166 *** scripts.xml 29 Sep 2004 01:43:55 -0000 1.165 --- scripts.xml 5 Oct 2004 13:01:54 -0000 1.166 *************** *** 85,88 **** --- 85,89 ---- <script>commands.adddecor</script> <script>commands.bank</script> + <script>commands.boom</script> <script>commands.cast</script> <script>commands.decoration</script> |
From: Sebastian H. <dar...@us...> - 2004-10-05 12:41:59
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19048 Modified Files: lock.py Log Message: locks Index: lock.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/lock.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** lock.py 25 Aug 2004 17:03:05 -0000 1.13 --- lock.py 5 Oct 2004 12:41:49 -0000 1.14 *************** *** 7,11 **** --- 7,13 ---- import wolfpack + from wolfpack.consts import * from wolfpack.gumps import cGump + from wolfpack import * import random *************** *** 166,176 **** if item.hasscript( 'key' ) and item.hastag( 'lock' ): if lock == str(item.gettag('lock')): ! return 1 for subitem in item.content: ! if searchkey(subitem, lock): ! return 1 ! return 0 def onUse(char, item): --- 168,179 ---- if item.hasscript( 'key' ) and item.hastag( 'lock' ): if lock == str(item.gettag('lock')): ! return item for subitem in item.content: ! result = searchkey(subitem, lock) ! if result: ! return result ! return None def onUse(char, item): *************** *** 193,196 **** --- 196,200 ---- if char.gm: char.socket.clilocmessage(501281) + char.log(LOG_TRACE, tr("Accessed locked object 0x%x.\n") % item.serial) return 0 *************** *** 198,203 **** # if the user has the key in his posession. if item.hasscript( 'door' ): ! if searchkey(char.getbackpack(), lock): char.socket.clilocmessage(501282) return 0 --- 202,209 ---- # if the user has the key in his posession. if item.hasscript( 'door' ): ! key = searchkey(char.getbackpack(), lock) ! if key: char.socket.clilocmessage(501282) + char.log(LOG_TRACE, tr("Accessed locked door 0x%x using key 0x%x.\n") % (item.serial, key.serial)) return 0 |
From: Sebastian H. <dar...@us...> - 2004-10-05 12:24:21
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14705 Modified Files: key.py Log Message: key fixes Index: key.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/key.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** key.py 5 Oct 2004 12:19:37 -0000 1.15 --- key.py 5 Oct 2004 12:24:10 -0000 1.16 *************** *** 4,8 **** import random from wolfpack.gumps import cGump ! from wolfpack.consts import TINKERING def gump_response(char, args, response): --- 4,8 ---- import random from wolfpack.gumps import cGump ! from wolfpack.consts import * def gump_response(char, args, response): *************** *** 24,34 **** if char.gm: new_lock = response.text[2] ! 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.')) key.resendtooltip() --- 24,39 ---- if char.gm: new_lock = response.text[2] + old_lock = '' + if key.hastag('lock'): + old_lock = str(key.gettag('lock')) ! 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 information from the key.')) key.resendtooltip() *************** *** 49,59 **** 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) ! gump.addText(x=20, y=65, text='The name of this key:', hue=0x835) gump.addResizeGump(x=20, y=88, id=0xBB8, width=200, height=25) gump.addInputField(x=25, y=90, width=190, height=20, hue=0x834, id=1, starttext=key.name) --- 54,64 ---- if char.gm: ! text = tr('<basefont color="#FECECE"><h3>Manage Key</h3><br><basefont color="#FEFEFE">This dialog will help you to manage or rename this key.') else: ! text = tr('<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) ! gump.addText(x=20, y=65, text=tr('The name of this key:'), hue=0x835) gump.addResizeGump(x=20, y=88, id=0xBB8, width=200, height=25) gump.addInputField(x=25, y=90, width=190, height=20, hue=0x834, id=1, starttext=key.name) *************** *** 65,77 **** 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) gump.addButton(x=20, y=130, up=0x26af, down=0x26b1, returncode=1) ! gump.addText(x=50, y=170, text='Cancel', hue=0x835) gump.addButton(x=20, y=170, up=0x26af, down=0x26b1, returncode=0) --- 70,82 ---- lock = str(key.gettag('lock')) ! gump.addText(x=235, y=65, text=tr('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=tr('Modify key'), hue=0x835) gump.addButton(x=20, y=130, up=0x26af, down=0x26b1, returncode=1) ! gump.addText(x=50, y=170, text=tr('Cancel'), hue=0x835) gump.addButton(x=20, y=170, up=0x26af, down=0x26b1, returncode=0) |
From: Sebastian H. <dar...@us...> - 2004-10-05 12:19:54
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13661 Modified Files: key.py keyring.py Log Message: key fixes Index: keyring.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/keyring.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** keyring.py 25 Aug 2004 17:03:05 -0000 1.6 --- keyring.py 5 Oct 2004 12:19:37 -0000 1.7 *************** *** 85,90 **** --- 85,92 ---- if target.item.hastag('locked') and int(target.item.gettag('locked')) == 1: target.item.deltag('locked') + target.item.say(1048001, "", "", False, 0x3b2, char.socket) else: target.item.settag('locked',1) + target.item.say(1048000, "", "", False, 0x3b2, char.socket) char.soundeffect(0x241) return Index: key.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/key.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** key.py 5 Oct 2004 11:54:16 -0000 1.14 --- key.py 5 Oct 2004 12:19:37 -0000 1.15 *************** *** 1,4 **** --- 1,5 ---- import wolfpack + from wolfpack import tr import random from wolfpack.gumps import cGump *************** *** 6,169 **** 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("You renamed the key to '%s'" % new_name) ! # 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() def rename_key(char, key): # Build the lock gump ! gump = cGump(x=100, y=100, callback="key.gump_response") ! gump.setArgs([key.serial]) ! # Renaming, blanking and modification of keys allowed for gms ! gump.addBackground(id=0x2436, width=425, height=285) ! 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) ! gump.addText(x=20, y=65, text='The name of this key:', hue=0x835) ! gump.addResizeGump(x=20, y=88, id=0xBB8, width=200, height=25) ! gump.addInputField(x=25, y=90, width=190, height=20, hue=0x834, id=1, starttext=key.name) ! # 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) ! gump.addButton(x=20, y=130, up=0x26af, down=0x26b1, returncode=1) - gump.addText(x=50, y=170, text='Cancel', hue=0x835) - gump.addButton(x=20, y=170, up=0x26af, down=0x26b1, returncode=0) ! gump.send(char) 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 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 def onShowTooltip(char, item, tooltip): ! tooltip.reset() ! tooltip.add(0xF9060 + item.id, '') ! ! # 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 ") --- 7,180 ---- 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 key to '%s'") % new_name) ! # Rekey ! if char.gm: ! new_lock = response.text[2] ! 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.')) ! key.resendtooltip() def rename_key(char, key): # Build the lock gump ! gump = cGump(x=100, y=100, callback="key.gump_response") ! gump.setArgs([key.serial]) ! if not char.gm: ! width = 325 ! else: ! width = 425 ! # Renaming, blanking and modification of keys allowed for gms ! gump.addBackground(id=0x2436, width=width, height=220) ! 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) ! gump.addText(x=20, y=65, text='The name of this key:', hue=0x835) ! gump.addResizeGump(x=20, y=88, id=0xBB8, width=200, height=25) ! gump.addInputField(x=25, y=90, width=190, height=20, hue=0x834, id=1, starttext=key.name) ! # 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) ! gump.addButton(x=20, y=130, up=0x26af, down=0x26b1, returncode=1) ! ! gump.addText(x=50, y=170, text='Cancel', hue=0x835) ! gump.addButton(x=20, y=170, up=0x26af, down=0x26b1, returncode=0) ! ! gump.send(char) 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') ! target.item.say(1048001, "", "", False, 0x3b2, char.socket) ! else: ! target.item.settag('locked',1) ! target.item.say(1048000, "", "", False, 0x3b2, char.socket) ! char.soundeffect(0x241) ! target.item.resendtooltip() else: ! char.socket.clilocmessage(501668) ! else: ! char.socket.clilocmessage(501666) ! return 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 def onShowTooltip(char, item, tooltip): ! tooltip.reset() ! tooltip.add(0xF9060 + item.id, '') ! ! # The user defined name ! if len(item.name) > 0: ! tooltip.add(1060847, tr("Unlocks: ") + "\t" + item.name) ! ! # Add the lock id for gms ! if char.gm: ! if item.hastag('lock'): ! lock = str(item.gettag('lock')) ! tooltip.add(1050045, " \t" + tr("Lock: ") + lock + "\t ") ! else: ! tooltip.add(1050045, " \t" + tr("This key is blank") + "\t ") |
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 ") |
From: Sebastian H. <dar...@us...> - 2004-10-04 22:53:58
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27996/system Modified Files: skillgain.py Log Message: gain Index: skillgain.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/skillgain.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** skillgain.py 4 Oct 2004 22:52:24 -0000 1.15 --- skillgain.py 4 Oct 2004 22:53:48 -0000 1.16 *************** *** 257,261 **** # Introduce a new "Gain Factor" # There is also a 1% minimum chance for gain ! gainchance = gainchance * info[SKILL_GAINFACTOR]) # Multiply with another gainfactor --- 257,261 ---- # Introduce a new "Gain Factor" # There is also a 1% minimum chance for gain ! gainchance = gainchance * info[SKILL_GAINFACTOR] # Multiply with another gainfactor |
From: Sebastian H. <dar...@us...> - 2004-10-04 22:52:34
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27650/system Modified Files: skillgain.py Log Message: gain Index: skillgain.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/skillgain.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** skillgain.py 4 Oct 2004 22:50:42 -0000 1.14 --- skillgain.py 4 Oct 2004 22:52:24 -0000 1.15 *************** *** 18,22 **** SKILL_INTCHANCE = 7 ! GLOBAL_FACTOR = 0.5 # --- 18,22 ---- SKILL_INTCHANCE = 7 ! GLOBAL_FACTOR = 1.0 # *************** *** 261,264 **** --- 261,266 ---- # Multiply with another gainfactor gainchance = gainchance * GLOBAL_FACTOR + + char.log(LOG_TRACE, 'Gainchance for skill %s is %f.\n' % (SKILLNAMES[skill], gainchance)) # Tamed creatures get a * 2 bonus for their gain. |
From: Sebastian H. <dar...@us...> - 2004-10-04 22:50:54
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27108/system Modified Files: skillgain.py Log Message: lowered gain Index: skillgain.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/skillgain.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** skillgain.py 4 Oct 2004 21:42:17 -0000 1.13 --- skillgain.py 4 Oct 2004 22:50:42 -0000 1.14 *************** *** 18,21 **** --- 18,23 ---- SKILL_INTCHANCE = 7 + GLOBAL_FACTOR = 0.5 + # # Skill data registry *************** *** 255,259 **** # Introduce a new "Gain Factor" # There is also a 1% minimum chance for gain ! gainchance = max(0.01, gainchance * info[SKILL_GAINFACTOR]) # Tamed creatures get a * 2 bonus for their gain. --- 257,264 ---- # Introduce a new "Gain Factor" # There is also a 1% minimum chance for gain ! gainchance = gainchance * info[SKILL_GAINFACTOR]) ! ! # Multiply with another gainfactor ! gainchance = gainchance * GLOBAL_FACTOR # Tamed creatures get a * 2 bonus for their gain. |
From: Sebastian H. <dar...@us...> - 2004-10-04 21:53:56
|
Update of /cvsroot/wpdev/xmlscripts/definitions/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12833/system Modified Files: access.xml Log Message: access updates Index: access.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/system/access.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** access.xml 26 Sep 2004 17:45:03 -0000 1.7 --- access.xml 4 Oct 2004 21:53:41 -0000 1.8 *************** *** 25,28 **** --- 25,52 ---- </group> </acl> + + <acl id="coadmin" rank="99"> + <group name="command"> + <action name="any" permit="true" /> + <action name="RELOAD" permit="false" /> + <action name="IMPORT" permit="false" /> + <action name="EXPORT" permit="false" /> + <action name="ACCOUNT" permit="false" /> + <action name="SHUTDOWN" permit="false" /> + <action name="DECORATION" permit="false" /> + <action name="DOORGEN" permit="false" /> + <action name="EVAL" permit="false" /> + </group> + <group name="multi"> + <action name="any" permit="true" /> + </group> + <group name="RemoteAccess"> + <action name="any" permit="false" /> + </group> + <group name="Misc"> + <action name="Unlimited Tile" permit="true" /> + <action name="May Block Staff Accounts" permit="true" /> + </group> + </acl> <!-- GameMaster privs --> *************** *** 39,43 **** <action name="IMPORT" permit="false" /> <action name="OPTIMIZEDB" permit="false" /> - <action name="SEASON" permit="false" /> <action name="SHUTDOWN" permit="false" /> </group> --- 63,66 ---- *************** *** 69,73 **** <action name="OPTIMIZEDB" permit="false" /> <action name="SAVE" permit="false" /> - <action name="SEASON" permit="false" /> <action name="SET" permit="false" /> <action name="SHUTDOWN" permit="false" /> --- 92,95 ---- |
From: Sebastian H. <dar...@us...> - 2004-10-04 21:50:26
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12185 Modified Files: player.cpp Log Message: isGmOrCounselor now using the rank value. Index: player.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v retrieving revision 1.134 retrieving revision 1.135 diff -C2 -d -r1.134 -r1.135 *** player.cpp 1 Oct 2004 16:32:53 -0000 1.134 --- player.cpp 4 Oct 2004 21:50:16 -0000 1.135 *************** *** 566,580 **** bool cPlayer::isGM() const { ! return account() && ( account()->acl() == "admin" || account()->acl() == "gm" ) && account()->isStaff(); } bool cPlayer::isCounselor() const { ! return account() && ( account()->acl() == "counselor" ) && account()->isStaff(); } bool cPlayer::isGMorCounselor() const { ! return account() && ( account()->acl() == "admin" || account()->acl() == "gm" || account()->acl() == "counselor" ) && account()->isStaff(); } --- 566,580 ---- bool cPlayer::isGM() const { ! return account() && ( account()->rank() >= 50 ) && account()->isStaff(); } bool cPlayer::isCounselor() const { ! return account() && ( account()->rank() >= 25 && account()->rank() < 50 ) && account()->isStaff(); } bool cPlayer::isGMorCounselor() const { ! return account() && ( account()->rank() >= 25 ) && account()->isStaff(); } |
From: Sebastian H. <dar...@us...> - 2004-10-04 21:42:30
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10634 Modified Files: skillgain.py Log Message: Fix Index: skillgain.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/skillgain.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** skillgain.py 4 Oct 2004 18:24:32 -0000 1.12 --- skillgain.py 4 Oct 2004 21:42:17 -0000 1.13 *************** *** 136,140 **** if DEBUG_SKILLS == 1: ! char.log(LOG_TRACE, 'Character [%x] lost %.01f%% of %s [%.01f%%].\n' % (char.serial, points, SKILLS[i][SKILL_NAME], char.skill[i] / 10.0)) if char.socket: --- 136,140 ---- if DEBUG_SKILLS == 1: ! char.log(LOG_TRACE, 'Character [%x] lost %.01f%% %s [%.01f%%].\n' % (char.serial, points, SKILLS[i][SKILL_NAME], char.skill[i] / 10.0)) if char.socket: *************** *** 149,153 **** totalskill += points if DEBUG_SKILLS == 1: ! char.log(LOG_TRACE, 'Character [%x] gained %.01f%% of %s [%.01f%%].\n' % (char.serial, points, info[SKILL_NAME], char.skill[skill] / 10.0)) if char.socket: --- 149,158 ---- totalskill += points if DEBUG_SKILLS == 1: ! char.log(LOG_TRACE, u'Character [%(serial)x] gained %(points).01f%% %(name)s [%(value).01f%%].\n' % { \ ! 'serial': char.serial, ! 'points': points, ! 'name': info[SKILL_NAME], ! 'value': (char.skill[skill] / 10.0) ! }) if char.socket: |
From: Sebastian H. <dar...@us...> - 2004-10-04 21:37:32
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9440 Modified Files: who.py Log Message: Who fix Index: who.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/who.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** who.py 4 Oct 2004 21:20:39 -0000 1.14 --- who.py 4 Oct 2004 21:37:12 -0000 1.15 *************** *** 35,40 **** --- 35,42 ---- char = worldsocket.player if char.invisible and char.rank > player.rank: + worldsocket = wolfpack.sockets.next() continue if not char.account: + wolfpack.sockets.next() continue wholist.append(char) *************** *** 46,49 **** --- 48,55 ---- newwholist = wholist[page * 10:] + while len(newwholist) == 0 and page > 0: + page -= 1 + newwholist = wholist[page * 10:] + wholist = newwholist |
From: Sebastian H. <dar...@us...> - 2004-10-04 21:20:51
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5864/commands Modified Files: who.py Log Message: fixes Index: who.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/who.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** who.py 4 Oct 2004 20:36:22 -0000 1.13 --- who.py 4 Oct 2004 21:20:39 -0000 1.14 *************** *** 46,55 **** newwholist = wholist[page * 10:] - # Reduce the page id while page > 0 and len(newwholist) == 0 - while len(newwholist) == 0 and page > 0: - page -= 1 - newwholist = wholist[page * 10:] - wholist = newwholist gump = cGump( 0, 0, 0, 50, 50 ) --- 46,53 ---- newwholist = wholist[page * 10:] wholist = newwholist + + # Player list increases by 22 pixels + pages = (count + 9) / 10 # 10 per page gump = cGump( 0, 0, 0, 50, 50 ) *************** *** 62,69 **** gump.addText( 145, 320, tr("Players: %u") % count, 0x834 ) - # Player list increases by 22 pixels - pages = (count + 9) / 10 # 10 per page - - player.socket.sysmessage(tr('Total sockets: %u') % count) gump.addText( 280, 320, tr( "Page %i of %i" % ( page + 1, pages ) ), 0x834 ) --- 60,63 ---- |
From: Sebastian H. <dar...@us...> - 2004-10-04 20:36:43
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27671/commands Modified Files: who.py Log Message: fixes Index: who.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/who.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** who.py 4 Oct 2004 20:05:49 -0000 1.12 --- who.py 4 Oct 2004 20:36:22 -0000 1.13 *************** *** 26,29 **** --- 26,31 ---- def showWhoGump(player, page): + current_page = page + # Collect the current list of sockets first wholist = [] *************** *** 73,77 **** offset = 22 ! for char in wholist[:10]: gump.addButton( 20, 40 + offset, 0xFA5, 0xFA7, 2 + char.serial ) gump.addText( 54, 40 + offset, tr("%s [%s]") % ( char.name, char.account.name ), 0x834 ) --- 75,80 ---- offset = 22 ! wholist = wholist[:10] ! for char in wholist: gump.addButton( 20, 40 + offset, 0xFA5, 0xFA7, 2 + char.serial ) gump.addText( 54, 40 + offset, tr("%s [%s]") % ( char.name, char.account.name ), 0x834 ) *************** *** 79,83 **** offset += 24 ! gump.setArgs( [ page ] ) gump.setCallback( "commands.who.callbackWho" ) gump.send( player.socket ) --- 82,86 ---- offset += 24 ! gump.setArgs( [ current_page ] ) gump.setCallback( "commands.who.callbackWho" ) gump.send( player.socket ) |
From: Sebastian H. <dar...@us...> - 2004-10-04 20:16:36
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21804 Modified Files: commands.cpp Log Message: Command fix Index: commands.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v retrieving revision 1.265 retrieving revision 1.266 diff -C2 -d -r1.265 -r1.266 *** commands.cpp 2 Oct 2004 22:15:49 -0000 1.265 --- commands.cpp 4 Oct 2004 20:16:26 -0000 1.266 *************** *** 78,83 **** // Dispatch the command ! if ( dispatch( socket, pCommand, pArgs ) ) ! socket->log( tr( "Used command '%1'.\n" ).arg( command ) ); } --- 78,87 ---- // Dispatch the command ! socket->log( tr( "Used command '%1'.\n" ).arg( command ) ); ! ! if ( !dispatch( socket, pCommand, pArgs ) ) { ! socket->log(tr("Unknown command used: %1.\n").arg(command)); ! } ! } |
From: Sebastian H. <dar...@us...> - 2004-10-04 20:06:00
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18863/commands Modified Files: who.py Log Message: fixes Index: who.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/who.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** who.py 4 Oct 2004 19:32:18 -0000 1.11 --- who.py 4 Oct 2004 20:05:49 -0000 1.12 *************** *** 73,80 **** offset = 22 ! for item in wholist[:10]: ! gump.addButton( 20, 40 + offset, 0xFA5, 0xFA7, 2 + player.serial ) ! gump.addText( 54, 40 + offset, tr("%s [%s]") % ( player.name, player.account.name ), 0x834 ) ! gump.addText( 257, 40 + offset, unicode(player.socket.address), 0x834 ) offset += 24 --- 73,80 ---- offset = 22 ! for char in wholist[:10]: ! gump.addButton( 20, 40 + offset, 0xFA5, 0xFA7, 2 + char.serial ) ! gump.addText( 54, 40 + offset, tr("%s [%s]") % ( char.name, char.account.name ), 0x834 ) ! gump.addText( 257, 40 + offset, unicode(char.socket.address), 0x834 ) offset += 24 |
From: Sebastian H. <dar...@us...> - 2004-10-04 19:32:37
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11640/commands Modified Files: who.py Log Message: fixed who gump Index: who.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/who.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** who.py 4 Oct 2004 18:34:53 -0000 1.10 --- who.py 4 Oct 2004 19:32:18 -0000 1.11 *************** *** 14,17 **** --- 14,18 ---- import wolfpack.accounts import commands.info + from wolfpack import tr import math from wolfpack.gumps import cGump *************** *** 20,96 **** wolfpack.registercommand( "who", cmdWho ) return ! def cmdWho( socket, command, argstring ): wholist = [] ! worldsocketcount = wolfpack.sockets.count() worldsocket = wolfpack.sockets.first() while worldsocket: ! wholist += [ worldsocket.player.serial ] worldsocket = wolfpack.sockets.next() ! if len(wholist) == 0: ! return False ! gump = cGump( 0, 0, 0, 50, 50 ) gump.addBackground( 0xE10, 380, 360 ) gump.addCheckerTrans( 15, 15, 350, 330 ); gump.addGump( 130, 18, 0xFA8 ) ! gump.addText( 165, 20, unicode("Who Menu"), 0x530 ) ! # Close Button ! gump.addButton( 30, 320, 0xFB1, 0xFB3, 0 ) ! gump.addText( 70, 320, unicode("Close"), 0x834 ) ! # Start The First Page ! # Notes, 10 per page ! # Pages to create, (( socketcount / 10) + 1 ) # Player list increases by 22 pixels ! maxpages = (worldsocketcount + 9) / 10 ! socket.sysmessage('Sockets: %u' % worldsocketcount) ! page = 0 ! serialcount = 0 ! while page <= maxpages: ! page += 1 ! gump.startPage( page ) ! gump.addText( 280, 320, unicode( "Page %i of %i" % ( page, maxpages ) ), 0x834 ) ! if page < maxpages: ! gump.addPageButton( 260, 320, 0x0FA, 0x0FA, page + 1 ) ! if page > 1: ! gump.addPageButton( 240, 320, 0x0FC, 0x0FC, page - 1 ) ! upby = 22 ! skip = (page - 1) * 10 ! skipped = 0 ! for serial in wholist: ! # Skip the first X players ! if skipped < skip: ! skipped += 1 ! continue ! ! if not serial: ! break ! player = wolfpack.findchar( serial ) ! if not player or not player.account or not player.socket: ! continue ! ! # Skip invisible gms with a higher rank ! if player.invisible and player.rank > socket.player.rank: ! continue ! ! # serialcount + 10 for callback, we will -10 there and look at wholist. ! gump.addButton( 20, 40 + upby, 0xFA5, 0xFA7, ( serialcount + 10 ) ) ! gump.addText( 50, 40 + upby, unicode( "%s [%s]" % ( player.name, player.account.name ) ), 0x834 ) ! gump.addText( 240, 40 + upby, unicode( "%s" % player.socket.address ), 0x834 ) ! upby += 22 ! serialcount += 1 ! if serialcount >= 10: ! break ! ! gump.setArgs( [ wholist ] ) gump.setCallback( "commands.who.callbackWho" ) ! gump.send( socket ) ! return def details(char, player): if not player.socket: --- 21,101 ---- wolfpack.registercommand( "who", cmdWho ) return + + def cmdWho(socket, command, arguments): + showWhoGump(socket.player, 0) ! def showWhoGump(player, page): ! # Collect the current list of sockets first wholist = [] ! worldsocket = wolfpack.sockets.first() while worldsocket: ! char = worldsocket.player ! if char.invisible and char.rank > player.rank: ! continue ! if not char.account: ! continue ! wholist.append(char) worldsocket = wolfpack.sockets.next() + + count = len(wholist) + + # Skip page * 10 users + newwholist = wholist[page * 10:] ! # Reduce the page id while page > 0 and len(newwholist) == 0 ! while len(newwholist) == 0 and page > 0: ! page -= 1 ! newwholist = wholist[page * 10:] ! ! wholist = newwholist ! gump = cGump( 0, 0, 0, 50, 50 ) gump.addBackground( 0xE10, 380, 360 ) gump.addCheckerTrans( 15, 15, 350, 330 ); gump.addGump( 130, 18, 0xFA8 ) ! gump.addText( 165, 20, tr("Who Menu"), 0x530 ) ! gump.addButton( 30, 320, 0xFB1, 0xFB3, 0 ) # Close Button ! gump.addText( 70, 320, tr("Close"), 0x834 ) ! gump.addText( 145, 320, tr("Players: %u") % count, 0x834 ) ! # Player list increases by 22 pixels ! pages = (count + 9) / 10 # 10 per page ! player.socket.sysmessage(tr('Total sockets: %u') % count) ! gump.addText( 280, 320, tr( "Page %i of %i" % ( page + 1, pages ) ), 0x834 ) ! if page + 1 < pages: ! gump.addButton( 260, 320, 0x0FA, 0x0FA, 1 ) # Next Page ! if page > 0: ! gump.addButton( 240, 320, 0x0FC, 0x0FC, 2 ) # Previous Page ! offset = 22 ! for item in wholist[:10]: ! gump.addButton( 20, 40 + offset, 0xFA5, 0xFA7, 2 + player.serial ) ! gump.addText( 54, 40 + offset, tr("%s [%s]") % ( player.name, player.account.name ), 0x834 ) ! gump.addText( 257, 40 + offset, unicode(player.socket.address), 0x834 ) ! offset += 24 ! ! gump.setArgs( [ page ] ) gump.setCallback( "commands.who.callbackWho" ) ! gump.send( player.socket ) ! ! def callbackWho( char, args, choice ): ! page = args[0] ! ! # Next page ! if choice.button == 1: ! showWhoGump(char, page + 1) + elif choice.button == 2 and page > 0: + showWhoGump(char, page - 1) + + elif choice.button > 2: + serial = choice.button - 2 + player = wolfpack.findchar(serial) + details(char, player) + def details(char, player): if not player.socket: *************** *** 151,166 **** gump.send( char.socket ) - def callbackWho( char, args, choice ): - wholist = args[0] - if choice.button == 0: - return False - elif wholist[ choice.button - 10 ]: - player = wolfpack.findchar( wholist[ choice.button - 10 ] ) - details(char, player) - return True - else: - return False - - def callbackSocket( char, args, choice ): socket = char.socket --- 156,159 ---- |
From: Sebastian H. <dar...@us...> - 2004-10-04 18:36:34
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30289 Modified Files: who.py Log Message: Fixes Index: who.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/who.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** who.py 4 Oct 2004 18:24:32 -0000 1.9 --- who.py 4 Oct 2004 18:34:53 -0000 1.10 *************** *** 46,49 **** --- 46,51 ---- maxpages = (worldsocketcount + 9) / 10 + socket.sysmessage('Sockets: %u' % worldsocketcount) + page = 0 serialcount = 0 |
From: Sebastian H. <dar...@us...> - 2004-10-04 18:25:58
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27803/system Modified Files: debugging.py skillgain.py Log Message: Skillgain and Who fixes Index: debugging.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/debugging.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** debugging.py 12 Jul 2004 21:06:30 -0000 1.2 --- debugging.py 4 Oct 2004 18:24:32 -0000 1.3 *************** *** 6,10 **** DEBUG_COMBAT_INFO = False DEBUG_SPAWNS = False ! DEBUG_STATS = False ! DEBUG_SKILLS = False --- 6,11 ---- DEBUG_COMBAT_INFO = False DEBUG_SPAWNS = False ! DEBUG_STATS = True ! DEBUG_SKILLS = True ! Index: skillgain.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/skillgain.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** skillgain.py 1 Oct 2004 10:32:53 -0000 1.11 --- skillgain.py 4 Oct 2004 18:24:32 -0000 1.12 *************** *** 136,140 **** if DEBUG_SKILLS == 1: ! char.log(LOG_TRACE, 'Character [%x] lost %0.01f%% of %s [%02.01f%%].\n' % (char.serial, points, SKILLS[i][SKILL_NAME], char.skill[i] / 10.0)) if char.socket: --- 136,140 ---- if DEBUG_SKILLS == 1: ! char.log(LOG_TRACE, 'Character [%x] lost %.01f%% of %s [%.01f%%].\n' % (char.serial, points, SKILLS[i][SKILL_NAME], char.skill[i] / 10.0)) if char.socket: *************** *** 149,153 **** totalskill += points if DEBUG_SKILLS == 1: ! char.log(LOG_TRACE, 'Character [%x] gained %0.01f%% of %s [%02.01f%%].\n' % (char.serial, points, info[SKILL_NAME], char.skill[skill] / 10.0)) if char.socket: --- 149,153 ---- totalskill += points if DEBUG_SKILLS == 1: ! char.log(LOG_TRACE, 'Character [%x] gained %.01f%% of %s [%.01f%%].\n' % (char.serial, points, info[SKILL_NAME], char.skill[skill] / 10.0)) if char.socket: |