wpdev-commits Mailing List for Wolfpack Emu (Page 61)
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-08-25 17:03:17
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12383/wolfpack Modified Files: utilities.py Log Message: Changed all references to "events" to "scripts" Index: utilities.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/utilities.py,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** utilities.py 24 Aug 2004 18:10:31 -0000 1.64 --- utilities.py 25 Aug 2004 17:03:06 -0000 1.65 *************** *** 601,605 **** tocontainer( key, container ) container.settag( 'lock', rkeyid ) ! container.addevent( 'lock' ) return --- 601,605 ---- tocontainer( key, container ) container.settag( 'lock', rkeyid ) ! container.addscript( 'lock' ) return |
From: Sebastian H. <dar...@us...> - 2004-08-25 17:03:16
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12383/skills Modified Files: animaltaming.py poisoning.py tasteid.py Log Message: Changed all references to "events" to "scripts" Index: animaltaming.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/animaltaming.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** animaltaming.py 16 Jul 2004 07:09:27 -0000 1.16 --- animaltaming.py 25 Aug 2004 17:03:05 -0000 1.17 *************** *** 180,184 **** totame.settag( 'num_tamed', num_tamed ) # remove "Tame" context menu ! totame.addevent('speech.pets') # success msg : 502799 --- 180,184 ---- totame.settag( 'num_tamed', num_tamed ) # remove "Tame" context menu ! totame.addscript('speech.pets') # success msg : 502799 Index: poisoning.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/poisoning.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** poisoning.py 24 Aug 2004 18:10:29 -0000 1.4 --- poisoning.py 25 Aug 2004 17:03:06 -0000 1.5 *************** *** 62,66 **** char.socket.clilocmessage( 502145 ) return ! if not ( target.item.hasevent( 'food' ) or target.item.hasevent( 'blades' ) ): char.socket.clilocmessage( 502145 ) return --- 62,66 ---- char.socket.clilocmessage( 502145 ) return ! if not ( target.item.hasscript( 'food' ) or target.item.hasscript( 'blades' ) ): char.socket.clilocmessage( 502145 ) return *************** *** 122,126 **** # weapon : poison chance when hit % = char.skill[ POISONING ] / 4 # number of uses before the poison wears off ! if item.hasevent( 'blades' ): item.settag( 'poisoning_uses', 20 - strength * 2 ) return 1 --- 122,126 ---- # weapon : poison chance when hit % = char.skill[ POISONING ] / 4 # number of uses before the poison wears off ! if item.hasscript( 'blades' ): item.settag( 'poisoning_uses', 20 - strength * 2 ) return 1 Index: tasteid.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/tasteid.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** tasteid.py 24 Aug 2004 18:10:29 -0000 1.10 --- tasteid.py 25 Aug 2004 17:03:06 -0000 1.11 *************** *** 38,42 **** return ! if not target.item.hasevent( 'food' ): socket.clilocmessage(502820) else: --- 38,42 ---- return ! if not target.item.hasscript( 'food' ): socket.clilocmessage(502820) else: |
From: Sebastian H. <dar...@us...> - 2004-08-25 17:03:14
|
Update of /cvsroot/wpdev/xmlscripts/scripts/deeds In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12383/deeds Modified Files: multideed.py Log Message: Changed all references to "events" to "scripts" Index: multideed.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/deeds/multideed.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** multideed.py 24 Aug 2004 18:10:26 -0000 1.2 --- multideed.py 25 Aug 2004 17:03:04 -0000 1.3 *************** *** 199,203 **** sign.moveto( newpos ) sign.settag( 'house', multi.serial ) ! sign.addevent( 'signpost' ) #woodenpost.update() signpost.update() --- 199,203 ---- sign.moveto( newpos ) sign.settag( 'house', multi.serial ) ! sign.addscript( 'signpost' ) #woodenpost.update() signpost.update() |
From: Sebastian H. <dar...@us...> - 2004-08-25 17:01:43
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11978/python Modified Files: char.cpp item.cpp Log Message: Changed all references to "events" to "scripts" Index: item.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v retrieving revision 1.124 retrieving revision 1.125 diff -C2 -d -r1.124 -r1.125 *** item.cpp 22 Aug 2004 15:12:48 -0000 1.124 --- item.cpp 25 Aug 2004 17:01:33 -0000 1.125 *************** *** 891,950 **** /* ! \method item.removeevent ! \description Remove a python script from the event chain for this object. ! \param event The id of the python script you want to remove from the event chain. */ ! static PyObject* wpItem_removeevent( wpItem* self, PyObject* args ) { ! char* event; ! if ( !PyArg_ParseTuple( args, "s:item.removeevent(name)", &event ) ) { return 0; } ! self->pItem->removeEvent( event ); Py_RETURN_NONE; } /* ! \method item.addevent ! \description Add a pythonscript to the event chain of this object. ! Does nothing if the object already has that event. ! \param event The id of the python script you want to add to the event chain. */ ! static PyObject* wpItem_addevent( wpItem* self, PyObject* args ) { ! char* event; ! if ( !PyArg_ParseTuple( args, "s:item.addevent(name)", &event ) ) { return 0; } ! cPythonScript* script = ScriptManager::instance()->find( event ); ! if ( !script ) { ! PyErr_Format( PyExc_RuntimeError, "No such script: %s", event ); return 0; } ! self->pItem->addEvent( script ); Py_RETURN_NONE; } /* ! \method item.hasevent ! \description Check if this object has a python script in its event chain. ! \param event The id of the python script you are looking for. \return True of the script is in the chain. False otherwise. */ ! static PyObject* wpItem_hasevent( wpItem* self, PyObject* args ) { ! char* event; ! if ( !PyArg_ParseTuple( args, "s:item.hasevent(name)", &event ) ) { return 0; } ! if ( self->pItem->hasEvent( event ) ) { Py_INCREF( Py_True ); --- 891,950 ---- /* ! \method item.removescript ! \description Remove a python script from the script chain for this object. ! \param script The id of the python script you want to remove from the script chain. */ ! static PyObject* wpItem_removescript( wpItem* self, PyObject* args ) { ! char* script; ! if ( !PyArg_ParseTuple( args, "s:item.removescript(name)", &script ) ) { return 0; } ! self->pItem->removeScript( script ); Py_RETURN_NONE; } /* ! \method item.addscript ! \description Add a pythonscript to the script chain of this object. ! Does nothing if the object already has that script. ! \param script The id of the python script you want to add to the script chain. */ ! static PyObject* wpItem_addscript( wpItem* self, PyObject* args ) { ! char* script; ! if ( !PyArg_ParseTuple( args, "s:item.addscript(name)", &script ) ) { return 0; } ! cPythonScript* pscript = ScriptManager::instance()->find( script ); ! if ( !pscript ) { ! PyErr_Format( PyExc_RuntimeError, "No such script: %s", script ); return 0; } ! self->pItem->addScript( pscript ); Py_RETURN_NONE; } /* ! \method item.hasscript ! \description Check if this object has a python script in its script chain. ! \param script The id of the python script you are looking for. \return True of the script is in the chain. False otherwise. */ ! static PyObject* wpItem_hasscript( wpItem* self, PyObject* args ) { ! char* script; ! if ( !PyArg_ParseTuple( args, "s:item.hasscript(name)", &script ) ) { return 0; } ! if ( self->pItem->hasScript( script ) ) { Py_INCREF( Py_True ); *************** *** 1039,1045 **** } ! if ( cPythonScript::canChainHandleEvent( ( ePythonEvent ) event, self->pItem->getEvents() ) ) { ! bool result = cPythonScript::callChainedEventHandler( ( ePythonEvent ) event, self->pItem->getEvents(), eventargs ); if ( result ) --- 1039,1045 ---- } ! if ( cPythonScript::canChainHandleEvent( ( ePythonEvent ) event, self->pItem->getScripts() ) ) { ! bool result = cPythonScript::callChainedEventHandler( ( ePythonEvent ) event, self->pItem->getScripts(), eventargs ); if ( result ) *************** *** 1115,1121 **** // Event handling { "callevent", ( getattrofunc ) wpItem_callevent, METH_VARARGS, 0 }, ! { "addevent", ( getattrofunc ) wpItem_addevent, METH_VARARGS, 0}, ! { "removeevent", ( getattrofunc ) wpItem_removeevent, METH_VARARGS, 0}, ! { "hasevent", ( getattrofunc ) wpItem_hasevent, METH_VARARGS, 0}, // Effects --- 1115,1121 ---- // Event handling { "callevent", ( getattrofunc ) wpItem_callevent, METH_VARARGS, 0 }, ! { "addscript", ( getattrofunc ) wpItem_addscript, METH_VARARGS, 0}, ! { "removescript", ( getattrofunc ) wpItem_removescript, METH_VARARGS, 0}, ! { "hasscript", ( getattrofunc ) wpItem_hasscript, METH_VARARGS, 0}, // Effects *************** *** 1152,1156 **** } /* ! \property item.tags A list of all tag names the object currently has. */ else if ( !strcmp( "tags", name ) ) --- 1152,1156 ---- } /* ! \rproperty item.tags A list of all tag names the object currently has. */ else if ( !strcmp( "tags", name ) ) *************** *** 1195,1203 **** } /* ! \rproperty item.events Returns a list of all event names the object has. */ ! else if ( !strcmp( "events", name ) ) { ! QStringList events = QStringList::split( ",", self->pItem->eventList() ); PyObject* list = PyList_New( events.count() ); for ( uint i = 0; i < events.count(); ++i ) --- 1195,1203 ---- } /* ! \rproperty item.scripts Returns a list of all script names the object has. */ ! else if ( !strcmp( "scripts", name ) ) { ! QStringList events = QStringList::split( ",", self->pItem->scriptList() ); PyObject* list = PyList_New( events.count() ); for ( uint i = 0; i < events.count(); ++i ) *************** *** 1219,1247 **** static int wpItem_setAttr( wpItem* self, char* name, PyObject* value ) { - // Special Python things. - if ( !strcmp( "events", name ) ) - { - if ( !PyList_Check( value ) ) - { - PyErr_BadArgument(); - return -1; - } - - self->pItem->clearEvents(); - int i; - for ( i = 0; i < PyList_Size( value ); ++i ) - { - if ( !PyString_Check( PyList_GetItem( value, i ) ) ) - continue; - - cPythonScript* script = ScriptManager::instance()->find( PyString_AsString( PyList_GetItem( value, i ) ) ); - if ( script ) - self->pItem->addEvent( script ); - } - } /* \rproperty item.container Returns the serial of the container this item is in. Returns 0 if no container. */ ! else if ( !strcmp( "container", name ) ) { if ( checkWpItem( value ) ) --- 1219,1226 ---- static int wpItem_setAttr( wpItem* self, char* name, PyObject* value ) { /* \rproperty item.container Returns the serial of the container this item is in. Returns 0 if no container. */ ! if ( !strcmp( "container", name ) ) { if ( checkWpItem( value ) ) Index: char.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v retrieving revision 1.182 retrieving revision 1.183 diff -C2 -d -r1.182 -r1.183 *** char.cpp 22 Aug 2004 15:12:34 -0000 1.182 --- char.cpp 25 Aug 2004 17:01:33 -0000 1.183 *************** *** 1421,1425 **** dispelargs = PyTuple_New( 0 ); ! if ( cPythonScript::canChainHandleEvent( EVENT_DISPEL, self->pChar->getEvents() ) ) { PyObject* source; --- 1421,1425 ---- dispelargs = PyTuple_New( 0 ); ! if ( cPythonScript::canChainHandleEvent( EVENT_DISPEL, self->pChar->getScripts() ) ) { PyObject* source; *************** *** 1440,1444 **** PyObject* args = Py_BuildValue( "(NNBBsN", self->pChar->getPyObject(), source, 0, force ? 1 : 0, ptype, dispelargs ); ! bool result = cPythonScript::callChainedEventHandler( EVENT_DISPEL, self->pChar->getEvents(), args ); Py_DECREF( args ); --- 1440,1444 ---- PyObject* args = Py_BuildValue( "(NNBBsN", self->pChar->getPyObject(), source, 0, force ? 1 : 0, ptype, dispelargs ); ! bool result = cPythonScript::callChainedEventHandler( EVENT_DISPEL, self->pChar->getScripts(), args ); Py_DECREF( args ); *************** *** 2166,2225 **** /* ! \method char.removeevent ! \description Remove a python script from the event chain for this object. ! \param event The id of the python script you want to remove from the event chain. */ ! static PyObject* wpChar_removeevent( wpChar* self, PyObject* args ) { ! char* event; ! if ( !PyArg_ParseTuple( args, "s:char.removeevent(name)", &event ) ) { return 0; } ! self->pChar->removeEvent( event ); Py_RETURN_NONE; } /* ! \method char.addevent ! \description Add a pythonscript to the event chain of this object. ! Does nothing if the object already has that event. ! \param event The id of the python script you want to add to the event chain. */ ! static PyObject* wpChar_addevent( wpChar* self, PyObject* args ) { ! char* event; ! if ( !PyArg_ParseTuple( args, "s:char.addevent(name)", &event ) ) { return 0; } ! cPythonScript* script = ScriptManager::instance()->find( event ); ! if ( !script ) { ! PyErr_Format( PyExc_RuntimeError, "No such script: %s", event ); return 0; } ! self->pChar->addEvent( script ); Py_RETURN_NONE; } /* ! \method char.hasevent ! \description Check if this object has a python script in its event chain. ! \param event The id of the python script you are looking for. \return True of the script is in the chain. False otherwise. */ ! static PyObject* wpChar_hasevent( wpChar* self, PyObject* args ) { ! char* event; ! if ( !PyArg_ParseTuple( args, "s:char.hasevent(name)", &event ) ) { return 0; } ! if ( self->pChar->hasEvent( event ) ) { Py_INCREF( Py_True ); --- 2166,2225 ---- /* ! \method char.removescript ! \description Remove a python script from the script chain for this object. ! \param script The id of the python script you want to remove from the script chain. */ ! static PyObject* wpChar_removescript( wpChar* self, PyObject* args ) { ! char* script; ! if ( !PyArg_ParseTuple( args, "s:char.removescript(name)", &script ) ) { return 0; } ! self->pChar->removeScript( script ); Py_RETURN_NONE; } /* ! \method char.addscript ! \description Add a pythonscript to the script chain of this object. ! Does nothing if the object already has that script. ! \param script The id of the python script you want to add to the script chain. */ ! static PyObject* wpChar_addscript( wpChar* self, PyObject* args ) { ! char* script; ! if ( !PyArg_ParseTuple( args, "s:char.addscript(name)", &script ) ) { return 0; } ! cPythonScript* pscript = ScriptManager::instance()->find( script ); ! if ( !pscript ) { ! PyErr_Format( PyExc_RuntimeError, "No such script: %s", script ); return 0; } ! self->pChar->addScript( pscript ); Py_RETURN_NONE; } /* ! \method char.hasscript ! \description Check if this object has a python script in its script chain. ! \param script The id of the python script you are looking for. \return True of the script is in the chain. False otherwise. */ ! static PyObject* wpChar_hasscript( wpChar* self, PyObject* args ) { ! char* script; ! if ( !PyArg_ParseTuple( args, "s:char.hasscript(name)", &script ) ) { return 0; } ! if ( self->pChar->hasScript( script ) ) { Py_INCREF( Py_True ); *************** *** 2268,2274 **** } ! if ( cPythonScript::canChainHandleEvent( ( ePythonEvent ) event, self->pChar->getEvents() ) ) { ! bool result = cPythonScript::callChainedEventHandler( ( ePythonEvent ) event, self->pChar->getEvents(), eventargs ); if ( result ) --- 2268,2274 ---- } ! if ( cPythonScript::canChainHandleEvent( ( ePythonEvent ) event, self->pChar->getScripts() ) ) { ! bool result = cPythonScript::callChainedEventHandler( ( ePythonEvent ) event, self->pChar->getScripts(), eventargs ); if ( result ) *************** *** 2329,2335 **** // Event handling functions ! { "addevent", ( getattrofunc ) wpChar_addevent, METH_VARARGS, 0}, ! { "removeevent", ( getattrofunc ) wpChar_removeevent, METH_VARARGS, 0}, ! { "hasevent", ( getattrofunc ) wpChar_hasevent, METH_VARARGS, 0}, { "callevent", ( getattrofunc ) wpChar_callevent, METH_VARARGS, 0}, --- 2329,2335 ---- // Event handling functions ! { "addscript", ( getattrofunc ) wpChar_addscript, METH_VARARGS, 0}, ! { "removescript", ( getattrofunc ) wpChar_removescript, METH_VARARGS, 0}, ! { "hasscript", ( getattrofunc ) wpChar_hasscript, METH_VARARGS, 0}, { "callevent", ( getattrofunc ) wpChar_callevent, METH_VARARGS, 0}, *************** *** 2396,2402 **** /* ! \rproperty char.tags This property is a list of names for all tags attached to this character. ! This property is exclusive to python scripts and overrides normal properties with the same name. ! */ } else if ( !strcmp( "tags", name ) ) --- 2396,2402 ---- /* ! \rproperty char.tags This property is a list of names for all tags attached to this character. ! This property is exclusive to python scripts and overrides normal properties with the same name. ! */ } else if ( !strcmp( "tags", name ) ) *************** *** 2585,2597 **** } /* ! \property char.events The names of the scripts attached to this character. This property is exclusive to python scripts and overrides normal properties with the same name. */ ! else if ( !strcmp( "events", name ) ) { ! QStringList events = QStringList::split( ",", self->pChar->eventList() ); ! PyObject* list = PyList_New( events.count() ); ! for ( uint i = 0; i < events.count(); ++i ) ! PyList_SetItem( list, i, PyString_FromString( events[i].latin1() ) ); return list; /* --- 2585,2597 ---- } /* ! \rproperty char.scripts The names of the scripts attached to this character. This property is exclusive to python scripts and overrides normal properties with the same name. */ ! else if ( !strcmp( "scripts", name ) ) { ! QStringList scripts = QStringList::split( ",", self->pChar->scriptList() ); ! PyObject* list = PyList_New( scripts.count() ); ! for ( uint i = 0; i < scripts.count(); ++i ) ! PyList_SetItem( list, i, PyString_FromString( scripts[i].latin1() ) ); return list; /* *************** *** 2627,2679 **** int wpChar_setAttr( wpChar* self, char* name, PyObject* value ) { ! // Special Python things. ! if ( !strcmp( "events", name ) ) ! { ! if ( !PyList_Check( value ) ) ! { ! PyErr_BadArgument(); ! return -1; ! } ! ! self->pChar->clearEvents(); ! int i; ! for ( i = 0; i < PyList_Size( value ); ++i ) ! { ! if ( !PyString_Check( PyList_GetItem( value, i ) ) ) ! continue; ! ! cPythonScript* script = ScriptManager::instance()->find( PyString_AsString( PyList_GetItem( value, i ) ) ); ! if ( script ) ! self->pChar->addEvent( script ); ! } ! } ! else ! { ! cVariant val; ! if ( PyString_Check( value ) || PyUnicode_Check( value ) ) ! val = cVariant( Python2QString( value ) ); ! else if ( PyInt_Check( value ) ) ! val = cVariant( PyInt_AsLong( value ) ); ! else if ( checkWpItem( value ) ) ! val = cVariant( getWpItem( value ) ); ! else if ( checkWpChar( value ) ) ! val = cVariant( getWpChar( value ) ); ! else if ( checkWpCoord( value ) ) ! val = cVariant( getWpCoord( value ) ); ! else if ( PyFloat_Check( value ) ) ! val = cVariant( PyFloat_AsDouble( value ) ); ! else if ( value == Py_True ) ! val = cVariant( 1 ); // True ! else if ( value == Py_False ) ! val = cVariant( 0 ); // false ! stError * error = self->pChar->setProperty( name, val ); ! if ( error ) ! { ! PyErr_Format( PyExc_TypeError, "Error while setting attribute '%s': %s", name, error->text.latin1() ); ! delete error; ! return 0; ! } } --- 2627,2653 ---- int wpChar_setAttr( wpChar* self, char* name, PyObject* value ) { ! cVariant val; ! if ( PyString_Check( value ) || PyUnicode_Check( value ) ) ! val = cVariant( Python2QString( value ) ); ! else if ( PyInt_Check( value ) ) ! val = cVariant( PyInt_AsLong( value ) ); ! else if ( checkWpItem( value ) ) ! val = cVariant( getWpItem( value ) ); ! else if ( checkWpChar( value ) ) ! val = cVariant( getWpChar( value ) ); ! else if ( checkWpCoord( value ) ) ! val = cVariant( getWpCoord( value ) ); ! else if ( PyFloat_Check( value ) ) ! val = cVariant( PyFloat_AsDouble( value ) ); ! else if ( value == Py_True ) ! val = cVariant( 1 ); // True ! else if ( value == Py_False ) ! val = cVariant( 0 ); // false ! stError * error = self->pChar->setProperty( name, val ); ! if (error) { ! PyErr_Format( PyExc_TypeError, "Error while setting attribute '%s': %s", name, error->text.latin1() ); ! delete error; } |
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11978 Modified Files: items.cpp speech.cpp territories.cpp timers.cpp trade.cpp uobject.cpp uobject.h walking.cpp wolfpack.vcproj Log Message: Changed all references to "events" to "scripts" Index: trade.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/trade.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** trade.cpp 19 Aug 2004 01:55:56 -0000 1.10 --- trade.cpp 25 Aug 2004 17:01:23 -0000 1.11 *************** *** 317,321 **** if ( ( *it )->id() == pItem->id() && ( *it )->color() == pItem->color() && // (*it)->amount() >= pItem->amount() && ! ( *it )->eventList() == pItem->eventList() ) { found = true; --- 317,321 ---- if ( ( *it )->id() == pItem->id() && ( *it )->color() == pItem->color() && // (*it)->amount() >= pItem->amount() && ! ( *it )->scriptList() == pItem->scriptList() ) { found = true; Index: territories.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/territories.cpp,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** territories.cpp 10 Aug 2004 03:15:57 -0000 1.52 --- territories.cpp 25 Aug 2004 17:01:23 -0000 1.53 *************** *** 389,393 **** PyObject* args = Py_BuildValue( "(NNN)", PyGetCharObject( pc ), PyGetRegionObject( lastRegion ), PyGetRegionObject( currRegion ) ); ! if ( !cPythonScript::callChainedEventHandler( EVENT_CHANGEREGION, pc->getEvents(), args ) && socket ) { if ( lastRegion && !lastRegion->name().isEmpty() && !lastRegion->isNoEnterMessage() ) --- 389,393 ---- PyObject* args = Py_BuildValue( "(NNN)", PyGetCharObject( pc ), PyGetRegionObject( lastRegion ), PyGetRegionObject( currRegion ) ); ! if ( !cPythonScript::callChainedEventHandler( EVENT_CHANGEREGION, pc->getScripts(), args ) && socket ) { if ( lastRegion && !lastRegion->name().isEmpty() && !lastRegion->isNoEnterMessage() ) Index: uobject.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v retrieving revision 1.180 retrieving revision 1.181 diff -C2 -d -r1.180 -r1.181 *** uobject.cpp 25 Aug 2004 00:41:25 -0000 1.180 --- uobject.cpp 25 Aug 2004 17:01:23 -0000 1.181 *************** *** 157,165 **** pos_.z = atoi( result[offset++] ); pos_.map = atoi( result[offset++] ); ! QString eventList = ( result[offset] == 0 ) ? QString::null : QString( result[offset] ); offset++; bool havetags_ = atoi( result[offset++] ); ! setEventList( eventList ); if ( havetags_ ) --- 157,165 ---- pos_.z = atoi( result[offset++] ); pos_.map = atoi( result[offset++] ); ! QString scriptList = ( result[offset] == 0 ) ? QString::null : QString( result[offset] ); offset++; bool havetags_ = atoi( result[offset++] ); ! setScriptList( scriptList ); if ( havetags_ ) *************** *** 203,208 **** addField( "pos_z", pos_.z ); addField( "pos_map", pos_.map ); ! QString eventList = this->eventList(); ! addStrField( "events", eventList == QString::null ? QString( "" ) : eventList ); addCondition( "serial", serial_ ); addField( "havetags", havetags_ ); --- 203,208 ---- addField( "pos_z", pos_.z ); addField( "pos_map", pos_.map ); ! QString scriptList = this->scriptList(); ! addStrField( "events", scriptList == QString::null ? QString( "" ) : scriptList ); addCondition( "serial", serial_ ); addField( "havetags", havetags_ ); *************** *** 227,231 **** writer.writeByte( pos_.z ); writer.writeByte( pos_.map ); ! writer.writeUtf8( eventList() ); } --- 227,231 ---- writer.writeByte( pos_.z ); writer.writeByte( pos_.map ); ! writer.writeUtf8( scriptList() ); } *************** *** 239,243 **** pos_.z = reader.readByte(); pos_.map = reader.readByte(); ! setEventList( reader.readUtf8() ); } --- 239,243 ---- pos_.z = reader.readByte(); pos_.map = reader.readByte(); ! setScriptList( reader.readUtf8() ); } *************** *** 277,281 **** Clears the script-chain */ ! void cUObject::clearEvents() { if ( scriptChain ) --- 277,281 ---- Clears the script-chain */ ! void cUObject::clearScripts() { if ( scriptChain ) *************** *** 312,316 **** \sa addEvent */ ! bool cUObject::hasEvent( const QString& name ) const { if ( scriptChain ) --- 312,316 ---- \sa addEvent */ ! bool cUObject::hasScript( const QString& name ) const { if ( scriptChain ) *************** *** 331,335 **** Adds an event handler to this object */ ! void cUObject::addEvent( cPythonScript* event, bool append ) { if ( isScriptChainFrozen() ) --- 331,335 ---- Adds an event handler to this object */ ! void cUObject::addScript( cPythonScript* event, bool append ) { if ( isScriptChainFrozen() ) *************** *** 338,342 **** } ! if ( hasEvent( event->name() ) ) { return; --- 338,342 ---- } ! if ( hasScript( event->name() ) ) { return; *************** *** 385,389 **** Removes an event handler from the object */ ! void cUObject::removeEvent( const QString& name ) { if ( isScriptChainFrozen() ) --- 385,389 ---- Removes an event handler from the object */ ! void cUObject::removeScript( const QString& name ) { if ( isScriptChainFrozen() ) *************** *** 392,396 **** } ! if ( !hasEvent( name ) ) { return; --- 392,396 ---- } ! if ( !hasScript( name ) ) { return; *************** *** 405,409 **** if ( count == 1 ) { ! clearEvents(); } else --- 405,409 ---- if ( count == 1 ) { ! clearScripts(); } else *************** *** 517,524 **** } } ! // <events>a,b,c</events> ! else if ( TagName == "events" ) { ! setEventList( Value ); } else --- 517,524 ---- } } ! // <scripts>a,b,c</scripts> ! else if ( TagName == "scripts" ) { ! setScriptList( Value ); } else *************** *** 730,736 **** // \property object.eventlist This string property contains a comma separated list of the names of the scripts that are assigned to this object. ! else if ( name == "eventlist" ) { ! clearEvents(); QStringList list = QStringList::split( ",", value.toString() ); for ( QStringList::const_iterator it( list.begin() ); it != list.end(); ++it ) --- 730,736 ---- // \property object.eventlist This string property contains a comma separated list of the names of the scripts that are assigned to this object. ! else if ( name == "scriptlist" ) { ! clearScripts(); QStringList list = QStringList::split( ",", value.toString() ); for ( QStringList::const_iterator it( list.begin() ); it != list.end(); ++it ) *************** *** 738,742 **** cPythonScript* script = ScriptManager::instance()->find( ( *it ).latin1() ); if ( script ) ! addEvent( script ); else PROPERTY_ERROR( -3, QString( "Script not found: '%1'" ).arg( *it ) ) --- 738,742 ---- cPythonScript* script = ScriptManager::instance()->find( ( *it ).latin1() ); if ( script ) ! addScript( script ); else PROPERTY_ERROR( -3, QString( "Script not found: '%1'" ).arg( *it ) ) *************** *** 765,769 **** PY_PROPERTY( "name", this->name() ) PY_PROPERTY( "pos", pos() ) ! PY_PROPERTY( "eventlist", eventList() ) // \rproperty object.multi This item property contains the multi this object is contained in. PY_PROPERTY( "multi", multi_ ) --- 765,769 ---- PY_PROPERTY( "name", this->name() ) PY_PROPERTY( "pos", pos() ) ! PY_PROPERTY( "scriptlist", scriptList() ) // \rproperty object.multi This item property contains the multi this object is contained in. PY_PROPERTY( "multi", multi_ ) *************** *** 1023,1027 **** } ! QString cUObject::eventList() const { if ( !scriptChain ) --- 1023,1027 ---- } ! QString cUObject::scriptList() const { if ( !scriptChain ) *************** *** 1048,1052 **** } ! void cUObject::setEventList( const QString& eventlist ) { if ( isScriptChainFrozen() ) --- 1048,1052 ---- } ! void cUObject::setScriptList( const QString& eventlist ) { if ( isScriptChainFrozen() ) *************** *** 1059,1063 **** QStringList::iterator it; ! clearEvents(); scriptChain = new cPythonScript * [1 + events.count()]; scriptChain[0] = reinterpret_cast<cPythonScript*>( 0 ); --- 1059,1063 ---- QStringList::iterator it; ! clearScripts(); scriptChain = new cPythonScript * [1 + events.count()]; scriptChain[0] = reinterpret_cast<cPythonScript*>( 0 ); Index: uobject.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uobject.h,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** uobject.h 25 Aug 2004 00:41:25 -0000 1.106 --- uobject.h 25 Aug 2004 17:01:23 -0000 1.107 *************** *** 108,121 **** // Event Management Methods ! void clearEvents(); ! void addEvent( cPythonScript * Event, bool append = false ); ! void removeEvent( const QString& Name ); ! bool hasEvent( const QString& Name ) const; void freezeScriptChain(); void unfreezeScriptChain(); bool isScriptChainFrozen(); ! void setEventList( const QString& events ); ! QString eventList() const; ! inline cPythonScript** getEvents() { return scriptChain; --- 108,121 ---- // Event Management Methods ! void clearScripts(); ! void addScript( cPythonScript * script, bool append = false ); ! void removeScript( const QString& Name ); ! bool hasScript( const QString& Name ) const; void freezeScriptChain(); void unfreezeScriptChain(); bool isScriptChainFrozen(); ! void setScriptList( const QString& scripts ); ! QString scriptList() const; ! inline cPythonScript** getScripts() { return scriptChain; Index: wolfpack.vcproj =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.vcproj,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** wolfpack.vcproj 18 Aug 2004 17:05:46 -0000 1.44 --- wolfpack.vcproj 25 Aug 2004 17:01:29 -0000 1.45 *************** *** 826,830 **** Filter=""> <File ! RelativePath=".\twofish\twofish2.c"> </File> </Filter> --- 826,830 ---- Filter=""> <File ! RelativePath=".\twofish\twofish2.cpp"> </File> </Filter> Index: timers.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/timers.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** timers.cpp 22 Aug 2004 02:29:51 -0000 1.11 --- timers.cpp 25 Aug 2004 17:01:23 -0000 1.12 *************** *** 275,279 **** void cTimers::dispel( P_CHAR pc_dest, P_CHAR pSource, const QString& type, bool silent, bool onlyDispellable ) { ! /*if (cPythonScript::canChainHandleEvent(EVENT_DISPEL, pc_dest->getEvents())) { PyObject *source; if (pSource) { --- 275,279 ---- void cTimers::dispel( P_CHAR pc_dest, P_CHAR pSource, const QString& type, bool silent, bool onlyDispellable ) { ! /*if (cPythonScript::canChainHandleEvent(EVENT_DISPEL, pc_dest->getScripts())) { PyObject *source; if (pSource) { *************** *** 289,293 **** PyObject *args = Py_BuildValue("(NNBBsN", pc_dest->getPyObject(), source, silent ? 1 : 0, onlyDispellable ? 0 : 1, ptype, PyTuple_New(0)); ! bool result = cPythonScript::callChainedEventHandler(EVENT_DISPEL, pc_dest->getEvents(), args); Py_DECREF(args); if (result) { --- 289,293 ---- PyObject *args = Py_BuildValue("(NNBBsN", pc_dest->getPyObject(), source, silent ? 1 : 0, onlyDispellable ? 0 : 1, ptype, PyTuple_New(0)); ! bool result = cPythonScript::callChainedEventHandler(EVENT_DISPEL, pc_dest->getScripts(), args); Py_DECREF(args); if (result) { *************** *** 322,326 **** void cTimers::dispel( P_CHAR pc_dest, P_CHAR pSource, bool silent ) { ! if ( cPythonScript::canChainHandleEvent( EVENT_DISPEL, pc_dest->getEvents() ) ) { PyObject* source; --- 322,326 ---- void cTimers::dispel( P_CHAR pc_dest, P_CHAR pSource, bool silent ) { ! if ( cPythonScript::canChainHandleEvent( EVENT_DISPEL, pc_dest->getScripts() ) ) { PyObject* source; *************** *** 336,340 **** PyObject* args = Py_BuildValue( "(NNBBsN", pc_dest->getPyObject(), source, silent ? 1 : 0, 0, "", PyTuple_New( 0 ) ); ! bool result = cPythonScript::callChainedEventHandler( EVENT_DISPEL, pc_dest->getEvents(), args ); Py_DECREF( args ); --- 336,340 ---- PyObject* args = Py_BuildValue( "(NNBBsN", pc_dest->getPyObject(), source, silent ? 1 : 0, 0, "", PyTuple_New( 0 ) ); ! bool result = cPythonScript::callChainedEventHandler( EVENT_DISPEL, pc_dest->getScripts(), args ); Py_DECREF( args ); Index: speech.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/speech.cpp,v retrieving revision 1.185 retrieving revision 1.186 diff -C2 -d -r1.185 -r1.186 *** speech.cpp 19 Aug 2004 01:59:15 -0000 1.185 --- speech.cpp 25 Aug 2004 17:01:23 -0000 1.186 *************** *** 259,263 **** continue; ! cPythonScript** events = pNpc->getEvents(); if ( events ) --- 259,263 ---- continue; ! cPythonScript** events = pNpc->getScripts(); if ( events ) Index: walking.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/walking.cpp,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** walking.cpp 22 Aug 2004 02:29:51 -0000 1.137 --- walking.cpp 25 Aug 2004 17:01:24 -0000 1.138 *************** *** 236,240 **** { // Doors can be passed by ghosts ! if ( pItem->hasEvent( "door" ) ) { continue; --- 236,240 ---- { // Doors can be passed by ghosts ! if ( pItem->hasScript( "door" ) ) { continue; Index: items.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v retrieving revision 1.439 retrieving revision 1.440 diff -C2 -d -r1.439 -r1.440 *** items.cpp 22 Aug 2004 02:29:50 -0000 1.439 --- items.cpp 25 Aug 2004 17:01:23 -0000 1.440 *************** *** 193,197 **** // Copy Events scriptChain = 0; ! setEventList( src.eventList() ); this->name_ = src.name_; this->tags_ = src.tags_; --- 193,197 ---- // Copy Events scriptChain = 0; ! setScriptList( src.scriptList() ); this->name_ = src.name_; this->tags_ = src.tags_; *************** *** 647,651 **** } ! clearEvents(); removeFromView( false ); // Remove it from all clients in range free = true; --- 647,651 ---- } ! clearScripts(); removeFromView( false ); // Remove it from all clients in range free = true; *************** *** 2189,2193 **** // Do some basic checks and see if the item is a // container (they never stack). ! if ( id() != pItem->id() || color() != pItem->color() || type() == 1 || type() != pItem->type() || bindmenu() != pItem->bindmenu() || eventList() != pItem->eventList() || baseid() != pItem->baseid() ) { return false; --- 2189,2193 ---- // Do some basic checks and see if the item is a // container (they never stack). ! if ( id() != pItem->id() || color() != pItem->color() || type() == 1 || type() != pItem->type() || bindmenu() != pItem->bindmenu() || scriptList() != pItem->scriptList() || baseid() != pItem->baseid() ) { return false; *************** *** 2304,2308 **** P_ITEM pCont = dynamic_cast<P_ITEM>( container_ ); ! if ( pCont->hasEvent( "lock" ) ) { return true; --- 2304,2308 ---- P_ITEM pCont = dynamic_cast<P_ITEM>( container_ ); ! if ( pCont->hasScript( "lock" ) ) { return true; |
From: Sebastian H. <dar...@us...> - 2004-08-25 17:01:42
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11978/network Modified Files: uosocket.cpp Log Message: Changed all references to "events" to "scripts" Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.398 retrieving revision 1.399 diff -C2 -d -r1.398 -r1.399 *** uosocket.cpp 25 Aug 2004 01:54:04 -0000 1.398 --- uosocket.cpp 25 Aug 2004 17:01:33 -0000 1.399 *************** *** 3004,3008 **** void cUOSocket::handleChat( cUOPacket* packet ) { ! if ( cPythonScript::canChainHandleEvent( EVENT_CHAT, _player->getEvents() ) ) { PyObject* args = Py_BuildValue( "(N)", _player->getPyObject() ); --- 3004,3008 ---- void cUOSocket::handleChat( cUOPacket* packet ) { ! if ( cPythonScript::canChainHandleEvent( EVENT_CHAT, _player->getScripts() ) ) { PyObject* args = Py_BuildValue( "(N)", _player->getPyObject() ); |
From: Jorge P. <ke...@us...> - 2004-08-25 01:54:18
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19803 Modified Files: uosocket.cpp Log Message: Fixed upper limit for loop in clearPacketHandlers Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.397 retrieving revision 1.398 diff -C2 -d -r1.397 -r1.398 *** uosocket.cpp 22 Aug 2004 02:29:51 -0000 1.397 --- uosocket.cpp 25 Aug 2004 01:54:04 -0000 1.398 *************** *** 129,133 **** void cUOSocket::clearPacketHandlers() { ! for ( int i = 0; i < 256; ++i ) { if ( handlers[i] ) --- 129,133 ---- void cUOSocket::clearPacketHandlers() { ! for ( int i = 0; i < 255; ++i ) { if ( handlers[i] ) |
From: Jorge P. <ke...@us...> - 2004-08-25 00:41:37
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6628 Modified Files: uobject.cpp uobject.h Log Message: ... Index: uobject.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v retrieving revision 1.179 retrieving revision 1.180 diff -C2 -d -r1.179 -r1.180 *** uobject.cpp 24 Aug 2004 19:38:17 -0000 1.179 --- uobject.cpp 25 Aug 2004 00:41:25 -0000 1.180 *************** *** 331,335 **** Adds an event handler to this object */ ! void cUObject::addEvent( cPythonScript* event ) { if ( isScriptChainFrozen() ) --- 331,335 ---- Adds an event handler to this object */ ! void cUObject::addEvent( cPythonScript* event, bool append ) { if ( isScriptChainFrozen() ) *************** *** 349,355 **** cPythonScript** newScriptChain = new cPythonScript* [count + 2]; ! memcpy( newScriptChain, scriptChain, ( count + 1 ) * sizeof( cPythonScript * ) ); newScriptChain[0] = reinterpret_cast<cPythonScript*>( count + 1 ); - newScriptChain[count + 1] = event; delete[] scriptChain; --- 349,364 ---- cPythonScript** newScriptChain = new cPythonScript* [count + 2]; ! if ( append || count == 0 ) ! { ! memcpy( newScriptChain, scriptChain, ( count + 1 ) * sizeof( cPythonScript * ) ); ! newScriptChain[count + 1] = event; ! } ! else ! { ! // make room for the 1st event ! memcpy( &newScriptChain[2], &scriptChain[1], ( count ) * sizeof( cPythonScript * ) ); ! newScriptChain[1] = event; ! } newScriptChain[0] = reinterpret_cast<cPythonScript*>( count + 1 ); delete[] scriptChain; *************** *** 383,387 **** } ! if ( !hasEvent( event->name() ) ) { return; --- 392,396 ---- } ! if ( !hasEvent( name ) ) { return; Index: uobject.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uobject.h,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** uobject.h 19 Aug 2004 01:55:56 -0000 1.105 --- uobject.h 25 Aug 2004 00:41:25 -0000 1.106 *************** *** 109,113 **** // Event Management Methods void clearEvents(); ! void addEvent( cPythonScript* Event ); void removeEvent( const QString& Name ); bool hasEvent( const QString& Name ) const; --- 109,113 ---- // Event Management Methods void clearEvents(); ! void addEvent( cPythonScript * Event, bool append = false ); void removeEvent( const QString& Name ); bool hasEvent( const QString& Name ) const; |
From: Jorge P. <ke...@us...> - 2004-08-24 21:31:43
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28082/magic Modified Files: nightsight.py spell.py utilities.py Log Message: Fixed some indentation errors. Index: nightsight.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/nightsight.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** nightsight.py 24 Aug 2004 17:18:26 -0000 1.5 --- nightsight.py 24 Aug 2004 21:31:33 -0000 1.6 *************** *** 14,18 **** player.lightbonus = max(0, player.lightbonus - bonus) ! player.removeevent('magic.nightsight') player.deltag('nightsight') player.deltag('nightsight_start') --- 14,18 ---- player.lightbonus = max(0, player.lightbonus - bonus) ! player.removeevent('magic.nightsight') player.deltag('nightsight') player.deltag('nightsight_start') Index: spell.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/spell.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** spell.py 24 Aug 2004 17:18:26 -0000 1.15 --- spell.py 24 Aug 2004 21:31:33 -0000 1.16 *************** *** 20,23 **** --- 20,24 ---- return items + # Recursive Function for removing reagents def consumeReagents(item, items): *************** *** 31,47 **** item.update() del items[key] - return items # Reagents normally dont have content for subitem in item.content: items = consumeReagents(subitem, items) - return items def callback(char, args): ! char.removeevent('magic') # target ! if args[3] and type(args[3]) == int: target = wolfpack.findobject(args[3]) --- 32,47 ---- item.update() del items[key] return items # Reagents normally dont have content for subitem in item.content: items = consumeReagents(subitem, items) return items + def callback(char, args): ! char.removeevent('magic') # target ! if args[3] and type(args[3]) is int: target = wolfpack.findobject(args[3]) *************** *** 54,58 **** # item ! if args[4] and type(args[4]) == int: item = wolfpack.findobject(args[4]) --- 54,58 ---- # item ! if args[4] and (type(args[4]) is int): item = wolfpack.findobject(args[4]) Index: utilities.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/utilities.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** utilities.py 24 Aug 2004 17:18:26 -0000 1.11 --- utilities.py 24 Aug 2004 21:31:33 -0000 1.12 *************** *** 50,56 **** # def fizzle(char): ! char.dispel(char, 1, "cast_delay") ! char.removeevent('magic') if char.socket: --- 50,56 ---- # def fizzle(char): ! char.dispel(char, 1, 'cast_delay') ! char.removeevent('magic') if char.socket: |
From: Jorge P. <ke...@us...> - 2004-08-24 21:31:42
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28082/commands Modified Files: email.py password.py Log Message: Fixed some indentation errors. Index: email.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/email.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** email.py 24 Aug 2004 20:13:22 -0000 1.2 --- email.py 24 Aug 2004 21:31:30 -0000 1.3 *************** *** 20,27 **** def commandEmail( socket, cmd, args ): char = socket.player ! account = wolfpack.accounts.find( char.account.name ) email = str( args.strip() ) ! if len( email ) == 0 socket.sysmessage( "Usage: email <new email>" ) return False --- 20,27 ---- def commandEmail( socket, cmd, args ): char = socket.player ! account = char.account # wolfpack.accounts.find( char.account.name ) email = str( args.strip() ) ! if len( email ) == 0: socket.sysmessage( "Usage: email <new email>" ) return False Index: password.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/password.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** password.py 24 Aug 2004 20:13:22 -0000 1.4 --- password.py 24 Aug 2004 21:31:30 -0000 1.5 *************** *** 21,25 **** char = socket.player password = str( args.strip() ) ! account = wolfpack.accounts.find( char.account.name ) if len( password ) == 0: --- 21,25 ---- char = socket.player password = str( args.strip() ) ! account = char.account # wolfpack.accounts.find( char.account.name ) if len( password ) == 0: |
From: Jorge P. <ke...@us...> - 2004-08-24 20:13:38
|
Update of /cvsroot/wpdev/xmlscripts/scripts/speech In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5541/scripts/speech Modified Files: banker.py Log Message: - Fixed email command and cleaned up password command. - Added encryption for some clients above 3.0.5 that were missing Index: banker.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/speech/banker.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** banker.py 24 Aug 2004 18:10:29 -0000 1.11 --- banker.py 24 Aug 2004 20:13:22 -0000 1.12 *************** *** 139,146 **** # An item has been dropped on us def onDropOnChar( char, item ): ! ! if char.hasevent( 'speech_banker' ): ! char.socket.clilocmessage( 0x7A2A4, "", 0x3b2, 3, listener ) ! #backpack = char.getbackpack() ! #item.container = backpack ! return 0 --- 139,144 ---- # An item has been dropped on us def onDropOnChar( char, item ): ! char.socket.clilocmessage( 0x7A2A4, "", 0x3b2, 3, listener ) ! #backpack = char.getbackpack() ! #item.container = backpack ! return 0 |
From: Jorge P. <ke...@us...> - 2004-08-24 20:13:38
|
Update of /cvsroot/wpdev/xmlscripts/definitions/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5541/definitions/system Modified Files: encryption.xml Log Message: - Fixed email command and cleaned up password command. - Added encryption for some clients above 3.0.5 that were missing Index: encryption.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/system/encryption.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** encryption.xml 9 Jun 2004 21:44:17 -0000 1.3 --- encryption.xml 24 Aug 2004 20:13:21 -0000 1.4 *************** *** 16,19 **** --- 16,22 ---- <item> Client 4.0.1 ; 0x2E2BA7ED ; 0xA2017E7F </item> <item> Client 4.0.0 ; 0x2E13A5FD ; 0xA21D527F </item> + <item> Client 3.0.8 ; 0x2C53257D ; 0xA33F527F </item> + <item> Client 3.0.7 ; 0x2C1BC78D ; 0xA31BFE7F </item> + <item> Client 3.0.6 ; 0x2CC3ED9D ; 0xA374227F </item> <item> Client 3.0.5 ; 0x2C8B97AD ; 0xA350DE7F </item> </list> |
From: Jorge P. <ke...@us...> - 2004-08-24 20:13:38
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5541/scripts/commands Modified Files: __init__.py email.py password.py Log Message: - Fixed email command and cleaned up password command. - Added encryption for some clients above 3.0.5 that were missing Index: password.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/password.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** password.py 17 Jul 2004 12:56:22 -0000 1.3 --- password.py 24 Aug 2004 20:13:22 -0000 1.4 *************** *** 19,41 **** # Handles the password command def commandPassword( socket, cmd, args ): - account = None - password = None char = socket.player ! args = args.strip() account = wolfpack.accounts.find( char.account.name ) ! password = str( args ) if len( password ) == 0: socket.sysmessage( "Usage: password <newpassword>" ) return False ! elif len( password ) > 0: ! if len( password ) > 16: ! socket.sysmessage( "Your password can have a maximum of 16 characters." ) ! return False ! else: ! account.password = str( password ) ! socket.sysmessage( "Your password has been changed." ) ! char.log( LOG_MESSAGE, "Account %s changed their password.\n" % char.serial ) ! return True ! else: ! socket.sysmessage( "Usage: password <newpassword>" ) return False --- 19,35 ---- # Handles the password command def commandPassword( socket, cmd, args ): char = socket.player ! password = str( args.strip() ) account = wolfpack.accounts.find( char.account.name ) ! if len( password ) == 0: socket.sysmessage( "Usage: password <newpassword>" ) return False ! elif len( password ) > 16: ! socket.sysmessage( "Your password can have a maximum of 16 characters." ) return False + + account.password = str( password ) + socket.sysmessage( "Your password has been changed." ) + char.log( LOG_MESSAGE, "Account %s changed their password.\n" % char.serial ) + return True Index: __init__.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/__init__.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** __init__.py 27 Jun 2004 11:48:28 -0000 1.14 --- __init__.py 24 Aug 2004 20:13:22 -0000 1.15 *************** *** 90,95 **** def nightsight(socket, command, arguments): player = socket.player ! if player.hastag( 'magic.nightsight'): ! player.removeevent('magic.nightsight') if player.hastag('nightsight'): --- 90,94 ---- def nightsight(socket, command, arguments): player = socket.player ! player.removeevent('magic.nightsight') if player.hastag('nightsight'): Index: email.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/email.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** email.py 23 Aug 2004 03:10:39 -0000 1.1 --- email.py 24 Aug 2004 20:13:22 -0000 1.2 *************** *** 17,37 **** return ! # Handles the password command def commandEmail( socket, cmd, args ): - account = None - password = None char = socket.player - args = args.strip() account = wolfpack.accounts.find( char.account.name ) ! email = str( args ) ! if len( email ) == 0 or len( email ) > 255: ! if len( email ) > 0: ! socket.sysmessage( "Usage: email <newemail>" ) ! elif len( password ) > 255: ! socket.sysmessage( "Your email can have a maximum of 255 characters." ) return False ! else: ! account.email = str( email ) ! socket.sysmessage( "Your email has been changed." ) ! char.log( LOG_MESSAGE, "Account %s changed their email.\n" % account.name ) ! return True --- 17,35 ---- return ! # Handles the email command def commandEmail( socket, cmd, args ): char = socket.player account = wolfpack.accounts.find( char.account.name ) ! email = str( args.strip() ) ! ! if len( email ) == 0 ! socket.sysmessage( "Usage: email <new email>" ) return False ! elif len( email ) > 255: ! socket.sysmessage( "Your email can have a maximum of 255 characters." ) ! return False ! ! account.email = str( email ) ! socket.sysmessage( "Your email has been changed." ) ! char.log( LOG_MESSAGE, "Account %s changed their email.\n" % account.name ) ! return True |
From: Jorge P. <ke...@us...> - 2004-08-24 19:38:30
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25558 Modified Files: uobject.cpp Log Message: Index: uobject.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v retrieving revision 1.178 retrieving revision 1.179 diff -C2 -d -r1.178 -r1.179 *** uobject.cpp 24 Aug 2004 19:11:44 -0000 1.178 --- uobject.cpp 24 Aug 2004 19:38:17 -0000 1.179 *************** *** 396,400 **** if ( count == 1 ) { - event = scriptChain[1]; clearEvents(); } --- 396,399 ---- |
From: Jorge P. <ke...@us...> - 2004-08-24 19:11:56
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15839 Modified Files: uobject.cpp Log Message: Changed removeEvent() so that it will only set the changed_ flag if something i s actually changed. Fixed the attach hook not being triggered if there was only one event. Index: uobject.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v retrieving revision 1.177 retrieving revision 1.178 diff -C2 -d -r1.177 -r1.178 *** uobject.cpp 22 Aug 2004 02:29:51 -0000 1.177 --- uobject.cpp 24 Aug 2004 19:11:44 -0000 1.178 *************** *** 383,389 **** } cPythonScript* event = 0; ! if ( scriptChain && hasEvent( name ) ) { unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] ); --- 383,394 ---- } + if ( !hasEvent( event->name() ) ) + { + return; + } + cPythonScript* event = 0; ! if ( scriptChain ) { unsigned int count = reinterpret_cast<unsigned int>( scriptChain[0] ); *************** *** 391,394 **** --- 396,400 ---- if ( count == 1 ) { + event = scriptChain[1]; clearEvents(); } |
From: Jorge P. <ke...@us...> - 2004-08-24 18:11:12
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/magic Modified Files: circle2.py circle3.py Log Message: - Replaced access to .events with the calls hasevent/addevent/removeevent in all relevant places. Notice that addevent() is expected to add the event to the head of the list. I recognized no situation (of those changed) where it would make a difference adding the event to the end of the list, so in those cases used addevent aswell. - Fixed a copy&paste error in trap.py on removing the tags (pointed out by Incannus). note: .events can now be made read only, bearing in mind that in doing so there is no way to make a distinction between adding an event at the top or at the end of the event list. Index: circle3.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle3.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** circle3.py 24 Aug 2004 17:18:26 -0000 1.8 --- circle3.py 24 Aug 2004 18:10:28 -0000 1.9 *************** *** 180,188 **** char.turnto(target) - events = target.events hasevent = 0 # Check if there is an event handling onUse but not onTelekinesis ! for event in events: if wolfpack.hasevent(event, EVENT_TELEKINESIS): hasevent = 1 # The object has at least one telekinesis handler --- 180,187 ---- char.turnto(target) hasevent = 0 # Check if there is an event handling onUse but not onTelekinesis ! for event in target.events: if wolfpack.hasevent(event, EVENT_TELEKINESIS): hasevent = 1 # The object has at least one telekinesis handler Index: circle2.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle2.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** circle2.py 24 Aug 2004 17:18:26 -0000 1.9 --- circle2.py 24 Aug 2004 18:10:28 -0000 1.10 *************** *** 119,125 **** # Remove the Trap Properties from the Item target.removeevent( 'magic.trap' ) ! target.deltag('trap_owner', char.serial) ! target.deltag('trap_damage', random.randint(10, 50)) ! target.deltag('trap_type', 'magic') class Protection(Spell): --- 119,125 ---- # Remove the Trap Properties from the Item target.removeevent( 'magic.trap' ) ! target.deltag('trap_owner') ! target.deltag('trap_damage') ! target.deltag('trap_type') class Protection(Spell): |
From: Jorge P. <ke...@us...> - 2004-08-24 18:11:10
|
Update of /cvsroot/wpdev/xmlscripts/scripts/guilds In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/guilds Modified Files: deed.py member.py stone.py Log Message: - Replaced access to .events with the calls hasevent/addevent/removeevent in all relevant places. Notice that addevent() is expected to add the event to the head of the list. I recognized no situation (of those changed) where it would make a difference adding the event to the end of the list, so in those cases used addevent aswell. - Fixed a copy&paste error in trap.py on removing the tags (pointed out by Incannus). note: .events can now be made read only, bearing in mind that in doing so there is no way to make a distinction between adding an event at the top or at the end of the event list. Index: stone.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/guilds/stone.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** stone.py 26 May 2004 13:07:22 -0000 1.4 --- stone.py 24 Aug 2004 18:10:27 -0000 1.5 *************** *** 553,559 **** sendMessage(target.char, 'You have been recruited as a canidate for %s by %s.' % (guild.name, player.name)) guild.addcanidate(target.char) ! events = target.char.events ! if 'guilds.member' not in events: ! target.char.events = events + ['guilds.member'] target.char.resendtooltip() if guild.guildstone: --- 553,557 ---- sendMessage(target.char, 'You have been recruited as a canidate for %s by %s.' % (guild.name, player.name)) guild.addcanidate(target.char) ! target.char.addevent( 'guilds.member' ) target.char.resendtooltip() if guild.guildstone: *************** *** 609,616 **** # Make sure our member has the neccesary event ! events = char.events ! if 'guilds.member' not in events: ! char.events = events + ['guilds.member'] ! char.resendtooltip() if guild.guildstone: --- 607,611 ---- # Make sure our member has the neccesary event ! char.addevent( 'guilds.member' ) char.resendtooltip() if guild.guildstone: Index: member.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/guilds/member.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** member.py 26 May 2004 13:07:22 -0000 1.5 --- member.py 24 Aug 2004 18:10:27 -0000 1.6 *************** *** 27,34 **** player.deltag(tag) ! events = player.events ! while 'guilds.member' in events: ! events.remove('guilds.member') ! player.events = events else: # Remove voting tags just in case --- 27,31 ---- player.deltag(tag) ! player.removeevent( 'guilds.member' ) else: # Remove voting tags just in case Index: deed.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/guilds/deed.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** deed.py 2 Apr 2004 01:06:14 -0000 1.3 --- deed.py 24 Aug 2004 18:10:27 -0000 1.4 *************** *** 28,34 **** guild.addmember(player) guild.leader = player ! events = player.events ! if 'guilds.member' not in events: ! player.events = events + ['guilds.member'] # Create a guildstone at the given location --- 28,33 ---- guild.addmember(player) guild.leader = player ! ! player.addevent( 'guilds.member' ) # Create a guildstone at the given location |
From: Jorge P. <ke...@us...> - 2004-08-24 18:11:10
|
Update of /cvsroot/wpdev/xmlscripts/scripts/deeds In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/deeds Modified Files: multideed.py Log Message: - Replaced access to .events with the calls hasevent/addevent/removeevent in all relevant places. Notice that addevent() is expected to add the event to the head of the list. I recognized no situation (of those changed) where it would make a difference adding the event to the end of the list, so in those cases used addevent aswell. - Fixed a copy&paste error in trap.py on removing the tags (pointed out by Incannus). note: .events can now be made read only, bearing in mind that in doing so there is no way to make a distinction between adding an event at the top or at the end of the event list. Index: multideed.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/deeds/multideed.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** multideed.py 25 Apr 2004 22:03:36 -0000 1.1 --- multideed.py 24 Aug 2004 18:10:26 -0000 1.2 *************** *** 199,203 **** sign.moveto( newpos ) sign.settag( 'house', multi.serial ) ! sign.events = ["signpost"] #woodenpost.update() signpost.update() --- 199,203 ---- sign.moveto( newpos ) sign.settag( 'house', multi.serial ) ! sign.addevent( 'signpost' ) #woodenpost.update() signpost.update() |
From: Jorge P. <ke...@us...> - 2004-08-24 18:11:08
|
Update of /cvsroot/wpdev/xmlscripts/scripts/contextmenus In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/contextmenus Modified Files: petmenu.py Log Message: - Replaced access to .events with the calls hasevent/addevent/removeevent in all relevant places. Notice that addevent() is expected to add the event to the head of the list. I recognized no situation (of those changed) where it would make a difference adding the event to the end of the list, so in those cases used addevent aswell. - Fixed a copy&paste error in trap.py on removing the tags (pointed out by Incannus). note: .events can now be made read only, bearing in mind that in doing so there is no way to make a distinction between adding an event at the top or at the end of the event list. Index: petmenu.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/contextmenus/petmenu.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** petmenu.py 2 Jun 2004 15:03:04 -0000 1.5 --- petmenu.py 24 Aug 2004 18:10:25 -0000 1.6 *************** *** 17,21 **** def onContextEntry(char, target, tag): ! if not "speech.pets" in target.events: return 0 --- 17,21 ---- def onContextEntry(char, target, tag): ! if not target.hasevent( 'speech.pets' ): return 0 |
From: Jorge P. <ke...@us...> - 2004-08-24 18:11:08
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/commands Modified Files: events.py Log Message: - Replaced access to .events with the calls hasevent/addevent/removeevent in all relevant places. Notice that addevent() is expected to add the event to the head of the list. I recognized no situation (of those changed) where it would make a difference adding the event to the end of the list, so in those cases used addevent aswell. - Fixed a copy&paste error in trap.py on removing the tags (pointed out by Incannus). note: .events can now be made read only, bearing in mind that in doing so there is no way to make a distinction between adding an event at the top or at the end of the event list. Index: events.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/events.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** events.py 12 Jul 2004 00:48:54 -0000 1.3 --- events.py 24 Aug 2004 18:10:23 -0000 1.4 *************** *** 95,97 **** wolfpack.registercommand('addevent', commandAddevent) wolfpack.registercommand('removeevent', commandRemoveevent) - #wolfpack.registercommand('addevent', commandAddevent) --- 95,96 ---- |
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093 Modified Files: door.py food.py key.py keyring.py lock.py lockpick.py potionkeg.py potions.py spiderweb.py Log Message: - Replaced access to .events with the calls hasevent/addevent/removeevent in all relevant places. Notice that addevent() is expected to add the event to the head of the list. I recognized no situation (of those changed) where it would make a difference adding the event to the end of the list, so in those cases used addevent aswell. - Fixed a copy&paste error in trap.py on removing the tags (pointed out by Incannus). note: .events can now be made read only, bearing in mind that in doing so there is no way to make a distinction between adding an event at the top or at the end of the event list. Index: door.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/door.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** door.py 14 Jul 2004 07:41:03 -0000 1.14 --- door.py 24 Aug 2004 18:10:22 -0000 1.15 *************** *** 207,211 **** for item in container.content: # Check if it's a key ! if 'key' in item.events and item.hastag( 'lock' ) and int( item.gettag( 'lock' ) ) == lock: return 1 --- 207,211 ---- for item in container.content: # Check if it's a key ! if item.hasevent( 'key' ) and item.hastag( 'lock' ) and int( item.gettag( 'lock' ) ) == lock: return 1 Index: keyring.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/keyring.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** keyring.py 26 May 2004 13:07:20 -0000 1.4 --- keyring.py 24 Aug 2004 18:10:23 -0000 1.5 *************** *** 3,7 **** def onDropOnItem(keyring, key): ! if 'keyring' not in keyring.events or 'key' not in key.events: return 0 --- 3,7 ---- def onDropOnItem(keyring, key): ! if not keyring.hasevent( 'keyring' ) or not key.hasevent( 'key' ): return 0 *************** *** 69,73 **** return ! if not 'lock' in target.item.events or not target.item.hastag('lock'): char.socket.clilocmessage(501666) return --- 69,73 ---- return ! if not target.item.hasevent( 'lock' ) or not target.item.hastag( 'lock' ): char.socket.clilocmessage(501666) return *************** *** 79,83 **** for key in keys: ! if key.hastag('lock') and 'key' in key.events: key_lock = str(key.gettag('lock')) --- 79,83 ---- for key in keys: ! if key.hastag('lock') and key.hasevent( 'key' ): key_lock = str(key.gettag('lock')) Index: spiderweb.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/spiderweb.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** spiderweb.py 11 Jul 2004 02:47:25 -0000 1.3 --- spiderweb.py 24 Aug 2004 18:10:23 -0000 1.4 *************** *** 9,16 **** def onCollide(char, item): # Ignore if the character already has the event ! if 'spiderweb' in char.events: return ! char.events = ['spiderweb'] + char.events if char.socket: char.socket.sysmessage('You are entangled in the spiderweb. You have to break free!') --- 9,16 ---- def onCollide(char, item): # Ignore if the character already has the event ! if char.hasevent( 'spiderweb' ): return ! char.addevent( 'spiderweb' ) if char.socket: char.socket.sysmessage('You are entangled in the spiderweb. You have to break free!') *************** *** 28,32 **** for item in items: ! if 'spiderweb' in item.events: spiderweb = item break --- 28,32 ---- for item in items: ! if item.hasevent( 'spiderweb' ): spiderweb = item break *************** *** 51,59 **** return True ! events = char.events ! while 'spiderweb' in events: ! events.remove('spiderweb') ! char.events = events ! char.socket.sysmessage('You manage to break free of the spiderweb.') return False --- 51,55 ---- return True ! char.removeevent( 'spiderweb' ) char.socket.sysmessage('You manage to break free of the spiderweb.') return False *************** *** 70,74 **** for item in items: ! if 'spiderweb' in item.events: spiderweb = item break --- 66,70 ---- for item in items: ! if item.hasevent( 'spiderweb' ): spiderweb = item break *************** *** 86,93 **** for target in targets: ! events = target.events ! while 'spiderweb' in events: ! events.remove('spiderweb') ! target.events = events return amount --- 82,86 ---- for target in targets: ! target.removeevent( 'spiderweb' ) return amount Index: lockpick.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/lockpick.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** lockpick.py 9 Jul 2004 21:47:45 -0000 1.4 --- lockpick.py 24 Aug 2004 18:10:23 -0000 1.5 *************** *** 12,16 **** char.socket.clilocmessage(500312) else: ! if not target.item or 'lock' not in target.item.events: char.socket.clilocmessage(502069) elif not char.canreach(target.item, 3): --- 12,16 ---- char.socket.clilocmessage(500312) else: ! if not target.item or not target.item.hasevent( 'lock' ): char.socket.clilocmessage(502069) elif not char.canreach(target.item, 3): *************** *** 31,39 **** if char.checkskill(LOCKPICKING, 0, 1200): # SUCCESS: Remove lockpick and the lock ! events = target.item.events ! while 'lock' in events: ! events.remove('lock') ! target.item.events = events ! target.item.deltag('lock') target.item.deltag('locked') --- 31,35 ---- if char.checkskill(LOCKPICKING, 0, 1200): # SUCCESS: Remove lockpick and the lock ! target.item.removeevent( 'lock' ) target.item.deltag('lock') target.item.deltag('locked') Index: key.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/key.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** key.py 9 Jul 2004 21:47:45 -0000 1.11 --- key.py 24 Aug 2004 18:10:23 -0000 1.12 *************** *** 88,92 **** rename_key(char,key) ! elif 'lock' in target.item.events: if target.item.hastag('locked') and int(target.item.gettag('locked')) == 1: target.item.deltag('locked') --- 88,92 ---- rename_key(char,key) ! elif target.item.hasevent( 'lock' ): if target.item.hastag('locked') and int(target.item.gettag('locked')) == 1: target.item.deltag('locked') *************** *** 110,114 **** # Check if the targetted item is a key ! if not target.item or not 'key' in target.item.events: char.socket.clilocmessage(501679) return --- 110,114 ---- # Check if the targetted item is a key ! if not target.item or not target.item.hasevent( 'key' ): char.socket.clilocmessage(501679) return Index: potions.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/potions.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** potions.py 16 Jul 2004 07:09:26 -0000 1.42 --- potions.py 24 Aug 2004 18:10:23 -0000 1.43 *************** *** 380,386 **** bonus = min(18, math.floor(18 * (char.skill[MAGERY] / 1000.0))) ! char.events = ['magic.nightsight'] + char.events ! char.settag("nightsight", bonus) ! char.settag("nightsight_start", time.minutes()) char.lightbonus += bonus --- 380,386 ---- bonus = min(18, math.floor(18 * (char.skill[MAGERY] / 1000.0))) ! char.addevent( 'magic.nightsight' ) ! char.settag( 'nightsight', bonus) ! char.settag( 'nightsight_start', time.minutes()) char.lightbonus += bonus Index: potionkeg.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/potionkeg.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** potionkeg.py 19 Jul 2004 23:22:15 -0000 1.11 --- potionkeg.py 24 Aug 2004 18:10:23 -0000 1.12 *************** *** 14,18 **** return False ! if ( not 'potionkeg' in potionkeg.events ) or ( not 'potions' in potion.events ): return False --- 14,18 ---- return False ! if not potionkeg.hasevent( 'potionkeg' ) or not potion.hasevent( 'potions' ): return False *************** *** 72,76 **** return False ! if not 'potionkeg' in potionkeg.events: return False --- 72,76 ---- return False ! if not potionkeg.hasevent( 'potionkeg' ): return False Index: food.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/food.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** food.py 8 Aug 2004 20:17:45 -0000 1.12 --- food.py 24 Aug 2004 18:10:23 -0000 1.13 *************** *** 91,104 **** def onCollide( char, item ): if char.npc and item.baseid in farm_food and char.baseid in farm_eaters: ! if 'food' in char.events: ! return True ! if char.baseid in farm_eaters: ! char.events = ['food'] + char.events ! char.say( "*nibbles*" ) ! item.movable = 3 ! item.update() return True ! else: ! return False else: return False --- 91,101 ---- def onCollide( char, item ): if char.npc and item.baseid in farm_food and char.baseid in farm_eaters: ! if char.hasevent( 'food' ): return True ! char.addevent( 'food' ) ! char.say( "*nibbles*" ) ! item.movable = 3 ! item.update() ! return True else: return False *************** *** 107,115 **** if char.baseid in farm_eaters: items = wolfpack.items(char.pos.x, char.pos.y, char.pos.map, 0) food = None for item in items: ! if 'food' in item.events and item.baseid in farm_food: food = item break if food: food.delete() --- 104,114 ---- if char.baseid in farm_eaters: items = wolfpack.items(char.pos.x, char.pos.y, char.pos.map, 0) + food = None for item in items: ! if item.hasevent( 'food' ) and item.baseid in farm_food: food = item break + if food: food.delete() *************** *** 119,131 **** char.hitpoints += 1 char.update() ! events = char.events ! while 'food' in events: ! events.remove('food') ! char.events = events ! return True ! else: ! events = char.events ! while 'food' in events: ! events.remove('food') ! char.events = events ! return True --- 118,122 ---- char.hitpoints += 1 char.update() ! ! char.removeevent('food') ! return True Index: lock.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/lock.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** lock.py 26 May 2004 13:07:20 -0000 1.11 --- lock.py 24 Aug 2004 18:10:23 -0000 1.12 *************** *** 30,37 **** if response.button == 1: # Prepend 'lock' to the event chain ! if not 'lock' in item.events: ! events = item.events ! events[:0] = ['lock'] ! item.events = events # Set the lock id --- 30,35 ---- if response.button == 1: # Prepend 'lock' to the event chain ! if not item.hasevent( 'lock' ): ! item.addevent( 'lock' ) # Set the lock id *************** *** 66,73 **** # Remove the event from the eventlist ! events = item.events ! while 'lock' in events: ! events.remove('lock') ! item.events = events item.resendtooltip() --- 64,68 ---- # Remove the event from the eventlist ! item.removeevent( 'lock' ) item.resendtooltip() *************** *** 93,97 **** # Check if the item already has a lock ! if 'lock' in target.item.events and target.item.hastag('lock'): gump.addBackground(id=0x2436, width=425, height=285) --- 88,92 ---- # Check if the item already has a lock ! if target.item.hasevent('lock') and target.item.hastag('lock'): gump.addBackground(id=0x2436, width=425, height=285) *************** *** 169,173 **** def searchkey(item, lock): # It's a key. ! if 'key' in item.events and item.hastag('lock'): if lock == str(item.gettag('lock')): return 1 --- 164,168 ---- def searchkey(item, lock): # It's a key. ! if item.hasevent( 'key' ) and item.hastag( 'lock' ): if lock == str(item.gettag('lock')): return 1 *************** *** 202,206 **** # Only doors can be opened without unlocking them # if the user has the key in his posession. ! if 'door' in item.events: if searchkey(char.getbackpack(), lock): char.socket.clilocmessage(501282) --- 197,201 ---- # Only doors can be opened without unlocking them # if the user has the key in his posession. ! if item.hasevent( 'door' ): if searchkey(char.getbackpack(), lock): char.socket.clilocmessage(501282) |
From: Jorge P. <ke...@us...> - 2004-08-24 18:10:45
|
Update of /cvsroot/wpdev/xmlscripts/scripts/speech In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/speech Modified Files: banker.py Log Message: - Replaced access to .events with the calls hasevent/addevent/removeevent in all relevant places. Notice that addevent() is expected to add the event to the head of the list. I recognized no situation (of those changed) where it would make a difference adding the event to the end of the list, so in those cases used addevent aswell. - Fixed a copy&paste error in trap.py on removing the tags (pointed out by Incannus). note: .events can now be made read only, bearing in mind that in doing so there is no way to make a distinction between adding an event at the top or at the end of the event list. Index: banker.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/speech/banker.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** banker.py 26 May 2004 13:07:25 -0000 1.10 --- banker.py 24 Aug 2004 18:10:29 -0000 1.11 *************** *** 140,144 **** def onDropOnChar( char, item ): ! if "speech_banker" in char.events: char.socket.clilocmessage( 0x7A2A4, "", 0x3b2, 3, listener ) #backpack = char.getbackpack() --- 140,144 ---- def onDropOnChar( char, item ): ! if char.hasevent( 'speech_banker' ): char.socket.clilocmessage( 0x7A2A4, "", 0x3b2, 3, listener ) #backpack = char.getbackpack() |
From: Jorge P. <ke...@us...> - 2004-08-24 18:10:45
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/system Modified Files: poison.py spawns.py trading.py Log Message: - Replaced access to .events with the calls hasevent/addevent/removeevent in all relevant places. Notice that addevent() is expected to add the event to the head of the list. I recognized no situation (of those changed) where it would make a difference adding the event to the end of the list, so in those cases used addevent aswell. - Fixed a copy&paste error in trap.py on removing the tags (pointed out by Incannus). note: .events can now be made read only, bearing in mind that in doing so there is no way to make a distinction between adding an event at the top or at the end of the event list. Index: spawns.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/spawns.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** spawns.py 16 Jun 2004 20:18:43 -0000 1.4 --- spawns.py 24 Aug 2004 18:10:30 -0000 1.5 *************** *** 18,22 **** npc.wandertype = 3 npc.wanderradius = area ! npc.events = ['system.spawns'] + npc.events npc.update() elif spawntype == 0: --- 18,22 ---- npc.wandertype = 3 npc.wanderradius = area ! npc.addevent( 'system.spawns' ) npc.update() elif spawntype == 0: *************** *** 78,82 **** # Check if the spawn is valid. valid = item != None ! if valid and 'spawngem' not in item.events: valid = 0 if valid and not item.hastag('spawntype') or not item.hastag('spawndef'): --- 78,82 ---- # Check if the spawn is valid. valid = item != None ! if valid and not item.hasevent( 'spawngem' ): valid = 0 if valid and not item.hastag('spawntype') or not item.hastag('spawndef'): Index: trading.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/trading.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** trading.py 2 Jul 2004 13:40:46 -0000 1.4 --- trading.py 24 Aug 2004 18:10:30 -0000 1.5 *************** *** 66,73 **** #onLogout event should be executed for tradewindow disposing ! events1 = player1.events ! events1.append( 'system.trading' ) ! events2 = player2.events ! events2.append( 'system.trading' ) #We want to know serial of partner in future --- 66,71 ---- #onLogout event should be executed for tradewindow disposing ! player1.addevent( 'system.trading' ) ! player2.addevent( 'system.trading' ) #We want to know serial of partner in future Index: poison.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/poison.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** poison.py 26 May 2004 13:07:26 -0000 1.4 --- poison.py 24 Aug 2004 18:10:30 -0000 1.5 *************** *** 27,33 **** # If he did, save the strokes and level and restore it later if char.player and not char.socket and char.logouttime == 0: ! if not 'system.poison' in char.events: ! char.settag('poison_strokes', strokes) ! char.events = ['system.poison'] + char.events return --- 27,33 ---- # If he did, save the strokes and level and restore it later if char.player and not char.socket and char.logouttime == 0: ! if not char.hasevent( 'system.poison' ): ! char.settag( 'poison_strokes', strokes ) ! char.addevent( 'system.poison' ) return *************** *** 103,110 **** # def onLogin(char): ! events = char.events ! while 'system.poison' in events: ! events.remove('system.poison') ! char.events = events if not POISONS.has_key(char.poison): --- 103,107 ---- # def onLogin(char): ! char.removeevent( 'system.poison' ) if not POISONS.has_key(char.poison): |
From: Jorge P. <ke...@us...> - 2004-08-24 18:10:45
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/wolfpack Modified Files: utilities.py Log Message: - Replaced access to .events with the calls hasevent/addevent/removeevent in all relevant places. Notice that addevent() is expected to add the event to the head of the list. I recognized no situation (of those changed) where it would make a difference adding the event to the end of the list, so in those cases used addevent aswell. - Fixed a copy&paste error in trap.py on removing the tags (pointed out by Incannus). note: .events can now be made read only, bearing in mind that in doing so there is no way to make a distinction between adding an event at the top or at the end of the event list. Index: utilities.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/utilities.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** utilities.py 21 Jul 2004 14:20:42 -0000 1.63 --- utilities.py 24 Aug 2004 18:10:31 -0000 1.64 *************** *** 601,608 **** tocontainer( key, container ) container.settag( 'lock', rkeyid ) ! if not 'lock' in container.events: ! events = container.events ! events[:0] = ['lock'] ! container.events = events return --- 601,605 ---- tocontainer( key, container ) container.settag( 'lock', rkeyid ) ! container.addevent( 'lock' ) return |
From: Jorge P. <ke...@us...> - 2004-08-24 18:10:45
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28093/skills Modified Files: poisoning.py tasteid.py Log Message: - Replaced access to .events with the calls hasevent/addevent/removeevent in all relevant places. Notice that addevent() is expected to add the event to the head of the list. I recognized no situation (of those changed) where it would make a difference adding the event to the end of the list, so in those cases used addevent aswell. - Fixed a copy&paste error in trap.py on removing the tags (pointed out by Incannus). note: .events can now be made read only, bearing in mind that in doing so there is no way to make a distinction between adding an event at the top or at the end of the event list. Index: poisoning.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/poisoning.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** poisoning.py 16 Jul 2004 07:09:27 -0000 1.3 --- poisoning.py 24 Aug 2004 18:10:29 -0000 1.4 *************** *** 62,66 **** char.socket.clilocmessage( 502145 ) return ! if not ( 'food' in target.item.events or 'blades' in target.item.events ): char.socket.clilocmessage( 502145 ) return --- 62,66 ---- char.socket.clilocmessage( 502145 ) return ! if not ( target.item.hasevent( 'food' ) or target.item.hasevent( 'blades' ) ): char.socket.clilocmessage( 502145 ) return *************** *** 122,126 **** # weapon : poison chance when hit % = char.skill[ POISONING ] / 4 # number of uses before the poison wears off ! if 'blades' in item.events: item.settag( 'poisoning_uses', 20 - strength * 2 ) return 1 --- 122,126 ---- # weapon : poison chance when hit % = char.skill[ POISONING ] / 4 # number of uses before the poison wears off ! if item.hasevent( 'blades' ): item.settag( 'poisoning_uses', 20 - strength * 2 ) return 1 Index: tasteid.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/tasteid.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tasteid.py 16 Jul 2004 07:09:27 -0000 1.9 --- tasteid.py 24 Aug 2004 18:10:29 -0000 1.10 *************** *** 38,42 **** return ! if not 'food' in target.item.events: socket.clilocmessage(502820) else: --- 38,42 ---- return ! if not target.item.hasevent( 'food' ): socket.clilocmessage(502820) else: |