wpdev-commits Mailing List for Wolfpack Emu (Page 171)
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: <as...@us...> - 2004-01-22 05:53:55
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv17870 Modified Files: wolfpack.pro Log Message: fixed that ai-thingie ;) Index: wolfpack.pro =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v retrieving revision 1.168 retrieving revision 1.169 diff -C2 -d -r1.168 -r1.169 *** wolfpack.pro 22 Jan 2004 05:48:50 -0000 1.168 --- wolfpack.pro 22 Jan 2004 05:53:51 -0000 1.169 *************** *** 174,181 **** SOURCES = \ accounts.cpp \ - ai/ai.cpp \ - ai/ai_animals.cpp \ - ai/ai_humans.cpp \ - ai/ai_monsters.cpp \ basechar.cpp \ basedef.cpp \ --- 174,177 ---- *************** *** 253,256 **** --- 249,260 ---- network/uotxpackets.cpp + # AI Module + HEADERS += ai/ai.h + + SOURCES += ai/ai.cpp \ + ai/ai_animals.cpp \ + ai/ai_humans.cpp \ + ai/ai_monsters.cpp + # Python Module SOURCES += python/char.cpp \ |
|
From: <dr...@us...> - 2004-01-22 05:48:54
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv17209 Modified Files: wolfpack.pro Log Message: Updated for the ai file move. Index: wolfpack.pro =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v retrieving revision 1.167 retrieving revision 1.168 diff -C2 -d -r1.167 -r1.168 *** wolfpack.pro 18 Dec 2003 13:41:54 -0000 1.167 --- wolfpack.pro 22 Jan 2004 05:48:50 -0000 1.168 *************** *** 115,118 **** --- 115,119 ---- TmpEff.h \ Trade.h \ + ai/ai.h \ accounts.h \ basics.h \ *************** *** 173,180 **** SOURCES = \ accounts.cpp \ ! ai.cpp \ ! ai_animals.cpp \ ! ai_humans.cpp \ ! ai_monsters.cpp \ basechar.cpp \ basedef.cpp \ --- 174,181 ---- SOURCES = \ accounts.cpp \ ! ai/ai.cpp \ ! ai/ai_animals.cpp \ ! ai/ai_humans.cpp \ ! ai/ai_monsters.cpp \ basechar.cpp \ basedef.cpp \ |
|
From: <dr...@us...> - 2004-01-22 05:48:21
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv17091 Added Files: ore.py Log Message: I'll finish this when I get the chance, or someone can beat me to it :P Just wanted to add it so I don't forget. --- NEW FILE: ore.py --- # I'll work on this later, this will be for smelting ore into ingots. # This will need to be mining skill based, same ratio as mining # for success. - Dreoth import wolfpack def onUse( char, ore ): char.socket.sysmessage( 'Smelt Test' ) |
|
From: <thi...@us...> - 2004-01-22 04:52:58
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv8936 Modified Files: wpdefmanager.cpp Log Message: door generation command ( reference ) fixed some of the copyright notices minor improvements. Moving AI to it's own folder Index: wpdefmanager.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wpdefmanager.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** wpdefmanager.cpp 26 Nov 2003 03:53:53 -0000 1.73 --- wpdefmanager.cpp 22 Jan 2004 04:52:55 -0000 1.74 *************** *** 40,44 **** // Reloading ! #include "ai.h" #include "spawnregions.h" #include "territories.h" --- 40,44 ---- // Reloading ! #include "ai/ai.h" #include "spawnregions.h" #include "territories.h" |
|
From: <thi...@us...> - 2004-01-22 04:48:17
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv8134/python
Modified Files:
global.cpp pyaccount.cpp
Log Message:
door generation command ( reference )
fixed some of the copyright notices
minor improvements.
Moving AI to it's own folder
Index: global.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v
retrieving revision 1.98
retrieving revision 1.99
diff -C2 -d -r1.98 -r1.99
*** global.cpp 20 Jan 2004 00:52:12 -0000 1.98
--- global.cpp 22 Jan 2004 04:48:12 -0000 1.99
***************
*** 4,8 ****
// UO Server Emulation Program
//
! // Copyright 2001-2003 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
--- 4,8 ----
// UO Server Emulation Program
//
! // Copyright 2001-2004 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
***************
*** 1238,1243 ****
{
QString name = it.key();
! if( name != QString::null )
! PyList_Append( list, PyString_FromString( name.latin1() ) );
++it;
}
--- 1238,1243 ----
{
QString name = it.key();
! if( !name )
! PyList_Append( list, PyString_FromString( name ) );
++it;
}
***************
*** 1267,1279 ****
PyObject *dict = PyDict_New();
! QMap< QString, QMap< QString, bool > >::iterator git;
for( git = acl->groups.begin(); git != acl->groups.end(); ++git )
{
PyObject *dict2 = PyDict_New();
! for( QMap< QString, bool >::iterator it = (*git).begin(); it != (*git).end(); ++it )
! PyDict_SetItem( dict2, PyString_FromString( it.key().latin1() ), it.data() ? PyTrue : PyFalse );
! PyDict_SetItem( dict, PyString_FromString( git.key().latin1() ), dict2 );
}
--- 1267,1279 ----
PyObject *dict = PyDict_New();
! QMap< QString, QMap< QString, bool > >::const_iterator git;
for( git = acl->groups.begin(); git != acl->groups.end(); ++git )
{
PyObject *dict2 = PyDict_New();
! for( QMap< QString, bool >::const_iterator it = (*git).begin(); it != (*git).end(); ++it )
! PyDict_SetItem( dict2, PyString_FromString( it.key() ), it.data() ? PyTrue : PyFalse );
! PyDict_SetItem( dict, PyString_FromString( git.key() ), dict2 );
}
Index: pyaccount.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyaccount.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** pyaccount.cpp 22 Jan 2004 03:58:58 -0000 1.19
--- pyaccount.cpp 22 Jan 2004 04:48:13 -0000 1.20
***************
*** 164,169 ****
}
! QString group = getArgStr( 0 );
! QString action = getArgStr( 1 );
if( self->account->authorized( group, action ) )
--- 164,169 ----
}
! QCString group = getArgStr( 0 );
! QCString action = getArgStr( 1 );
if( self->account->authorized( group, action ) )
|
|
From: <thi...@us...> - 2004-01-22 04:48:17
|
Update of /cvsroot/wpdev/wolfpack/ai In directory sc8-pr-cvs1:/tmp/cvs-serv8134/ai Added Files: ai.cpp ai.h ai_animals.cpp ai_humans.cpp ai_monsters.cpp Log Message: door generation command ( reference ) fixed some of the copyright notices minor improvements. Moving AI to it's own folder --- NEW FILE: ai.cpp --- //================================================================================== // // Wolfpack Emu (WP) // UO Server Emulation Program // // Copyright 2001-2003 by holders identified in authors.txt // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. // // * In addition to that license, if you are running this program or modified // * versions of it on a public system you HAVE TO make the complete source of // * the version used by you available or provide people with a location to // * download it. // // // // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== #include "python/utilities.h" #include "ai.h" #include "npc.h" #include "sectors.h" #include "player.h" #include "srvparams.h" #include "globals.h" #include "basics.h" #include "walking.h" #include "itemid.h" #include "items.h" #include "console.h" #include "world.h" // library includes #include <math.h> #include <vector> void cAIFactory::checkScriptAI( const QStringList &oldSections, const QStringList &newSections ) { QStringList::const_iterator aiit = oldSections.begin(); while( aiit != oldSections.end() ) { // We must reset all existing and scripted AI objects, so changes can take effect. if( !newSections.contains( *aiit ) ) { cCharIterator iter; for( P_CHAR pChar = iter.first(); pChar; pChar = iter.next() ) { P_NPC pNPC = dynamic_cast< P_NPC >(pChar); if( pNPC ) { ScriptAI* ai = dynamic_cast< ScriptAI* >(pNPC->ai()); if( ai && ai->name() == (*aiit) ) { pNPC->setAI( *aiit ); } } } } else { cCharIterator iter; for( P_CHAR pChar = iter.first(); pChar; pChar = iter.next() ) { P_NPC pNPC = dynamic_cast< P_NPC >(pChar); if( pNPC ) { ScriptAI* ai = dynamic_cast< ScriptAI* >(pNPC->ai()); if( ai && ai->name() == (*aiit) ) { delete ai; pNPC->setAI( NULL ); } } } unregisterType( *aiit ); } ++aiit; } aiit = newSections.begin(); while( aiit != newSections.end() ) { if( !oldSections.contains( *aiit ) ) { ScriptAI::registerInFactory( *aiit ); } ++aiit; } } struct stActionNode { stActionNode( float fz, AbstractAction* ac ) : fuzzy( fz ), action( ac ) {} float fuzzy; AbstractAction* action; }; struct ActionNodeComparePredicate : public std::binary_function<stActionNode, stActionNode, bool> { bool operator()(const stActionNode &a, const stActionNode &b) { return a.fuzzy > b.fuzzy; } }; void AbstractAI::check() { // If we have no current action or our action cant be executed, we must get a new one if( !m_currentAction || ( m_currentAction && m_currentAction->preCondition() <= 0.0f ) ) { std::vector< stActionNode > actions; std::vector< stActionNode >::iterator it; AbstractAction* action = NULL; for( action = m_actions.first(); action; action = m_actions.next() ) { actions.push_back( stActionNode( action->preCondition(), action ) ); } std::sort( actions.begin(), actions.end(), ActionNodeComparePredicate() ); it = actions.begin(); while( it != actions.end() && !m_currentAction ) { if( (*it).fuzzy > 0.0f ) m_currentAction = (*it).action; ++it; } } // Now we should have a current action set, else do nothing! if( m_currentAction ) { m_currentAction->execute(); // We must check the postcondition now and set the current action to NULL // if the action is finished (when it returns >= 1.0f)! float rnd = RandomNum( 0, 1000 ) / 1000.0f; if( m_currentAction->postCondition() >= rnd ) m_currentAction = NULL; } } static AbstractAI* productCreator_SCP() { return new ScriptAI( NULL ); } void ScriptAI::registerInFactory( const QString &name ) { AIFactory::instance()->registerType(name, productCreator_SCP); } void ScriptAI::processNode( const cElement *Tag ) { QString TagName = Tag->name(); // <action precondition="scriptfunction" postcondition="scriptfunction" execute="scriptfunction" onspeech="scriptfunction" /> if( TagName == "action" ) { if( Tag->hasAttribute( "precondition" ) && Tag->hasAttribute( "postcondition" ) && Tag->hasAttribute( "execute" ) ) { ScriptAction* action = new ScriptAction( m_npc, this ); action->setPreCondFunction( Tag->getAttribute( "precondition" ) ); action->setPostCondFunction( Tag->getAttribute( "postcondition" ) ); action->setExecuteFunction( Tag->getAttribute( "execute" ) ); m_actions.append( action ); } else Console::instance()->send( "Action tag in ai definition must contain attributes for pre-,postcondition and execute at least\n" ); } else if( TagName == "onspeech" ) { setOnSpeechFunction( Tag->getValue() ); } } void ScriptAI::init( P_NPC npc ) { const cElement* node = DefManager->getDefinition( WPDT_AI, m_name ); if( node ) applyDefinition( node ); AbstractAI::init( npc ); } void ScriptAI::onSpeechInput( P_PLAYER pTalker, const QString &comm ) { if( !onspeech.isNull() ) { // Try to call the python function // Get everything before the last dot if( onspeech.contains( "." ) ) { // Find the last dot INT32 position = onspeech.findRev( "." ); QString sModule = onspeech.left( position ); QString sFunction = onspeech.right( onspeech.length() - (position+1) ); PyObject *pModule = PyImport_ImportModule( const_cast< char* >( sModule.latin1() ) ); if( pModule ) { PyObject *pFunc = PyObject_GetAttrString( pModule, const_cast< char* >( sFunction.latin1() ) ); if( pFunc && PyCallable_Check( pFunc ) ) { // Create our Argument list PyObject *p_args = PyTuple_New( 3 ); PyTuple_SetItem( p_args, 0, PyGetCharObject( m_npc ) ); PyTuple_SetItem( p_args, 1, PyGetCharObject( pTalker ) ); PyTuple_SetItem( p_args, 2, PyString_FromString( comm.latin1() ) ); Py_XDECREF( PyEval_CallObject( pFunc, p_args ) ); Py_XDECREF( p_args ); reportPythonError( sModule ); } Py_XDECREF( pFunc ); } Py_XDECREF( pModule ); } } } float ScriptAction::preCondition() { if( !precond.isNull() ) { // Try to call the python function // Get everything before the last dot if( precond.contains( "." ) ) { // Find the last dot INT32 position = precond.findRev( "." ); QString sModule = precond.left( position ); QString sFunction = precond.right( precond.length() - (position+1) ); PyObject *pModule = PyImport_ImportModule( const_cast< char* >( sModule.latin1() ) ); if( pModule ) { PyObject *pFunc = PyObject_GetAttrString( pModule, const_cast< char* >( sFunction.latin1() ) ); if( pFunc && PyCallable_Check( pFunc ) ) { // Create our Argument list PyObject *p_args = PyTuple_New( 3 ); PyTuple_SetItem( p_args, 0, PyGetCharObject( m_npc ) ); PyTuple_SetItem( p_args, 1, Py_None ); PyTuple_SetItem( p_args, 2, Py_None ); PyObject *returnValue = PyObject_CallObject( pFunc, p_args ); Py_XDECREF( p_args ); reportPythonError( sModule ); if( returnValue == NULL || !PyFloat_Check( returnValue ) ) { Py_XDECREF( returnValue ); return 1.0f; } else { double result = PyFloat_AsDouble( returnValue ); Py_XDECREF( returnValue ); return result; } } Py_XDECREF( pFunc ); } Py_XDECREF( pModule ); } } return 0.0f; } float ScriptAction::postCondition() { if( !postcond.isNull() ) { // Try to call the python function // Get everything before the last dot if( postcond.contains( "." ) ) { // Find the last dot INT32 position = postcond.findRev( "." ); QString sModule = postcond.left( position ); QString sFunction = postcond.right( postcond.length() - (position+1) ); PyObject *pModule = PyImport_ImportModule( const_cast< char* >( sModule.latin1() ) ); if( pModule ) { PyObject *pFunc = PyObject_GetAttrString( pModule, const_cast< char* >( sFunction.latin1() ) ); if( pFunc && PyCallable_Check( pFunc ) ) { // Create our Argument list PyObject *p_args = PyTuple_New( 3 ); PyTuple_SetItem( p_args, 0, PyGetCharObject( m_npc ) ); PyTuple_SetItem( p_args, 1, Py_None ); PyTuple_SetItem( p_args, 2, Py_None ); PyObject *returnValue = PyObject_CallObject( pFunc, p_args ); Py_XDECREF( p_args ); reportPythonError( sModule ); if( returnValue == NULL || !PyFloat_Check( returnValue ) ) { Py_XDECREF( returnValue ); return 1.0f; } else { double result = PyFloat_AsDouble( returnValue ); Py_XDECREF( returnValue ); return result; } } Py_XDECREF( pFunc ); } Py_XDECREF( pModule ); } } return 1.0f; } void ScriptAction::execute() { if( !exec.isNull() ) { // Try to call the python function // Get everything before the last dot if( exec.contains( "." ) ) { // Find the last dot INT32 position = exec.findRev( "." ); QString sModule = exec.left( position ); QString sFunction = exec.right( exec.length() - (position+1) ); PyObject *pModule = PyImport_ImportModule( const_cast< char* >( sModule.latin1() ) ); if( pModule ) { PyObject *pFunc = PyObject_GetAttrString( pModule, const_cast< char* >( sFunction.latin1() ) ); if( pFunc && PyCallable_Check( pFunc ) ) { // Create our Argument list PyObject *p_args = PyTuple_New( 3 ); PyTuple_SetItem( p_args, 0, PyGetCharObject( m_npc ) ); PyTuple_SetItem( p_args, 1, Py_None ); PyTuple_SetItem( p_args, 2, Py_None ); Py_XDECREF( PyEval_CallObject( pFunc, p_args ) ); Py_XDECREF( p_args ); reportPythonError( sModule ); } Py_XDECREF( pFunc ); } Py_XDECREF( pModule ); } } } float Action_Wander::preCondition() { /* * Wandering has the following preconditions: * - There is no character attacking us. * - The wander type is not enHalt. * - We are wandering towards a destination and aren't there yet. * - We are following a char and aren't in follow range yet. */ if( m_npc->attackerSerial() != INVALID_SERIAL ) return 0.0f; if( m_npc->wanderType() == enHalt ) return 0.0f; if( m_npc->wanderType() == enDestination && m_npc->wanderDestination() == m_npc->pos() ) return 0.0f; if( m_npc->wanderType() == enFollowTarget && !m_npc->inRange( m_npc->wanderFollowTarget(), SrvParams->pathfindFollowRadius() ) ) return 0.0f; return 1.0f; } float Action_Wander::postCondition() { /* * Wandering has the following postconditions: * - The NPC is wandering freely/in a circle/in a rectangle, * then we can abort after each step! * - The NPC has reached its destination. * - The NPC is within follow range. */ switch( m_npc->wanderType() ) { case enFreely: case enCircle: case enRectangle: return 1.0f; case enDestination: if( m_npc->wanderDestination() == m_npc->pos() ) return 1.0f; break; case enFollowTarget: if( m_npc->inRange( m_npc->wanderFollowTarget(), SrvParams->pathfindFollowRadius() ) ) return 1.0f; break; }; return 0.0f; } void Action_Wander::execute() { if( m_npc->isAtWar() ) m_npc->toggleCombat(); switch( m_npc->wanderType() ) { case enFreely: { UINT8 dir = m_npc->direction(); if( RandomNum(0, 100) < 20 ) dir = RandomNum( 0, 7 ); m_npc->setDirection( dir ); Movement::instance()->Walking( m_npc, dir, 0xFF ); break; } case enRectangle: { // get any point out of the rectangle and calculate the direction to it UINT16 rndx = RandomNum( m_npc->wanderX1(), m_npc->wanderX2() ); UINT16 rndy = RandomNum( m_npc->wanderY1(), m_npc->wanderY2() ); UINT8 dir = m_npc->pos().direction( Coord_cl( rndx, rndy ) ); m_npc->setDirection( dir ); Movement::instance()->Walking( m_npc, dir, 0xFF ); break; } case enCircle: { Coord_cl pos = m_npc->pos(); pos.x = m_npc->wanderX1(); pos.y = m_npc->wanderY1(); // get any point within the circle and calculate the direction to it // first a random distance which can be max. the length of the radius float rnddist = (float)RandomNum( 1, m_npc->wanderRadius() ); // now get a point on this circle around the m_npc float rndphi = (float)RandomNum( 0, 100 ) / 100.0f * 2.0f * 3.14159265358979323846f; pos.x = pos.x + (INT16)floor( cos( rndphi ) * rnddist ); pos.y = pos.y + (INT16)floor( sin( rndphi ) * rnddist ); UINT8 dir = m_npc->pos().direction( pos ); m_npc->setDirection( dir ); Movement::instance()->Walking( m_npc, dir, 0xFF ); break; } case enFollowTarget: { if( SrvParams->pathfind4Follow() ) { P_CHAR pTarget = m_npc->wanderFollowTarget(); if( pTarget ) { movePath( pTarget->pos() ); } if( pTarget->dist( m_npc ) > 3 ) m_npc->setAICheckTime( uiCurrentTime + (float)m_npc->aiCheckInterval() * 0.0005f * MY_CLOCKS_PER_SEC ); } else { P_CHAR pTarget = m_npc->wanderFollowTarget(); if( pTarget ) { moveTo( pTarget->pos() ); } } break; } case enDestination: { movePath( m_npc->wanderDestination() ); break; } } } void Action_Wander::moveTo( const Coord_cl &pos ) { // simply move towards the target UINT8 dir = m_npc->pos().direction( pos ); Coord_cl newPos = Movement::instance()->calcCoordFromDir( dir, m_npc->pos() ); if( !mayWalk( m_npc, newPos ) ) { if( dir == 7 ) dir = 0; else dir++; newPos = Movement::instance()->calcCoordFromDir( dir, m_npc->pos() ); if( !mayWalk( m_npc, newPos ) ) { if( dir == 0 ) dir = 6; else if( dir == 1 ) dir = 7; else dir = dir - 2; newPos = Movement::instance()->calcCoordFromDir( dir, m_npc->pos() ); if( !mayWalk( m_npc, newPos ) ) { return; } } } m_npc->setDirection( dir ); Movement::instance()->Walking( m_npc, dir, 0xFF ); } void Action_Wander::movePath( const Coord_cl &pos ) { if( ( waitForPathCalculation <= 0 && !m_npc->hasPath() ) || pos != m_npc->pathDestination() ) { UINT8 range = 1; if( m_npc->rightHandItem() && IsBowType( m_npc->rightHandItem()->id() ) ) range = ARCHERY_RANGE; m_npc->findPath( pos, range == 1 ? 1.5f : (float)range ); // dont return here! } else if( !m_npc->hasPath() ) { waitForPathCalculation--; moveTo( pos ); return; } if( m_npc->hasPath() ) { waitForPathCalculation = 0; Coord_cl nextmove = m_npc->nextMove(); UINT8 dir = m_npc->pos().direction( nextmove ); m_npc->setDirection( dir ); Movement::instance()->Walking( m_npc, dir, 0xFF ); m_npc->popMove(); return; } else { waitForPathCalculation = 3; moveTo( pos ); return; } } void Action_Flee::execute() { if( !m_npc->hasPath() ) { Coord_cl newPos = m_npc->pos(); Coord_cl fleePos = pFleeFrom->pos(); // find a valid spot in a circle of flee_radius fields to move to float rnddist = (float)RandomNum( 1, SrvParams->pathfindFleeRadius() ); if( newPos != fleePos ) { int v1 = newPos.x - fleePos.x; int v2 = newPos.y - fleePos.y; float v_norm = sqrt( (double)( v1 * v1 + v2 * v2 ) ); newPos.x = newPos.x + (INT16)floor( rnddist * v1 / v_norm ); newPos.y = newPos.y + (INT16)floor( rnddist * v2 / v_norm ); } else { float rndphi = (float)RandomNum( 0, 100 ) / 100.0f * 2 * 3.14; newPos.x = newPos.x + (INT16)floor( sin( rndphi ) * rnddist ); newPos.y = newPos.y + (INT16)floor( cos( rndphi) * rnddist ); } // we use pathfinding for fleeing movePath( newPos ); } else movePath( m_npc->pathDestination() ); } float Action_FleeAttacker::preCondition() { /* * Fleeing from an attacker has the following preconditions: * - There is a character attacking us. * - The attacking character has not died. * - The attacking character is within flee range. * - The hitpoints are below the critical value. * * Fuzzy: The nearer we get to the critical health, the chance * increases to flee. */ P_CHAR pAttacker = World::instance()->findChar( m_npc->attackerSerial() ); if( !pAttacker || pAttacker->isDead() || !m_npc->inRange( pAttacker, SrvParams->pathfindFleeRadius() ) ) return 0.0f; if( m_npc->hitpoints() < m_npc->criticalHealth() ) return 0.0f; pFleeFrom = pAttacker; float healthmod = (float)(m_npc->maxHitpoints() - m_npc->hitpoints()) / (float)(m_npc->maxHitpoints() - m_npc->criticalHealth()); return healthmod; } float Action_FleeAttacker::postCondition() { /* * Fleeing from an attacker has the following postconditions: * - The character isn't attacking us anymore. * - The attacker has died. * - The attacker is not within flee range. * - The hitpoints are restored. * * Fuzzy: The farer we are from the critical health line, * the higher is the chance to end the flee action. */ P_CHAR pAttacker = World::instance()->findChar( m_npc->attackerSerial() ); if( !pAttacker || pAttacker->isDead() || !m_npc->inRange( pAttacker, SrvParams->pathfindFleeRadius() ) ) return 1.0f; float healthmod = (float)(m_npc->hitpoints() - m_npc->criticalHealth()) / (float)(m_npc->maxHitpoints() - m_npc->criticalHealth()); return healthmod; } float Action_Defend::preCondition() { /* * Defending has the following preconditions: * - There is a character attacking us. * - The attacking character has not died. * - The attacking character is within combat range. * - The hitpoints are above the critical value. * * Fuzzy: The nearer we get to the critical health, the chance * increases to flee. */ P_CHAR pAttacker = World::instance()->findChar( m_npc->attackerSerial() ); if( !pAttacker || pAttacker->isDead() ) return 0.0f; if( m_npc->hitpoints() < m_npc->criticalHealth() ) return 0.0f; UINT8 range = 1; if( m_npc->rightHandItem() && IsBowType( m_npc->rightHandItem()->id() ) ) range = ARCHERY_RANGE; if( !m_npc->inRange( pAttacker, range ) ) return 0.0f; float healthmod = (float)m_npc->hitpoints() / ((float)m_npc->criticalHealth()/100.0f * (float)m_npc->maxHitpoints()); return healthmod; } float Action_Defend::postCondition() { /* * Defending has the following postconditions: * - The character isn't attacking us anymore. * - The attacker has died. * - The attacker is not within combat range. * - Health is critical. * * Fuzzy: The nearer we get to the critical health line, * the higher is the chance to end the defend action. */ P_CHAR pAttacker = World::instance()->findChar( m_npc->attackerSerial() ); if( !pAttacker || pAttacker->isDead() ) return 1.0f; UINT8 range = 1; if( m_npc->rightHandItem() && IsBowType( m_npc->rightHandItem()->id() ) ) range = ARCHERY_RANGE; if( !m_npc->inRange( pAttacker, range ) ) return 1.0f; float healthmod = (float)(m_npc->maxHitpoints() - m_npc->hitpoints()) / (float)(m_npc->maxHitpoints() - ((float)m_npc->criticalHealth()/100.0f * (float)m_npc->maxHitpoints())); return healthmod; } void Action_Defend::execute() { // combat is handled somewhere else } --- NEW FILE: ai.h --- //================================================================================== // // Wolfpack Emu (WP) // UO Server Emulation Program // // Copyright 2001-2004 by holders identified in authors.txt // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. // // * In addition to that license, if you are running this program or modified // * versions of it on a public system you HAVE TO make the complete source of // * the version used by you available or provide people with a location to // * download it. // // // // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== #ifndef AI_H_HEADER_INCLUDED #define AI_H_HEADER_INCLUDED // platform includes #include "../platform.h" // wolfpack includes #include "../factory.h" #include "../definable.h" #include "../singleton.h" #include "../typedefs.h" // library includes #include <qptrlist.h> #include <qstring.h> #include <qstringlist.h> // forward declarations class Coord_cl; class AbstractAI; class AbstractAction { protected: AbstractAction() : m_npc( NULL ),m_ai( NULL ) {} public: AbstractAction( P_NPC npc, AbstractAI* ai ) : m_npc( npc ), m_ai( ai ) {} ~AbstractAction() {} // executes the action virtual void execute() = 0; /* preCondition * * @return A value between 0 and 1 which indicates the * propability of the action to be executed successfully. * (So the method will return 0 if the action cannot be executed) * This gives us the possibility of fuzzy logic. */ virtual float preCondition() = 0; /* postCondition * * @return A value between 0 and 1 which indicates the * propability that this action will lead to a result * in proper time. * (So the method will return 1 if the action is finished) * This gives us the possibility of fuzzy logic. */ virtual float postCondition() = 0; P_NPC npc() const { return m_npc; } void setNPC( P_NPC npc ) { m_npc = npc; } protected: P_NPC m_npc; AbstractAI* m_ai; }; class AbstractAI { protected: AbstractAI() : m_npc( NULL ), m_currentAction( NULL ), notorityOverride_( 0 ) { m_actions.setAutoDelete( true ); } public: AbstractAI( P_NPC npc ) : m_npc( npc ), m_currentAction( NULL ), notorityOverride_( 0 ) { m_actions.setAutoDelete( true ); } virtual ~AbstractAI() {} // virtual destructor. // some events that can be triggered from outside virtual void onSpeechInput( P_PLAYER pTalker, const QString &comm ) { Q_UNUSED(pTalker); Q_UNUSED(comm); } // this method is called, when the npc ai should be checked virtual void check(); virtual QString name() = 0; P_NPC npc() const { return m_npc; } void setNPC( P_NPC npc ) { m_npc = npc; } unsigned char notorityOverride() const { return notorityOverride_; } void setNotorityOverride( unsigned char value ) { notorityOverride_ = value; } // This is for creating AI interfaces through the AIFactory virtual void init( P_NPC npc ) { m_npc = npc; AbstractAction* action = NULL; for( action = m_actions.first(); action ; action = m_actions.next() ) { action->setNPC( npc ); } } protected: P_NPC m_npc; AbstractAction* m_currentAction; QPtrList< AbstractAction > m_actions; unsigned char notorityOverride_; }; class cAIFactory : public Factory< AbstractAI, QString > { public: void checkScriptAI( const QStringList &oldSections, const QStringList &newSections ); }; typedef SingletonHolder< cAIFactory > AIFactory; class Action_Wander : public AbstractAction { protected: Action_Wander() : AbstractAction(), waitForPathCalculation( 0 ) {} public: Action_Wander( P_NPC npc, AbstractAI* ai ) : AbstractAction( npc, ai ), waitForPathCalculation( 0 ) {} virtual void execute(); virtual float preCondition(); virtual float postCondition(); protected: void moveTo( const Coord_cl& pos ); void movePath( const Coord_cl& pos ); int waitForPathCalculation; }; class Action_Flee : public Action_Wander { protected: Action_Flee() : Action_Wander(), pFleeFrom( NULL ) {} public: Action_Flee( P_NPC npc, AbstractAI* ai ) : Action_Wander( npc, ai ), pFleeFrom( NULL ) {} virtual void execute(); protected: P_CHAR pFleeFrom; }; class Action_FleeAttacker : public Action_Flee { protected: Action_FleeAttacker() : Action_Flee() {} public: Action_FleeAttacker( P_NPC npc, AbstractAI* ai ) : Action_Flee( npc, ai ) {} virtual float preCondition(); virtual float postCondition(); }; class Action_Defend : public AbstractAction { protected: Action_Defend() : AbstractAction() {} public: Action_Defend( P_NPC npc, AbstractAI* ai ) : AbstractAction( npc, ai ) {} virtual void execute(); virtual float preCondition(); virtual float postCondition(); }; class Monster_Aggr_Wander : public Action_Wander { protected: Monster_Aggr_Wander() : Action_Wander() {} public: Monster_Aggr_Wander( P_NPC npc, AbstractAI* ai ) : Action_Wander( npc, ai ) {} virtual float preCondition(); }; class Monster_Aggr_MoveToTarget : public Action_Wander { protected: Monster_Aggr_MoveToTarget() : Action_Wander() {} public: Monster_Aggr_MoveToTarget( P_NPC npc, AbstractAI* ai ) : Action_Wander( npc, ai ) {} virtual void execute(); virtual float preCondition(); virtual float postCondition(); }; class Monster_Aggr_Fight : public AbstractAction { protected: Monster_Aggr_Fight() : AbstractAction() {} public: Monster_Aggr_Fight( P_NPC npc, AbstractAI* ai ) : AbstractAction( npc, ai ) {} virtual void execute(); virtual float preCondition(); virtual float postCondition(); }; class Monster_Aggressive : public AbstractAI { protected: Monster_Aggressive() : AbstractAI(), m_currentVictim( NULL ) { notorityOverride_ = 6; } public: Monster_Aggressive( P_NPC npc ) : AbstractAI( npc ), m_currentVictim( NULL ) { notorityOverride_ = 6; } virtual void check(); P_CHAR currentVictim() const { return m_currentVictim; } protected: virtual void selectVictim() = 0; P_CHAR m_currentVictim; }; class Monster_Aggressive_L0 : public Monster_Aggressive { protected: Monster_Aggressive_L0() : Monster_Aggressive() {} public: Monster_Aggressive_L0( P_NPC npc ) : Monster_Aggressive( npc ) { m_actions.append( new Monster_Aggr_Wander( npc, this ) ); m_actions.append( new Monster_Aggr_MoveToTarget( npc, this ) ); m_actions.append( new Monster_Aggr_Fight( npc, this ) ); } static void registerInFactory(); virtual QString name() { return "Monster_Aggressive_L0"; } protected: virtual void selectVictim(); }; class Monster_Aggressive_L1 : public Monster_Aggressive { protected: Monster_Aggressive_L1() : Monster_Aggressive() {} public: Monster_Aggressive_L1( P_NPC npc ) : Monster_Aggressive( npc ) { m_actions.append( new Monster_Aggr_Wander( npc, this ) ); m_actions.append( new Action_FleeAttacker( npc, this ) ); m_actions.append( new Monster_Aggr_MoveToTarget( npc, this ) ); m_actions.append( new Monster_Aggr_Fight( npc, this ) ); } static void registerInFactory(); virtual QString name() { return "Monster_Aggressive_L1"; } protected: virtual void selectVictim(); }; class Human_Vendor : public AbstractAI { protected: Human_Vendor() : AbstractAI() { notorityOverride_ = 1; } public: Human_Vendor( P_NPC npc ) : AbstractAI( npc ) { notorityOverride_ = 1; m_actions.append( new Action_Wander( npc, this ) ); m_actions.append( new Action_FleeAttacker( npc, this ) ); } virtual void onSpeechInput( P_PLAYER pTalker, const QString &comm ); static void registerInFactory(); virtual QString name() { return "Human_Vendor"; } }; class cUORxTarget; class Human_Stablemaster : public AbstractAI { protected: Human_Stablemaster() : AbstractAI() { notorityOverride_ = 1; } public: Human_Stablemaster( P_NPC npc ); virtual void init( P_NPC npc ); virtual void onSpeechInput( P_PLAYER pTalker, const QString &comm ); static void registerInFactory(); virtual QString name() { return "Human_Stablemaster"; } void refreshStock(); void handleTargetInput( P_PLAYER player, cUORxTarget* target ); }; class Animal_Wild_Flee : public Action_Flee { protected: Animal_Wild_Flee() : Action_Flee() {} public: Animal_Wild_Flee( P_NPC npc, AbstractAI* ai ) : Action_Flee( npc, ai ) {} virtual float preCondition(); virtual float postCondition(); }; class AnimalAI : public AbstractAI { protected: AnimalAI() : AbstractAI() {} public: AnimalAI( P_NPC npc ) : AbstractAI( npc ) {} virtual void onSpeechInput( P_PLAYER pTalker, const QString &comm ); }; class Animal_Wild : public AnimalAI { protected: Animal_Wild() : AnimalAI() {} public: Animal_Wild( P_NPC npc ) : AnimalAI( npc ) { m_actions.append( new Action_Wander( npc, this ) ); m_actions.append( new Action_FleeAttacker( npc, this ) ); m_actions.append( new Action_Defend( npc, this ) ); m_actions.append( new Animal_Wild_Flee( npc, this ) ); } static void registerInFactory(); virtual QString name() { return "Animal_Wild"; } }; class Animal_Domestic : public AnimalAI { protected: Animal_Domestic() : AnimalAI() {} public: Animal_Domestic( P_NPC npc ) : AnimalAI( npc ) { m_actions.append( new Action_Wander( npc, this ) ); m_actions.append( new Action_FleeAttacker( npc, this ) ); m_actions.append( new Action_Defend( npc, this ) ); } static void registerInFactory(); virtual QString name() { return "Animal_Domestic"; } }; class ScriptAction : public AbstractAction { protected: ScriptAction() : AbstractAction(), exec( (char*)0 ), precond( (char*)0 ), postcond( (char*)0 ) {} public: ScriptAction( P_NPC npc, AbstractAI* ai ) : AbstractAction( npc, ai ), exec( (char*)0 ), precond( (char*)0 ), postcond( (char*)0 ) {} virtual void execute(); virtual float preCondition(); virtual float postCondition(); void setExecuteFunction( const QString &data ) { exec = data; } void setPreCondFunction( const QString &data ) { precond = data; } void setPostCondFunction( const QString &data ) { postcond = data; } protected: QString exec; QString precond; QString postcond; }; class ScriptAI : public AbstractAI, public cDefinable { protected: ScriptAI() : AbstractAI(), onspeech( (char*)0 ) {} virtual void processNode( const cElement *Tag ); public: ScriptAI( P_NPC npc ) : AbstractAI( npc ), onspeech( (char*)0 ) {} static void registerInFactory( const QString &name ); virtual QString name() { return m_name; } void setName( const QString &d ) { m_name = d; } virtual void init( P_NPC npc ); virtual void onSpeechInput( P_PLAYER pTalker, const QString &comm ); void setOnSpeechFunction( const QString &data ) { onspeech = data; } protected: QString m_name; QString onspeech; }; class Human_Guard_Called_Fight : public AbstractAction { protected: Human_Guard_Called_Fight() : AbstractAction() {} public: Human_Guard_Called_Fight( P_NPC npc, AbstractAI* ai ) : AbstractAction( npc, ai ) {} virtual void execute(); virtual float preCondition(); virtual float postCondition(); }; class Human_Guard_Called_TeleToTarget : public AbstractAction { protected: Human_Guard_Called_TeleToTarget() : AbstractAction() {} public: Human_Guard_Called_TeleToTarget( P_NPC npc, AbstractAI* ai ) : AbstractAction( npc, ai ) {} virtual void execute(); virtual float preCondition(); virtual float postCondition(); }; class Human_Guard_Called_Disappear : public AbstractAction { protected: Human_Guard_Called_Disappear() : AbstractAction() {} public: Human_Guard_Called_Disappear( P_NPC npc, AbstractAI* ai ) : AbstractAction( npc, ai ) {} virtual void execute(); virtual float preCondition(); virtual float postCondition(); }; class cTerritory; class Human_Guard_Called : public AbstractAI { protected: Human_Guard_Called() : AbstractAI() { notorityOverride_ = 1; } cTerritory* region_; public: Human_Guard_Called( P_NPC npc ); virtual void init( P_NPC npc ); static void registerInFactory(); virtual QString name() { return "Human_Guard_Called"; } }; class Human_Guard_Wander : public Action_Wander { protected: Human_Guard_Wander() : Action_Wander() {} public: Human_Guard_Wander( P_NPC npc, AbstractAI* ai ) : Action_Wander( npc, ai ) {} virtual float preCondition(); virtual float postCondition(); }; class Human_Guard_MoveToTarget : public Action_Wander { protected: Human_Guard_MoveToTarget() : Action_Wander() {} public: Human_Guard_MoveToTarget( P_NPC npc, AbstractAI* ai ) : Action_Wander( npc, ai ) {} virtual void execute(); virtual float preCondition(); virtual float postCondition(); }; class Human_Guard_Fight : public AbstractAction { protected: Human_Guard_Fight() : AbstractAction() {} public: Human_Guard_Fight( P_NPC npc, AbstractAI* ai ) : AbstractAction( npc, ai ) {} virtual void execute(); virtual float preCondition(); virtual float postCondition(); }; class Human_Guard : public AbstractAI { protected: Human_Guard() : AbstractAI(), m_currentVictim( NULL ) { notorityOverride_ = 1; } public: Human_Guard( P_NPC npc ); static void registerInFactory(); virtual QString name() { return "Human_Guard"; } virtual void check(); P_CHAR currentVictim() const { return m_currentVictim; } protected: virtual void selectVictim(); P_CHAR m_currentVictim; }; #endif /* AI_H_HEADER_INCLUDED */ --- NEW FILE: ai_animals.cpp --- //================================================================================== // // Wolfpack Emu (WP) // UO Server Emulation Program // // Copyright 2001-2003 by holders identified in authors.txt // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. // // * In addition to that license, if you are running this program or modified // * versions of it on a public system you HAVE TO make the complete source of // * the version used by you available or provide people with a location to // * download it. // // // // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== #include "ai.h" #include "npc.h" #include "player.h" #include "srvparams.h" #include "globals.h" #include "sectors.h" #include "basics.h" #include "targetrequests.h" #include "chars.h" // library includes #include <math.h> static AbstractAI* productCreator_AW() { return new Animal_Wild( NULL ); } void Animal_Wild::registerInFactory() { AIFactory::instance()->registerType("Animal_Wild", productCreator_AW); } static AbstractAI* productCreator_AD() { return new Animal_Domestic( NULL ); } void Animal_Domestic::registerInFactory() { AIFactory::instance()->registerType("Animal_Domestic", productCreator_AD); } void AnimalAI::onSpeechInput( P_PLAYER pTalker, const QString &comm ) { if( m_npc->owner() != pTalker && !pTalker->isGM() ) return; // too far away to hear us if( pTalker->dist( m_npc ) > 7 ) return; if( comm.contains( " FOLLOW" ) ) { if( comm.contains( " ME" ) ) { m_npc->setWanderFollowTarget( pTalker ); m_npc->setWanderType( enFollowTarget ); m_npc->bark( cBaseChar::Bark_Attacking ); } else { pTalker->socket()->attachTarget( new cFollowTarget( m_npc ) ); // LEGACY: target( s, 0, 1, 0, 117, "Click on the target to follow." ); } } else if( ( comm.contains( " KILL" ) ) || ( comm.contains( " ATTACK" ) ) ) { if( m_npc->inGuardedArea() ) // Ripper..No pet attacking in town. { pTalker->message( tr( "You can't have pets attack in town!" ) ); } //pPlayer->setGuarded( false ); // >> LEGACY //addx[s]=pPet->serial(); //target(s, 0, 1, 0, 118, "Select the target to attack.");//AntiChrist } else if( ( comm.contains( " FETCH" ) ) || ( comm.contains( " GET" ) ) ) { //pPlayer->setGuarded(false); // >> LEGACY //addx[s]=pPet->serial(); //target(s, 0, 1, 0, 124, "Click on the object to fetch."); } else if( comm.contains( " COME" ) ) { //pPlayer->setGuarded( false ); // pPet->setWanderFollowTarget( pPlayer->serial() ); // pPet->setWanderType( enFollowTarget ); // m_npc->setNextMoveTime(); // pTalker->message( tr( "Your pet begins following you." ) ); } else if( comm.contains( " GUARD" ) ) { // LEGACY /*addx[s] = pPet->serial(); // the pet's serial addy[s] = 0; if( comm.find( " ME" ) != string::npos ) addy[s]=1; // indicates we already know whom to guard (for future use) // for now they still must click on themselves (Duke) target(s, 0, 1, 0, 120, "Click on the char to guard.");*/ } else if( ( comm.contains( " STOP" ) ) || ( comm.contains(" STAY") ) ) { m_npc->setCombatTarget( INVALID_SERIAL ); if (m_npc->isAtWar()) m_npc->toggleCombat(); m_npc->setWanderType( enHalt ); } else if( comm.contains( " TRANSFER" ) ) { //pPlayer->setGuarded( false ); // >> LEGACY /*addx[s]=pPet->serial(); target(s, 0, 1, 0, 119, "Select character to transfer your pet to.");*/ } else if( comm.contains( " RELEASE" ) ) { // Has it been summoned ? Let's dispel it if( m_npc->summonTime() > uiCurrentTime ) m_npc->setSummonTime( uiCurrentTime ); m_npc->setWanderType( enFreely ); m_npc->setOwner( NULL ); m_npc->setTamed( false ); m_npc->emote( tr( "%1 appears to have decided that it is better off without a master" ).arg( m_npc->name() ) ); if( SrvParams->tamedDisappear() ) { m_npc->soundEffect( 0x01FE ); cCharStuff::DeleteChar( m_npc ); } } } float Animal_Wild_Flee::preCondition() { /* * Fleeing from an approaching player has the following preconditions: * - There is a player within flight range. * - There is no character attacking us. * - Our owner is not in range. * */ if( m_npc->attackerSerial() != INVALID_SERIAL ) return 0.0f; RegionIterator4Chars ri( m_npc->pos(), SrvParams->animalWildFleeRange() ); for(ri.Begin(); !ri.atEnd(); ri++) { P_PLAYER pPlayer = dynamic_cast<P_PLAYER>(ri.GetData()); if( pPlayer && !pPlayer->free && !pPlayer->isGMorCounselor() && !pPlayer->isHidden() && !pPlayer->isInvisible() ) { pFleeFrom = pPlayer; } if( pPlayer && m_npc->owner() == pPlayer ) return 0.0f; } if( pFleeFrom ) return 1.0f; return 0.0f; } float Animal_Wild_Flee::postCondition() { /* * Fleeing from an approaching player has the following postconditions: * - There is no character in flight range. * - There is an character attacking us. * - Our owner has come in range. * */ if( m_npc->attackerSerial() != INVALID_SERIAL ) return 1.0f; RegionIterator4Chars ri( m_npc->pos(), SrvParams->animalWildFleeRange() ); bool found = false; for(ri.Begin(); !ri.atEnd(); ri++) { P_PLAYER pPlayer = dynamic_cast<P_PLAYER>(ri.GetData()); if( pPlayer && !pPlayer->free && !pPlayer->isGMorCounselor() && !pPlayer->isHidden() && !pPlayer->isInvisible() ) found = true; if( pPlayer && m_npc->owner() == pPlayer ) return 1.0f; } if( found ) return 0.0f; return 1.0f; } --- NEW FILE: ai_humans.cpp --- //================================================================================== // // Wolfpack Emu (WP) // UO Server Emulation Program // // Copyright 2001-2003 by holders identified in authors.txt // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. // // * In addition to that license, if you are running this program or modified // * versions of it on a public system you HAVE TO make the complete source of // * the version used by you available or provide people with a location to // * download it. // // // // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== #include "ai.h" #include "npc.h" #include "player.h" #include "network/uosocket.h" #include "speech.h" #include "targetrequests.h" #include "TmpEff.h" #include "srvparams.h" #include "globals.h" #include "sectors.h" #include "world.h" #include "basics.h" // library includes #include <math.h> static AbstractAI* productCreator_HV() { return new Human_Vendor( NULL ); } void Human_Vendor::registerInFactory() { AIFactory::instance()->registerType("Human_Vendor", productCreator_HV); } void Human_Vendor::onSpeechInput( P_PLAYER pTalker, const QString &comm ) { if( !pTalker->socket() ) return; if( m_npc->inRange( pTalker, 4 ) && VendorChkName( m_npc, comm ) ) { if( comm.contains( tr(" BUY") ) ) { P_ITEM pContA = m_npc->GetItemOnLayer( cBaseChar::BuyRestockContainer ); P_ITEM pContB = m_npc->GetItemOnLayer( cBaseChar::BuyNoRestockContainer ); m_npc->turnTo( pTalker ); if( !pContA && !pContB ) { m_npc->talk( tr( "Sorry but i have no goods to sell" ) ); return; } m_npc->talk( tr( "Take a look at my wares!" ) ); pTalker->socket()->sendBuyWindow( m_npc ); } else if( comm.contains( tr(" SELL") ) ) { P_ITEM pContC = m_npc->GetItemOnLayer( cBaseChar::SellContainer ); m_npc->turnTo( pTalker ); if( !pContC ) { m_npc->talk( tr( "Sorry, I cannot use any of your wares!" ) ); return; } m_npc->talk( tr( "This could be of interest!" ) ); pTalker->socket()->sendSellWindow( m_npc, pTalker ); } } } Human_Stablemaster::Human_Stablemaster( P_NPC npc ) : AbstractAI( npc ) { notorityOverride_ = 1; m_actions.append( new Action_Wander( npc, this ) ); m_actions.append( new Action_FleeAttacker( npc, this ) ); } void Human_Stablemaster::init( P_NPC npc ) { AbstractAI::init( npc ); } static AbstractAI* productCreator_HS() { return new Human_Stablemaster( NULL ); } void Human_Stablemaster::registerInFactory() { AIFactory::instance()->registerType("Human_Stablemaster", productCreator_HS); } void Human_Stablemaster::onSpeechInput( P_PLAYER pTalker, const QString &message ) { if( !pTalker->socket() ) return; if( m_npc->inRange( pTalker, 4 ) && ( VendorChkName( m_npc, message ) || message.contains( tr("STABLEMASTER") ) ) ) { if( message.contains( tr(" STABLE") ) ) { m_npc->talk( tr("Which pet do you want me to stable?") ); pTalker->socket()->attachTarget( new cStableTarget( m_npc ) ); } else if( message.contains( tr(" RELEASE") ) ) { int gold = pTalker->CountBankGold() + pTalker->CountGold(); P_ITEM pPack = m_npc->getBackpack(); cItem::ContainerContent stableitems; if( pPack ) { cItem::ContainerContent content = pPack->content(); cItem::ContainerContent::const_iterator it( content.begin() ); while( it != content.end() ) { if( !(*it)->hasTag( "player" ) || !(*it)->hasTag( "pet" ) ) continue; if( (*it) && (*it)->id() == 0x1ea7 && (*it)->getTag( "player" ).toInt() == pTalker->serial() ) stableitems.push_back( (*it) ); ++it; } } if( !stableitems.empty() ) { cItem::ContainerContent::const_iterator it( stableitems.begin() ); while( it != stableitems.end() ) { if( (*it) ) { P_NPC pPet = dynamic_cast<P_NPC>(World::instance()->findChar( (*it)->getTag( "pet" ).toInt() )); if( pPet ) { pPet->free = false; pPet->moveTo( m_npc->pos() ); pPet->resend(); } (*it)->remove(); } ++it; } pPack->update(); m_npc->talk( tr("Here's your pet back!") ); } } } } void Human_Stablemaster::refreshStock() { } void Human_Stablemaster::handleTargetInput( P_PLAYER player, cUORxTarget *target ) { if( !player ) return; P_ITEM pPack = m_npc->getBackpack(); if( !pPack ) return; P_NPC pPet = dynamic_cast< P_NPC >(World::instance()->findChar( target->serial() )); if( !pPet ) { m_npc->talk( tr("I cannot stable that!" ) ); return; } if( pPet->owner() != player ) { m_npc->talk( tr("This does not belong to you!" ) ); return; } // we spawn a worldgem in the stablemasters backpack for the pet // it does only hold the serial of it, the serial of the owner and the // number of refresh signals since begin of stabling // the pet becomes "free", which means, that it isnt in the world // but will still be saved. P_ITEM pGem = new cItem(); pGem->Init( false ); pGem->setTag( "player", cVariant( player->serial() ) ); pGem->setTag( "pet", cVariant( pPet->serial() ) ); pGem->setId( 0x1ea7 ); pGem->setName( tr("petitem: %1").arg(pPet->name()) ); pGem->setVisible( 2 ); // gm visible pPack->addItem( pGem ); pGem->update(); pPet->free = true; MapObjects::instance()->remove( pPet ); pPet->removeFromView(); m_npc->talk( tr("Say release to get your pet back!") ); } static AbstractAI* productCreator_HGC() { return new Human_Guard_Called( NULL ); } void Human_Guard_Called::registerInFactory() { AIFactory::instance()->registerType("Human_Guard_Called", productCreator_HGC); } Human_Guard_Called::Human_Guard_Called( P_NPC npc ) : AbstractAI( npc ) { notorityOverride_ = 1; m_actions.append( new Human_Guard_Called_Fight( npc, this ) ); m_actions.append( new Human_Guard_Called_TeleToTarget( npc, this ) ); m_actions.append( new Human_Guard_Called_Disappear( npc, this ) ); } void Human_Guard_Called::init( P_NPC npc ) { npc->setSummonTime( uiCurrentTime + MY_CLOCKS_PER_SEC * SrvParams->guardDispelTime() ); AbstractAI::init( npc ); } void Human_Guard_Called_Fight::execute() { // talk only in about every 10th check switch( RandomNum( 0, 20 ) ) { case 0: m_npc->talk( tr( "Thou shalt regret thine actions, swine!" ), -1, 0, true ); break; case 1: m_npc->talk( tr( "Death to all Evil!" ), -1, 0, true ); break; } m_npc->setSummonTime( uiCurrentTime + MY_CLOCKS_PER_SEC * SrvParams->guardDispelTime() ); // Fighting is handled within combat.. } float Human_Guard_Called_Fight::preCondition() { if( m_npc->combatTarget() == INVALID_SERIAL ) return 0.0f; P_CHAR pTarget = World::instance()->findChar( m_npc->combatTarget() ); if( !pTarget || pTarget->isDead() || pTarget->isInnocent() || pTarget->region() != m_npc->region() ) return 0.0f; if( pTarget && m_npc->dist( pTarget ) < 2 ) return 1.0f; else return 0.0f; } float Human_Guard_Called_Fight::postCondition() { return 1.0f - preCondition(); } void Human_Guard_Called_TeleToTarget::execute() { m_npc->setSummonTime( uiCurrentTime + MY_CLOCKS_PER_SEC * SrvParams->guardDispelTime() ); // Teleports the guard towards the target P_CHAR pTarget = World::instance()->findChar( m_npc->combatTarget() ); if( pTarget ) { m_npc->moveTo( pTarget->pos() ); m_npc->soundEffect( 0x1FE ); m_npc->effect( 0x372A, 0x09, 0x06 ); m_npc->resend( false ); } } float Human_Guard_Called_TeleToTarget::preCondition() { if( m_npc->combatTarget() == INVALID_SERIAL ) return 0.0f; P_CHAR pTarget = World::instance()->findChar( m_npc->combatTarget() ); if( !pTarget || pTarget->isDead() || pTarget->isInnocent() || pTarget->region() != m_npc->region() ) return 0.0f; if( pTarget && m_npc->dist( pTarget ) >= 2 ) return 1.0f; else return 0.0f; } float Human_Guard_Called_TeleToTarget::postCondition() { return 1.0f - preCondition(); } void Human_Guard_Called_Disappear::execute() { // nothing to do } float Human_Guard_Called_Disappear::preCondition() { if( m_npc->combatTarget() == INVALID_SERIAL ) return 1.0f; P_CHAR pTarget = World::instance()->findChar( m_npc->combatTarget() ); if( !pTarget || pTarget->isDead() || pTarget->isInnocent() || pTarget->region() != m_npc->region() ) return 1.0f; return 0.0f; } float Human_Guard_Called_Disappear::postCondition() { return 1.0f - preCondition(); } static AbstractAI* productCreator_HG() { return new Human_Guard( NULL ); } void Human_Guard::registerInFactory() { AIFactory::instance()->registerType("Human_Guard", productCreator_HG); } Human_Guard::Human_Guard( P_NPC npc ) : AbstractAI( npc ), m_currentVictim( NULL ) { notorityOverride_ = 1; m_actions.append( new Human_Guard_Wander( npc, this ) ); m_actions.append( new Human_Guard_MoveToTarget( npc, this ) ); m_actions.append( new Human_Guard_Fight( npc, this ) ); } void Human_Guard::check() { selectVictim(); AbstractAI::check(); } void Human_Guard::selectVictim() { if( m_currentVictim ) { // Check if the current target is valid, including: // - Target not dead. // - Target in attack range. // - Target not innocent. if( m_currentVictim->isDead() || m_currentVictim->isInnocent() ) m_currentVictim = NULL; else if( !m_npc->inRange( m_currentVictim, SrvParams->attack_distance() ) ) m_currentVictim = NULL; } if( !m_currentVictim ) { // Get a criminal or murderer in range to attack it RegionIterator4Chars ri( m_npc->pos(), VISRANGE ); for( ri.Begin(); !ri.atEnd(); ri++ ) { P_CHAR pChar = ri.GetData(); if( pChar && !pChar->free && pChar != m_npc && !pChar->isInvulnerable() && !pChar->isHidden() && !pChar->isInvisible() && !pChar->isDead() && !pChar->isInnocent() ) { P_PLAYER pPlayer = dynamic_cast<P_PLAYER>(pChar); if( pPlayer && pPlayer->isGMorCounselor() ) continue; m_currentVictim = pChar; break; } } // If we found a new target, let us attack it if( m_currentVictim ) m_npc->fight( m_currentVictim ); } } void Human_Guard_Fight::execute() { // talk only in about every 10th check switch( RandomNum( 0, 20 ) ) { case 0: m_npc->talk( tr( "Thou shalt regret thine actions, swine!" ), -1, 0, true ); break; case 1: m_npc->talk( tr( "Death to all Evil!" ), -1, 0, true ); break; } if( !m_npc->isAtWar() ) m_npc->toggleCombat(); // Fighting is handled within combat.. } float Human_Guard_Fight::preCondition() { Human_Guard* pAI = dynamic_cast< Human_Guard* >(m_ai); P_CHAR pTarget = ( pAI ? pAI->currentVictim() : NULL ); if( !pTarget || pTarget->isDead() || pTarget->isInnocent() ) return 0.0f; if( pTarget && m_npc->dist( pTarget ) < 2 ) return 1.0f; else return 0.0f; } float Human_Guard_Fight::postCondition() { return 1.0f - preCondition(); } void Human_Guard_MoveToTarget::execute() { if( !m_npc->isAtWar() ) m_npc->toggleCombat(); Human_Guard* pAI = dynamic_cast< Human_Guard* >(m_ai); P_CHAR pTarget = ( pAI ? pAI->currentVictim() : NULL ); if( !pTarget ) return; if( SrvParams->pathfind4Combat() ) movePath( pTarget->pos() ); else moveTo( pTarget->pos() ); } float Human_Guard_MoveToTarget::preCondition() { Human_Guard* pAI = dynamic_cast< Human_Guard* >(m_ai); P_CHAR pTarget = ( pAI ? pAI->currentVictim() : NULL ); if( !pTarget || pTarget->isDead() || pTarget->isInnocent() ) return 0.0f; if( pTarget && m_npc->dist( pTarget ) >= 2 ) return 1.0f; else return 0.0f; } float Human_Guard_MoveToTarget::postCondition() { return 1.0f - preCondition(); } float Human_Guard_Wander::preCondition() { Human_Guard* pAI = dynamic_cast< Human_Guard* >(m_ai); P_CHAR pTarget = ( pAI ? pAI->currentVictim() : NULL ); if( !pTarget || pTarget->isDead() || pTarget->isInnocent() ) return 1.0f; return 0.0f; } float Human_Guard_Wander::postCondition() { return 1.0f - preCondition(); } --- NEW FILE: ai_monsters.cpp --- //================================================================================== // // Wolfpack Emu (WP) // UO Server Emulation Program // // Copyright 2001-2003 by holders identified in authors.txt // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Palace - Suite 330, Boston, MA 02111-1307, USA. // // * In addition to that license, if you are running this program or modified // * versions of it on a public system you HAVE TO make the complete source of // * the version used by you available or provide people with a location to // * download it. // // // // Wolfpack Homepage: http://wpdev.sf.net/ //================================================================================== #include "ai.h" #include "npc.h" #include "factory.h" #include "sectors.h" #include "player.h" #include "srvparams.h" #include "globals.h" #include "basics.h" #include "itemid.h" #include "items.h" // library includes #include <math.h> void Monster_Aggressive::check() { selectVictim(); AbstractAI::check(); } static AbstractAI* productCreator_MAL0() { return new Monster_Aggressive_L0( NULL ); } void Monster_Aggressive_L0::registerInFactory() { AIFactory::instance()->registerType("Monster_Aggressive_L0", productCreator_MAL0); } void Monster_Aggressive_L0::selectVictim() { // We must make sure, that the npc has a correct target. // If he already has one, we must check if it is still correct. // Else we search a new one. // If the npc is tamed, it cant attack if( m_npc->isTamed() ) { m_currentVictim = NULL; return; } if( m_currentVictim ) { // Check if the current target is valid, including: // - Target not dead. // - Target in attack range. if( m_currentVictim->isDead() ) m_currentVictim = NULL; else if( !m_npc->inRange( m_currentVictim, SrvParams->attack_distance() ) ) m_currentVictim = NULL; } if( !m_currentVictim ) { // Get the first best character and attack it RegionIterator4Chars ri( m_npc->pos(), VISRANGE ); for( ri.Begin(); !ri.atEnd(); ri++ ) { P_CHAR pChar = ri.GetData(); if( pChar && !pChar->free && pChar != m_npc && !pChar->isInvulnerable() && !pChar->isHidden() && !pChar->isInvisible() && !pChar->isDead() ) { P_PLAYER pPlayer = dynamic_cast<P_PLAYER>(pChar); if( pPlayer && pPlayer->isGMorCounselor() ) continue; m_currentVictim = pChar; break; } } // If we found a new target, let us attack it if( m_currentVictim ) m_npc->fight( m_currentVictim ); } } static AbstractAI* productCreator_MAL1() { return new Monster_Aggressive_L1( NULL ); } void Monster_Aggressive_L1::registerInFactory() { AIFactory::instance()->registerType("Monster_Aggressive_L1", productCreator_MAL1); } void Monster_Aggressive_L1::selectVictim() { // We must make sure, that the npc has a correct target. // If he already has one, we must check if it is still correct. // Else we search a new one. // If the npc is tamed, it cant attack if( m_npc->isTamed() ) { m_currentVictim = NULL; return; } if( m_currentVictim ) { // Check if the current target is valid, including: // - Target not dead. // - Target in attack range. if( m_currentVictim->isDead() ) m_currentVictim = NULL; else if( !m_npc->inRange( m_currentVictim, SrvParams->attack_distance() ) ) m_currentVictim = NULL; } int currentPriority = -0x00DDDDDD; P_CHAR newVictim = m_currentVictim; // we divide the negative priority of the current victim by two, // so it cant be overwritten that easy. // This shall reduce "target hopping". if( m_currentVictim ) currentPriority = (0 - m_currentVictim->dist( m_npc ) - m_currentVictim->hitpoints() - m_currentVictim->calcDefense(ALLBODYPARTS)) / 2; // Get the attackable char which has the highest priority. // The priority is calculated by *distance* and *strength*. RegionIterator4Chars ri( m_npc->pos(), VISRANGE ); for( ri.Begin(); !ri.atEnd(); ri++ ) { P_CHAR pChar = ri.GetData(); if( pChar && !pChar->free && pChar != m_npc && !pChar->isInvulnerable() && !pChar->isHidden() && !pChar->isInvisible() && !pChar->isDead() ) { P_PLAYER pPlayer = dynamic_cast<P_PLAYER>(pChar); int priority = 0 - pChar->dist( m_npc ) - pChar->hitpoints() - pChar->calcDefense( ALLBODYPARTS ); if( priority > currentPriority ) { newVictim = pChar; currentPriority = priority; } } } // If we found a new target, let us attack it if( (!m_currentVictim && newVictim) || (m_currentVictim && m_currentVictim != newVictim) ) { m_currentVictim = newVictim; m_npc->fight( newVictim ); } } float Monster_Aggr_Wander::preCondition() { /* * Wandering has the following preconditions: * - Same as Action_Wander * - No target has been set. */ Monster_Aggressive* pAI = dynamic_cast< Monster_Aggressive* >( m_ai ); if( pAI && pAI->currentVictim() ) return 0.0f; return Action_Wander::preCondition(); } float Monster_Aggr_MoveToTarget::preCondition() { /* * Moving to the target has the following preconditions: * - A target has been set. * - The NPC is not in combat range. * * Here we take the fuzzy logic into account. * If the npc is injured, the chance of fighting will decrease. */ Monster_Aggressive* pAI = dynamic_cast< Monster_Aggressive* >( m_ai ); if( !pAI || !pAI->currentVictim() ) return 0.0f; UINT8 range = 1; if( m_npc->rightHandItem() && IsBowType( m_npc->rightHandItem()->id() ) ) range = ARCHERY_RANGE; if( m_npc->inRange( pAI->currentVictim(), range ) ) return 0.0f; float healthmod = (float)m_npc->hitpoints() / ((float)m_npc->criticalHealth()/100.0f * (float)m_npc->maxHitpoints()); return healthmod; } float Monster_Aggr_MoveToTarget::postCondition() { /* * Moving to the target has the following postconditions: * - The target is not set anymore. * - The NPC is within fight range. * - The NPC is not injured above the critical line. */ Monster_Aggressive* pAI = dynamic_cast< Monster_Aggressive* >( m_ai ); if( !pAI || !pAI->currentVictim() ) return 1.0f; UINT8 range = 1; if( m_npc->rightHandItem() && IsBowType( m_npc->rightHandItem()->id() ) ) range = ARCHERY_RANGE; if( m_npc->inRange( pAI->currentVictim(), range ) ) return 1.0f; float healthmod = (float)(m_npc->maxHitpoints() - m_npc->hitpoints()) / (float)(m_npc->maxHitpoints() - ((float)m_npc->criticalHealth()/100.0f * (float)m_npc->maxHitpoints())); return healthmod; } void Monster_Aggr_MoveToTarget::execute() { if( !m_npc->isAtWar() ) m_npc->toggleCombat(); Monster_Aggressive* pAI = dynamic_cast< Monster_Aggressive* >( m_ai ); if( !pAI || !pAI->currentVictim() ) return; if( SrvParams->pathfind4Combat() ) movePath( pAI->currentVictim()->pos() ); else moveTo( pAI->currentVictim()->pos() ); } float Monster_Aggr_Fight::preCondition() { /* * Fighting the target has the following preconditions: * - A target has been set. * - The target is not dead. * - The NPC is in combat range. * * Here we take the fuzzy logic into account. * If the npc is injured, the chance of fighting will decrease. */ Monster_Aggressive* pAI = dynamic_cast< Monster_Aggressive* >( m_ai ); if( !pAI || !pAI->currentVictim() || pAI->currentVictim()->isDead() ) return 0.0f; UINT8 range = 1; if( m_npc->rightHandItem() && IsBowType( m_npc->rightHandItem()->id() ) ) range = ARCHERY_RANGE; if( !m_npc->inRange( pAI->currentVictim(), range ) ) return 0.0f; float healthmod = (float)m_npc->hitpoints() / ((float)m_npc->criticalHealth()/100.0f * (float)m_npc->maxHitpoints()); return he... [truncated message content] |
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv8134
Modified Files:
Timing.cpp accounts.cpp accounts.h basedef.cpp commands.cpp
commands.h coord.cpp maps.cpp maps.h npc.cpp scriptmanager.cpp
speech.cpp srvparams.cpp targetrequests.h tilecache.h
tmpeff.cpp uobject.cpp wolf.dsp wolfpack.cpp
Removed Files:
ai.cpp ai.h ai_animals.cpp ai_humans.cpp ai_monsters.cpp
Log Message:
door generation command ( reference )
fixed some of the copyright notices
minor improvements.
Moving AI to it's own folder
Index: Timing.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/Timing.cpp,v
retrieving revision 1.184
retrieving revision 1.185
diff -C2 -d -r1.184 -r1.185
*** Timing.cpp 5 Jan 2004 06:25:37 -0000 1.184
--- Timing.cpp 22 Jan 2004 04:48:11 -0000 1.185
***************
*** 52,56 ****
#include "player.h"
#include "chars.h"
! #include "ai.h"
#include "inlines.h"
#include "walking.h"
--- 52,56 ----
#include "player.h"
#include "chars.h"
! #include "ai/ai.h"
#include "inlines.h"
#include "walking.h"
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -d -r1.74 -r1.75
*** accounts.cpp 22 Jan 2004 03:57:26 -0000 1.74
--- accounts.cpp 22 Jan 2004 04:48:11 -0000 1.75
***************
*** 100,123 ****
}
! //#include "console.h"
!
bool cAccount::authorized( const QString& group, const QString& value ) const
{
// No Valid ACL specified
if( !acl_ )
! {// Let's try harder get one.
! acl_ = Commands::instance()->getACL( aclName_ ); // loads if there was any specified.
! if ( !acl_ )
! {
! acl_ = Commands::instance()->getACL( "player" );
! if ( acl_ )
! aclName_ = "player";
! else
! return false;
! }
! }
// No group? No Access!
! QMap< QString, QMap< QString, bool > >::iterator groupIter = acl_->groups.find( group );
if( groupIter == acl_->groups.end() )
return false;
--- 100,115 ----
}
! /*!
! Checks if the account is autorized to perform the action catagorized
! into \a group and \a value pair, found in the ACL
! */
bool cAccount::authorized( const QString& group, const QString& value ) const
{
// No Valid ACL specified
if( !acl_ )
! return false; // Since refreshAcl have already tried to get one, just give up.
// No group? No Access!
! QMap< QString, QMap< QString, bool > >::const_iterator groupIter = acl_->groups.find( group );
if( groupIter == acl_->groups.end() )
return false;
***************
*** 141,154 ****
}
- void cAccounts::remove( cAccount *record )
- {
- if( accounts.contains( record->login() ) )
- accounts.remove( record->login() );
- delete record;
- }
-
void cAccount::refreshAcl()
{
! acl_ = Commands::instance()->getACL( aclName_ );
}
--- 133,145 ----
}
void cAccount::refreshAcl()
{
! acl_ = Commands::instance()->getACL( aclName_ );
!
! // No Valid ACL specified, will set as "player"
! if ( !acl_ )
! {
! acl_ = Commands::instance()->getACL( "player" );
! }
}
***************
*** 409,412 ****
--- 400,406 ----
}
+ /*!
+ Reloads all accounts
+ */
void cAccounts::reload()
{
***************
*** 454,457 ****
--- 448,456 ----
}
+ /*!
+ Creates an account with \a login and \a password. If this is the first account
+ on the system, it will be set with "admin" acl, otherwise, it will default to
+ "player" acl.
+ */
cAccount* cAccounts::createAccount( const QString& login, const QString& password )
{
***************
*** 469,472 ****
--- 468,484 ----
}
+ /*!
+ Removes \a record account from the system
+ */
+ void cAccounts::remove( cAccount *record )
+ {
+ if( accounts.contains( record->login() ) )
+ accounts.remove( record->login() );
+ delete record;
+ }
+
+ /*!
+ Returns the number of loaded accounts
+ */
uint cAccounts::count()
{
***************
*** 474,477 ****
--- 486,493 ----
}
+ /*!
+ Retrieves the account matching \a login or 0 if no such
+ account can be found.
+ */
cAccount* cAccounts::getRecord( const QString& login )
{
Index: accounts.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** accounts.h 22 Jan 2004 03:57:26 -0000 1.34
--- accounts.h 22 Jan 2004 04:48:11 -0000 1.35
***************
*** 5,9 ****
//
// Copyright 1997, 98 by Marcus Rating (Cironian)
! // Copyright 2001-2003 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
--- 5,9 ----
//
// Copyright 1997, 98 by Marcus Rating (Cironian)
! // Copyright 2001-2004 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
***************
*** 30,43 ****
//==================================================================================
-
-
#if !defined(__ACCOUNTS_H__)
#define __ACCOUNTS_H__
- #include "typedefs.h"
- #include "singleton.h"
-
// Library Includes
#include <qstring.h>
#include <qdatetime.h>
#include <qvaluevector.h>
--- 30,39 ----
//==================================================================================
#if !defined(__ACCOUNTS_H__)
#define __ACCOUNTS_H__
// Library Includes
#include <qstring.h>
+ #include <qcstring.h>
#include <qdatetime.h>
#include <qvaluevector.h>
***************
*** 45,49 ****
// Wolfpack includes
! //#include "commands.h"
// Forward Class declarations
--- 41,46 ----
// Wolfpack includes
! #include "typedefs.h"
! #include "singleton.h"
// Forward Class declarations
***************
*** 58,63 ****
QString login_;
QString password_;
! mutable cAcl *acl_;
! mutable QString aclName_;
QValueVector<P_PLAYER> characters_;
QDateTime lastLogin_;
--- 55,60 ----
QString login_;
QString password_;
! cAcl *acl_;
! QString aclName_;
QValueVector<P_PLAYER> characters_;
QDateTime lastLogin_;
Index: basedef.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basedef.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** basedef.cpp 11 Sep 2003 16:19:50 -0000 1.4
--- basedef.cpp 22 Jan 2004 04:48:12 -0000 1.5
***************
*** 4,9 ****
// UO Server Emulation Program
//
! // Copyright 1997, 98 by Marcus Rating (Cironian)
! // Copyright 2001-2003 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
--- 4,8 ----
// UO Server Emulation Program
//
! // Copyright 2001-2004 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.214
retrieving revision 1.215
diff -C2 -d -r1.214 -r1.215
*** commands.cpp 22 Jan 2004 04:39:18 -0000 1.214
--- commands.cpp 22 Jan 2004 04:48:12 -0000 1.215
***************
*** 4,9 ****
// UO Server Emulation Program
//
! // Copyright 1997, 98 by Marcus Rating (Cironian)
! // Copyright 2001-2003 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
--- 4,8 ----
// UO Server Emulation Program
//
! // Copyright 2001-2004 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
***************
*** 77,81 ****
// Check if the priviledges are ok
! if( !pChar->account()->authorized("command", pCommand ))
{
socket->sysMessage( tr( "Access to command '%1' was denied" ).arg( pCommand.lower() ) );
--- 76,80 ----
// Check if the priviledges are ok
! if( !pChar->account()->authorized("command", pCommand.latin1() ))
{
socket->sysMessage( tr( "Access to command '%1' was denied" ).arg( pCommand.lower() ) );
***************
*** 166,170 ****
QMap< QString, bool > group;
! QString groupName;
--- 165,169 ----
QMap< QString, bool > group;
! QCString groupName;
***************
*** 494,498 ****
else if( key == "acl" )
{
! if( !Commands::instance()->getACL( value ) )
{
socket->sysMessage( tr( "You tried to specify an unknown acl '%1'" ).arg( value ) );
--- 493,497 ----
else if( key == "acl" )
{
! if( !Commands::instance()->getACL( value.latin1() ) )
{
socket->sysMessage( tr( "You tried to specify an unknown acl '%1'" ).arg( value ) );
***************
*** 1241,1244 ****
--- 1240,1501 ----
}
+ void commandDoorGenerator( cUOSocket* socket, const QString &command, const QStringList &args ) throw()
+ {
+ class DoorGenerator
+ {
+ enum DoorFacing {
+ WestCW = 0, EastCCW, WestCCW, EastCW, SouthCW, NorthCCW, SouthCCW, NorthCW
+ };
+
+ bool isFrame( int id, int frames[], int size )
+ {
+ id &= 0x3FFF;
+ if ( id > frames[size - 1] )
+ return false;
+
+ for ( int i = 0; i < size; ++i )
+ {
+ int delta = id - frames[i];
+
+ if ( delta < 0 )
+ return false;
+ else if ( delta == 0 )
+ return true;
+ }
+ return false;
+ }
+
+ bool isSouthFrame( int id )
+ {
+ static int SouthFrames[] = {
+ 0x0006,0x0008,0x000B,0x001A,0x001B,0x001F,
+ 0x0038,0x0057,0x0059,0x005B,0x005D,0x0080,
+ 0x0081,0x0082,0x0084,0x0090,0x0091,0x0094,
+ 0x0096,0x0099,0x00A6,0x00A7,0x00AA,0x00AE,
+ 0x00B0,0x00B3,0x00C7,0x00C9,0x00F8,0x00FA,
+ 0x00FD,0x00FE,0x0100,0x0103,0x0104,0x0106,
+ 0x0109,0x0127,0x0129,0x012B,0x012D,0x012F,
+ 0x0131,0x0132,0x0134,0x0135,0x0137,0x0139,
+ 0x013B,0x014C,0x014E,0x014F,0x0151,0x0153,
+ 0x0155,0x0157,0x0158,0x015A,0x015D,0x015E,
+ 0x015F,0x0162,0x01CF,0x01D1,0x01D4,0x01FF,
+ 0x0204,0x0206,0x0208,0x020A };
+ return isFrame( id, SouthFrames, sizeof(SouthFrames) );
+ }
+
+ bool isNorthFrame( int id )
+ {
+ static int NorthFrames[] = {
+ 0x0006,0x0008,0x000D,0x001A,0x001B,0x0020,
+ 0x003A,0x0057,0x0059,0x005B,0x005D,0x0080,
+ 0x0081,0x0082,0x0084,0x0090,0x0091,0x0094,
+ 0x0096,0x0099,0x00A6,0x00A7,0x00AC,0x00AE,
+ 0x00B0,0x00C7,0x00C9,0x00F8,0x00FA,0x00FD,
+ 0x00FE,0x0100,0x0103,0x0104,0x0106,0x0109,
+ 0x0127,0x0129,0x012B,0x012D,0x012F,0x0131,
+ 0x0132,0x0134,0x0135,0x0137,0x0139,0x013B,
+ 0x014C,0x014E,0x014F,0x0151,0x0153,0x0155,
+ 0x0157,0x0158,0x015A,0x015D,0x015E,0x015F,
+ 0x0162,0x01CF,0x01D1,0x01D4,0x01FF,0x0201,
+ 0x0204,0x0208,0x020A };
+ return isFrame( id, NorthFrames, sizeof( NorthFrames ) );
+ }
+
+ bool isEastFrame( int id )
+ {
+ static int EastFrames[] = {
+ 0x0007,0x000A,0x001A,0x001C,0x001E,0x0037,0x0058,
+ 0x0059,0x005C,0x005E,0x0080,0x0081,0x0082,0x0084,
+ 0x0090,0x0092,0x0095,0x0097,0x0098,0x00A6,0x00A8,
+ 0x00AB,0x00AE,0x00AF,0x00B2,0x00C7,0x00C8,0x00EA,
+ 0x00F8,0x00F9,0x00FC,0x00FE,0x00FF,0x0102,0x0104,
+ 0x0105,0x0108,0x0127,0x0128,0x012B,0x012C,0x012E,
+ 0x0130,0x0132,0x0133,0x0135,0x0136,0x0138,0x013A,
+ 0x014C,0x014D,0x014F,0x0150,0x0152,0x0154,0x0156,
+ 0x0158,0x0159,0x015C,0x015E,0x0160,0x0163,0x01CF,
+ 0x01D0,0x01D3,0x01FF,0x0203,0x0205,0x0207,0x0209 };
+ return isFrame( id, EastFrames, sizeof( EastFrames ) );
+ }
+
+ bool isWestFrame( int id )
+ {
+ static int WestFrames[] = {
+ 0x0007,0x000C,0x001A,0x001C,0x0021,0x0039,0x0058,0x0059,
+ 0x005C,0x005E,0x0080,0x0081,0x0082,0x0084,0x0090,0x0092,
+ 0x0095,0x0097,0x0098,0x00A6,0x00A8,0x00AD,0x00AE,0x00AF,
+ 0x00B5,0x00C7,0x00C8,0x00EA,0x00F8,0x00F9,0x00FC,0x00FE,
+ 0x00FF,0x0102,0x0104,0x0105,0x0108,0x0127,0x0128,0x012C,
+ 0x012E,0x0130,0x0132,0x0133,0x0135,0x0136,0x0138,0x013A,
+ 0x014C,0x014D,0x014F,0x0150,0x0152,0x0154,0x0156,0x0158,
+ 0x0159,0x015C,0x015E,0x0160,0x0163,0x01CF,0x01D0,0x01D3,
+ 0x01FF,0x0200,0x0203,0x0207,0x0209 };
+ return isFrame( id, WestFrames, sizeof( WestFrames ) );
+ }
+
+ bool coordHasEastFrame( int x, int y, int z, int map )
+ {
+ StaticsIterator tiles = Map->staticsIterator( Coord_cl( x, y, z, map ), true );
+ for ( ; !tiles.atEnd(); ++tiles )
+ {
+ if ( tiles.data().zoff == z && isEastFrame( tiles.data().itemid ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ bool coordHasSouthFrame( int x, int y, int z, int map )
+ {
+ StaticsIterator tiles = Map->staticsIterator( Coord_cl( x, y, z, map ), true );
+ for ( ; !tiles.atEnd(); ++tiles )
+ {
+ if ( tiles.data().zoff == z && isSouthFrame( tiles.data().itemid ) )
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ cItem* addDoor( int x, int y, int z, int map, DoorFacing facing )
+ {
+ int doorTop = z + 20;
+
+ if ( y == 1743 && x >= 1343 && x <= 1344 )
+ return 0;
+ if ( y == 1679 && x >= 1392 && x <= 1393 )
+ return 0;
+ if ( x == 1320 && y >= 1618 && y <= 1640 )
+ return 0;
+ if ( x == 1383 && y >= 1642 && y <= 1643 )
+ return 0;
+ if ( !Map->canFit( x, y, z, map, 16) )
+ return 0;
+ cItem* door = cItem::createFromScript( QString::number( 0x6A5 + 2*int(facing), 16 ) );
+ door->moveTo( Coord_cl( x, y, z, map ), true );
+ return door;
+ }
+ public:
+
+ int generate ( int region[], int map, cUOSocket* socket )
+ {
+ int count = 0;
+ for ( int rx = region[0]; rx < region[2]; ++rx )
+ {
+
+ for ( int ry = region[1]; ry < region[3]; ++ry )
+ {
+ StaticsIterator tiles = Map->staticsIterator( map, rx, ry, true );
+ for ( ; !tiles.atEnd(); ++tiles )
+ {
+ int id = tiles.data().itemid;
+ int z = tiles.data().zoff;
+ if ( isWestFrame( id ) )
+ {
+ if ( coordHasEastFrame( rx + 2, ry, z, map ) )
+ {
+ addDoor( rx + 1, ry, z, map, WestCW );
+ ++count;
+ }
+ else if ( coordHasEastFrame( rx + 3, ry, z, map ) )
+ {
+ cItem* first = addDoor( rx + 1, ry, z, map, WestCW );
+ cItem* second = addDoor( rx + 2, ry, z, map, EastCCW );
+ count += 2;
+ if ( first && second )
+ {
+ first->setTag( "link", second->serial() );
+ second->setTag( "link", first->serial() );
+ }
+ else
+ {
+ if ( !first && second )
+ {
+ second->remove();
+ --count;
+ }
+ if ( !second && first )
+ {
+ first->remove();
+ --count;
+ }
+ }
+ }
+ }
+ else if ( isNorthFrame( id ) )
+ {
+ if ( coordHasSouthFrame( rx, ry + 2, z, map ) )
+ {
+ addDoor( rx, ry + 1, z, map, SouthCW );
+ ++count;
+ }
+ else if ( coordHasSouthFrame( rx, ry + 3, z, map ) )
+ {
+ cItem* first = addDoor( rx, ry + 1, z, map, NorthCCW );
+ cItem* second = addDoor( rx, ry + 2, z, map, SouthCW );
+ count += 2;
+ if ( first && second )
+ {
+ first->setTag( "link", second->serial() );
+ second->setTag( "link", first->serial() );
+ }
+ else
+ {
+ if ( !first && second )
+ {
+ second->remove();
+ --count;
+ }
+ if ( !second && first )
+ {
+ first->remove();
+ --count;
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ return count;
+ }
+ };
+
+ DoorGenerator generator;
+
+ int BritRegions[][4] = {
+ { 250, 750, 775, 1330 },
+ { 525, 2095, 925, 2430 },
+ { 1025, 2155, 1265, 2310 },
+ { 1635, 2430, 1705, 2508 },
+ { 1775, 2605, 2165, 2975 },
+ { 1055, 3520, 1570, 4075 },
+ { 2860, 3310, 3120, 3630 },
+ { 2470, 1855, 3950, 3045 },
+ { 3425, 990, 3900, 1455 },
+ { 4175, 735, 4840, 1600 },
+ { 2375, 330, 3100, 1045 },
+ { 2100, 1090, 2310, 1450 },
+ { 1495, 1400, 1550, 1475 },
+ { 1085, 1520, 1415, 1910 },
+ { 1410, 1500, 1745, 1795 },
+ { 5120, 2300, 6143, 4095 } };
+ int IlshRegions[][4] = { { 0, 0, 288*8, 200*8 } };
+ int MalasRegions[][4] = { { 0, 0, 320*8, 256*8 } };
+
+ socket->sysMessage("Generating doors, please wait ( Slow )");
+ int count = 0;
+ if ( Map->hasMap( 0 ) )
+ {
+ for ( int i = 0; i < 16; ++i )
+ {
+ socket->sysMessage(QString("doing [%1, %2, %3, %4]").arg(BritRegions[i][0]).arg(BritRegions[i][1]).arg(BritRegions[i][2]).arg(BritRegions[i][3]) );
+ count += generator.generate( BritRegions[i], 0, socket );
+ socket->sysMessage( tr("Doors so far: %1").arg(count) );
+ }
+ }
+ }
+
// Command Table (Keep this at the end)
stCommand cCommands::commands[] =
***************
*** 1253,1256 ****
--- 1510,1514 ----
{ "ALLSKILLS", commandAllSkills },
{ "BROADCAST", commandBroadcast },
+ { "DOORGEN", commandDoorGenerator },
{ "FIX", commandFix },
{ "GO", commandGo },
Index: commands.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** commands.h 22 Jan 2004 03:57:27 -0000 1.17
--- commands.h 22 Jan 2004 04:48:12 -0000 1.18
***************
*** 38,41 ****
--- 38,42 ----
#include <qmap.h>
#include <qstring.h>
+ #include <qcstring.h>
#include <qstringlist.h>
#include <qobject.h>
***************
*** 75,84 ****
// Privlevel System
void loadACLs( void );
! cAcl *getACL( const QString& );
};
! inline cAcl *cCommands::getACL( const QString& key )
{
! QMap< QString, cAcl* >::iterator it = _acls.find( key );
if( it != _acls.end() )
--- 76,85 ----
// Privlevel System
void loadACLs( void );
! cAcl *getACL( const QString& ) const;
};
! inline cAcl *cCommands::getACL( const QString& key ) const
{
! QMap< QString, cAcl* >::const_iterator it = _acls.find( key );
if( it != _acls.end() )
Index: coord.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/coord.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** coord.cpp 30 Sep 2003 15:06:29 -0000 1.29
--- coord.cpp 22 Jan 2004 04:48:12 -0000 1.30
***************
*** 4,9 ****
// UO Server Emulation Program
//
! // Copyright 1997, 98 by Marcus Rating (Cironian)
! // Copyright 2001-2003 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
--- 4,8 ----
// UO Server Emulation Program
//
! // Copyright 2001-2004 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Index: maps.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/maps.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** maps.cpp 14 Jan 2004 02:43:11 -0000 1.24
--- maps.cpp 22 Jan 2004 04:48:12 -0000 1.25
***************
*** 4,8 ****
// UO Server Emulation Program
//
! // Copyright 2001-2003 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
--- 4,8 ----
// UO Server Emulation Program
//
! // Copyright 2001-2004 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
***************
*** 48,51 ****
--- 48,52 ----
#include <exception>
#include <assert.h>
+ #include <math.h>
class MapsPrivate
***************
*** 148,156 ****
/*!
Registers a map id and corresponding file to be accessible to Wolfpack
*/
bool Maps::registerMap( uint id, const QString& mapfile, uint mapwidth, uint mapheight, const QString& staticsfile, const QString& staticsidx )
{
try {
! MapsPrivate* p = new MapsPrivate( basePath + staticsidx, basePath + mapfile, basePath + staticsfile );
p->height = mapheight;
p->width = mapwidth;
--- 149,173 ----
/*!
Registers a map id and corresponding file to be accessible to Wolfpack
+ It will try it best to match the filenames in a case insensitive way,
+ since it's case sometimes varies and it might became an anoyance configuring the
+ server under Linux.
*/
bool Maps::registerMap( uint id, const QString& mapfile, uint mapwidth, uint mapheight, const QString& staticsfile, const QString& staticsidx )
{
try {
! QDir baseFolder( basePath );
! QStringList files = baseFolder.entryList();
! QString staticsIdxName, mapFileName, staticsFileName;
! for ( QStringList::const_iterator it = files.begin(); it != files.end(); ++it )
! {
! if ( (*it).lower() == staticsidx.lower() )
! staticsIdxName = *it;
! if ( (*it).lower() == mapfile.lower() )
! mapFileName = *it;
! if ( (*it).lower() == staticsfile.lower() )
! staticsFileName = *it;
! }
!
! MapsPrivate* p = new MapsPrivate( basePath + staticsIdxName, basePath + mapFileName, basePath + staticsFileName );
p->height = mapheight;
p->width = mapwidth;
***************
*** 241,246 ****
This method does not take into account dynamic objects that might
be placed in those coordinates, instead it only looks at the map file.
*/
! signed char Maps::mapAverageElevation( const Coord_cl& p ) const
{
// first thing is to get the map where we are standing
--- 258,265 ----
This method does not take into account dynamic objects that might
be placed in those coordinates, instead it only looks at the map file.
+ The optional parameters \a top and \a botton are respectively the highest
+ and lowerst values that composes the average
*/
! signed char Maps::mapAverageElevation( const Coord_cl& p, int* top /* = 0 */, int* botton /* = 0 */ ) const
{
// first thing is to get the map where we are standing
***************
*** 250,254 ****
if (map1.id > 2 && ILLEGAL_Z != mapElevation(p))
{
! // get three other nearby maps to decide on an average z?
INT8 map2z = mapElevation( p + Coord_cl( 1, 0, 0 ) );
INT8 map3z = mapElevation( p + Coord_cl( 0, 1, 0 ) );
--- 269,273 ----
if (map1.id > 2 && ILLEGAL_Z != mapElevation(p))
{
! // get three other nearby titles to decide on an average z?
INT8 map2z = mapElevation( p + Coord_cl( 1, 0, 0 ) );
INT8 map3z = mapElevation( p + Coord_cl( 0, 1, 0 ) );
***************
*** 260,268 ****
if (ILLEGAL_Z == map4z)
testz = map1.z;
! else
! {
! testz = (INT8)((map1.z + map4z) >> 1);
! if (testz%2<0) --testz; // make it round down, not just in the direction of 0
! }
}
else
--- 279,284 ----
if (ILLEGAL_Z == map4z)
testz = map1.z;
! else // round down.
! testz = (signed char)( floor( ( map1.z + map4z ) / 2.0 ) );
}
else
***************
*** 270,278 ****
if (ILLEGAL_Z == map2z || ILLEGAL_Z == map3z)
testz = map1.z;
! else
! {
! testz = (signed char)((map2z + map3z) >> 1);
! if (testz%2<0) --testz; // make it round down, not just in the direction of 0
! }
}
return testz;
--- 286,311 ----
if (ILLEGAL_Z == map2z || ILLEGAL_Z == map3z)
testz = map1.z;
! else // round down
! testz = (signed char)( floor( ( map2z + map3z ) / 2.0 ) );
! }
! if ( top )
! {
! *top = map1.z;
! if ( map2z > *top )
! *top = map2z;
! if ( map3z > *top )
! *top = map3z;
! if ( map4z > *top )
! *top = map4z;
! }
! if ( botton )
! {
! *botton = map1.z;
! if ( map2z < *botton )
! *botton = map2z;
! if ( map3z < *botton )
! *botton = map3z;
! if ( map4z < *botton )
! *botton = map4z;
}
return testz;
***************
*** 281,284 ****
--- 314,339 ----
}
+ bool Maps::canFit( int x, int y, int z, int map, int height ) const
+ {
+ if ( x < 0 || y < 0 || x >= mapTileWidth(map) * 8 || y >= mapTileHeight(map) * 8 )
+ return false;
+
+ map_st map1 = seekMap( map, x, y );
+ land_st land = TileCache::instance()->getLand( map1.id );
+ if ( land.isBlocking() )
+ return false; // There is something here.
+
+ // check statics too
+ StaticsIterator StaticTiles = staticsIterator( Coord_cl( x, y, z, map ) );
+ for ( ; !StaticTiles.atEnd(); ++StaticTiles )
+ {
+ tile_st tile = TileCache::instance()->getTile(StaticTiles->itemid);
+ if ( ( tile.isBlocking() ) && StaticTiles->zoff + tile.height > z )
+ return false;
+ }
+
+ return true;
+ }
+
signed char Maps::dynamicElevation(const Coord_cl& pos) const
{
***************
*** 315,319 ****
}
! signed char Maps::staticTop(const Coord_cl& pos)
{
signed char top = ILLEGAL_Z;
--- 370,374 ----
}
! signed char Maps::staticTop(const Coord_cl& pos) const
{
signed char top = ILLEGAL_Z;
***************
*** 324,328 ****
{
signed char tempTop = msi->zoff + TileCache::instance()->tileHeight(msi->itemid);
! if ((tempTop <= pos.z + MaxZstep) && (tempTop > top))
{
top = tempTop;
--- 379,383 ----
{
signed char tempTop = msi->zoff + TileCache::instance()->tileHeight(msi->itemid);
! if ( (tempTop <= pos.z + MaxZstep) && (tempTop > top) )
{
top = tempTop;
***************
*** 349,355 ****
! StaticsIterator Maps::staticsIterator(uint id, ushort x, ushort y, bool exact /* = true */ ) throw (wpException)
{
! iterator it = d.find( id );
if ( it == d.end() )
throw wpException(QString("[Maps::staticsIterator line %1] map id(%2) not registered!").arg(__LINE__).arg(id) );
--- 404,410 ----
! StaticsIterator Maps::staticsIterator(uint id, ushort x, ushort y, bool exact /* = true */ ) const throw (wpException)
{
! const_iterator it = d.find( id );
if ( it == d.end() )
throw wpException(QString("[Maps::staticsIterator line %1] map id(%2) not registered!").arg(__LINE__).arg(id) );
***************
*** 357,361 ****
}
! StaticsIterator Maps::staticsIterator( const Coord_cl& p, bool exact /* = true */ ) throw (wpException)
{
return staticsIterator( p.map, p.x, p.y, exact );
--- 412,416 ----
}
! StaticsIterator Maps::staticsIterator( const Coord_cl& p, bool exact /* = true */ ) const throw (wpException)
{
return staticsIterator( p.map, p.x, p.y, exact );
***************
*** 390,395 ****
baseY = y / 8;
pos = 0;
!
! load(d, x, y, exact);
}
--- 445,451 ----
baseY = y / 8;
pos = 0;
!
! if ( baseX < d->width && baseY < d->height )
! load(d, x, y, exact);
}
Index: maps.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/maps.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** maps.h 29 Aug 2003 17:58:58 -0000 1.7
--- maps.h 22 Jan 2004 04:48:12 -0000 1.8
***************
*** 118,129 ****
bool hasMap( uint id ) const;
signed char mapElevation( const Coord_cl& p ) const;
! signed char mapAverageElevation( const Coord_cl& p ) const;
signed char dynamicElevation(const Coord_cl& pos) const;
signed char height(const Coord_cl& pos);
uint mapTileWidth( uint ) const;
uint mapTileHeight( uint ) const;
! signed char staticTop(const Coord_cl& pos);
! StaticsIterator staticsIterator( uint id, ushort x, ushort y, bool exact = true ) throw( wpException );
! StaticsIterator staticsIterator( const Coord_cl&, bool exact = true ) throw( wpException );
};
--- 118,130 ----
bool hasMap( uint id ) const;
signed char mapElevation( const Coord_cl& p ) const;
! signed char mapAverageElevation( const Coord_cl& p, int* top = 0, int* botton = 0 ) const;
signed char dynamicElevation(const Coord_cl& pos) const;
signed char height(const Coord_cl& pos);
uint mapTileWidth( uint ) const;
uint mapTileHeight( uint ) const;
! signed char staticTop(const Coord_cl& pos) const;
! bool canFit( int x, int y, int z, int map, int height ) const;
! StaticsIterator staticsIterator( uint id, ushort x, ushort y, bool exact = true ) const throw( wpException );
! StaticsIterator staticsIterator( const Coord_cl&, bool exact = true ) const throw( wpException );
};
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** npc.cpp 8 Jan 2004 08:33:38 -0000 1.53
--- npc.cpp 22 Jan 2004 04:48:12 -0000 1.54
***************
*** 52,56 ****
#include "walking.h"
#include "skills.h"
! #include "ai.h"
#include "inlines.h"
#include "basics.h"
--- 52,56 ----
#include "walking.h"
#include "skills.h"
! #include "ai/ai.h"
#include "inlines.h"
#include "basics.h"
Index: scriptmanager.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/scriptmanager.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** scriptmanager.cpp 14 Jan 2004 04:55:39 -0000 1.9
--- scriptmanager.cpp 22 Jan 2004 04:48:12 -0000 1.10
***************
*** 4,8 ****
// UO Server Emulation Program
//
! // Copyright 2001-2003 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
--- 4,8 ----
// UO Server Emulation Program
//
! // Copyright 2001-2004 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
Index: speech.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/speech.cpp,v
retrieving revision 1.160
retrieving revision 1.161
diff -C2 -d -r1.160 -r1.161
*** speech.cpp 23 Sep 2003 23:55:24 -0000 1.160
--- speech.cpp 22 Jan 2004 04:48:12 -0000 1.161
***************
*** 51,55 ****
#include "npc.h"
#include "chars.h"
! #include "ai.h"
#include "world.h"
#include "inlines.h"
--- 51,55 ----
#include "npc.h"
#include "chars.h"
! #include "ai/ai.h"
#include "world.h"
#include "inlines.h"
***************
*** 417,421 ****
}
! bool BankerSpeech( cUOSocket *socket, P_PLAYER pPlayer, P_CHAR pBanker, const QString& comm )
{
// Needs to be a banker
--- 417,421 ----
}
! bool BankerSpeech( cUOSocket *socket, P_PLAYER pPlayer, P_NPC pBanker, const QString& comm )
{
// Needs to be a banker
***************
*** 423,426 ****
--- 423,429 ----
return false;*/
+ if ( pBanker->ai()->name() != "Banker")
+ return false;
+
if( pPlayer->dist(pBanker) > 6 )
return false;
***************
*** 442,446 ****
}
! bool TrainerSpeech( cUOSocket *socket, P_CHAR pPlayer, P_CHAR pTrainer, const QString& comm )
{
/* if( pPlayer->dist( pTrainer ) > 3 || !pTrainer->isHuman() )
--- 445,449 ----
}
! bool TrainerSpeech( cUOSocket *socket, P_CHAR pPlayer, P_NPC pTrainer, const QString& comm )
{
/* if( pPlayer->dist( pTrainer ) > 3 || !pTrainer->isHuman() )
Index: srvparams.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/srvparams.cpp,v
retrieving revision 1.91
retrieving revision 1.92
diff -C2 -d -r1.91 -r1.92
*** srvparams.cpp 20 Sep 2003 12:01:43 -0000 1.91
--- srvparams.cpp 22 Jan 2004 04:48:12 -0000 1.92
***************
*** 157,161 ****
saveSpawns_ = getBool("General", "Save Spawned Regions", true, true);
lootdecayswithcorpse_ = getBool("General", "Loot Decays With Corpse", true, true);
! invisTimer_ = getDouble("General", "InvisTimer", 60, true);
poisonTimer_ = getNumber("General", "PoisonTimer", 180, true);
hungerDamage_ = getNumber("General", "Hunger Damage", 0, true);
--- 157,161 ----
saveSpawns_ = getBool("General", "Save Spawned Regions", true, true);
lootdecayswithcorpse_ = getBool("General", "Loot Decays With Corpse", true, true);
! invisTimer_ = getDouble("General", "InvisTimer", 60, true);
poisonTimer_ = getNumber("General", "PoisonTimer", 180, true);
hungerDamage_ = getNumber("General", "Hunger Damage", 0, true);
Index: targetrequests.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.h,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -d -r1.48 -r1.49
*** targetrequests.h 23 Nov 2003 03:46:22 -0000 1.48
--- targetrequests.h 22 Jan 2004 04:48:12 -0000 1.49
***************
*** 44,48 ****
#include "tilecache.h"
#include "npc.h"
! #include "ai.h"
--- 44,48 ----
#include "tilecache.h"
#include "npc.h"
! #include "ai/ai.h"
Index: tilecache.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/tilecache.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** tilecache.h 12 Jan 2003 18:11:32 -0000 1.13
--- tilecache.h 22 Jan 2004 04:48:12 -0000 1.14
***************
*** 89,92 ****
--- 89,94 ----
char unknown2;
char name[20];
+
+ bool isBlocking() const { return flag1 & 0x40; }
};
Index: tmpeff.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/tmpeff.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** tmpeff.cpp 23 Nov 2003 15:09:45 -0000 1.66
--- tmpeff.cpp 22 Jan 2004 04:48:12 -0000 1.67
***************
*** 49,53 ****
#include "player.h"
#include "npc.h"
! #include "ai.h"
#include "basics.h"
#include "world.h"
--- 49,53 ----
#include "player.h"
#include "npc.h"
! #include "ai/ai.h"
#include "basics.h"
#include "world.h"
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.121
retrieving revision 1.122
diff -C2 -d -r1.121 -r1.122
*** uobject.cpp 12 Jan 2004 20:33:15 -0000 1.121
--- uobject.cpp 22 Jan 2004 04:48:12 -0000 1.122
***************
*** 4,9 ****
// UO Server Emulation Program
//
! // Copyright 1997, 98 by Marcus Rating (Cironian)
! // Copyright 2001-2003 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
--- 4,8 ----
// UO Server Emulation Program
//
! // Copyright 2001-2004 by holders identified in authors.txt
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
***************
*** 101,104 ****
--- 100,106 ----
}
+ /*!
+ Returns the distance between this object and \a d
+ */
unsigned int cUObject::dist(cUObject* d) const
{
***************
*** 232,236 ****
}
! // Checks if the object has a specific event
bool cUObject::hasEvent( const QString& name ) const
{
--- 234,241 ----
}
! /*!
! Checks if the object has a specific event \a name
! \sa addEvent
! */
bool cUObject::hasEvent( const QString& name ) const
{
***************
*** 249,252 ****
--- 254,260 ----
}
+ /*!
+ Adds an event handler to this object
+ */
void cUObject::addEvent( cPythonScript *Event )
{
***************
*** 324,352 ****
}
- /****************************
- *
- * Scripting events
- *
- ****************************/
- bool cUObject::onCreate( const QString &definition )
- {
- cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_CREATE );
- bool result = false;
-
- if( scriptChain || global )
- {
- PyObject *args = Py_BuildValue( "O&s", PyGetObjectObject, this, definition.latin1() );
-
- result = cPythonScript::callChainedEventHandler( EVENT_SHOWTOOLTIP, scriptChain, args );
-
- if( !result && global )
- result = global->callEventHandler( EVENT_CREATE, args );
-
- Py_DECREF( args );
- }
-
- return result;
- }
-
// If the scripts are reloaded call that for each and every existing object
void cUObject::recreateEvents()
--- 332,335 ----
***************
*** 405,409 ****
name_ = Value;
}
-
//<direction>SE</direction>
else if( TagName == "direction" )
--- 388,391 ----
***************
*** 734,735 ****
--- 716,741 ----
}
+ /****************************
+ *
+ * Scripting events
+ *
+ ****************************/
+ bool cUObject::onCreate( const QString &definition )
+ {
+ cPythonScript *global = ScriptManager::instance()->getGlobalHook( EVENT_CREATE );
+ bool result = false;
+
+ if( scriptChain || global )
+ {
+ PyObject *args = Py_BuildValue( "O&s", PyGetObjectObject, this, definition.latin1() );
+
+ result = cPythonScript::callChainedEventHandler( EVENT_SHOWTOOLTIP, scriptChain, args );
+
+ if( !result && global )
+ result = global->callEventHandler( EVENT_CREATE, args );
+
+ Py_DECREF( args );
+ }
+
+ return result;
+ }
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.244
retrieving revision 1.245
diff -C2 -d -r1.244 -r1.245
*** wolf.dsp 18 Dec 2003 13:27:16 -0000 1.244
--- wolf.dsp 22 Jan 2004 04:48:12 -0000 1.245
***************
*** 77,81 ****
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib ole32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt321.lib shell32.lib /nologo /version:12.9 /subsystem:windows /incremental:no /map /debug /machine:I386 /out:"..\wolfpack.exe" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
--- 77,81 ----
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
! # ADD LINK32 kernel32.lib user32.lib gdi32.lib ole32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt323.lib shell32.lib /nologo /version:12.9 /subsystem:windows /incremental:no /map /debug /machine:I386 /out:"..\wolfpack.exe" /pdbtype:sept /fixed:no
# SUBTRACT LINK32 /pdb:none
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.479
retrieving revision 1.480
diff -C2 -d -r1.479 -r1.480
*** wolfpack.cpp 21 Jan 2004 05:05:41 -0000 1.479
--- wolfpack.cpp 22 Jan 2004 04:48:12 -0000 1.480
***************
*** 30,34 ****
#include "accounts.h"
! #include "ai.h"
#include "basedef.h"
#include "basics.h"
--- 30,34 ----
#include "accounts.h"
! #include "ai/ai.h"
#include "basedef.h"
#include "basics.h"
--- ai.cpp DELETED ---
--- ai.h DELETED ---
--- ai_animals.cpp DELETED ---
--- ai_humans.cpp DELETED ---
--- ai_monsters.cpp DELETED ---
|
|
From: <thi...@us...> - 2004-01-22 04:48:15
|
Update of /cvsroot/wpdev/wolfpack/network In directory sc8-pr-cvs1:/tmp/cvs-serv8134/network Modified Files: uosocket.cpp Log Message: door generation command ( reference ) fixed some of the copyright notices minor improvements. Moving AI to it's own folder Index: uosocket.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v retrieving revision 1.301 retrieving revision 1.302 diff -C2 -d -r1.301 -r1.302 *** uosocket.cpp 12 Jan 2004 04:59:28 -0000 1.301 --- uosocket.cpp 22 Jan 2004 04:48:12 -0000 1.302 *************** *** 66,70 **** #include "../npc.h" #include "../log.h" ! #include "../ai.h" #include <stdlib.h> --- 66,70 ---- #include "../npc.h" #include "../log.h" ! #include "../ai/ai.h" #include <stdlib.h> |
|
From: <thi...@us...> - 2004-01-22 04:46:41
|
Update of /cvsroot/wpdev/wolfpack/ai In directory sc8-pr-cvs1:/tmp/cvs-serv7985/ai Log Message: Directory /cvsroot/wpdev/wolfpack/ai added to the repository |
|
From: <as...@us...> - 2004-01-22 04:40:02
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv6942
Modified Files:
persistentbroker.cpp
Log Message:
killed off nonsense!
Index: persistentbroker.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** persistentbroker.cpp 25 Sep 2003 03:05:58 -0000 1.31
--- persistentbroker.cpp 22 Jan 2004 04:39:58 -0000 1.32
***************
*** 242,247 ****
if( d->sqlite )
! return s.replace( QRegExp("'"), "''" ).utf8().data();
else
! return s.replace( QRegExp("'"), "\\'" ).utf8().data();
}
--- 242,247 ----
if( d->sqlite )
! return s.replace( "'", "''" ).utf8().data();
else
! return s.replace( "'", "\\'" ).utf8().data();
}
|
|
From: <as...@us...> - 2004-01-22 04:39:22
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1:/tmp/cvs-serv6810 Modified Files: commands.cpp Log Message: send a message, when python script reload finished Index: commands.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v retrieving revision 1.213 retrieving revision 1.214 diff -C2 -d -r1.213 -r1.214 *** commands.cpp 22 Jan 2004 03:57:26 -0000 1.213 --- commands.cpp 22 Jan 2004 04:39:18 -0000 1.214 *************** *** 891,894 **** --- 891,895 ---- ScriptManager::instance()->reload(); ContextMenus::instance()->reload(); + Console::instance()->send( "Python scripts reloaded\n" ); } if( subCommand == "scripts" ) |
|
From: <as...@us...> - 2004-01-22 04:37:47
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/misc
In directory sc8-pr-cvs1:/tmp/cvs-serv6640/misc
Modified Files:
siegeweapons.xml
Log Message:
splitted up
Index: siegeweapons.xml
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/misc/siegeweapons.xml,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** siegeweapons.xml 3 Oct 2003 17:54:22 -0000 1.4
--- siegeweapons.xml 22 Jan 2004 04:37:44 -0000 1.5
***************
*** 74,748 ****
<item id="1648">
<id>0x1648</id> <nodecay />
! <category>Misc\Catapult\Catapult 1</category>
</item>
<item id="1649">
<id>0x1649</id> <nodecay />
! <category>Misc\Catapult\Catapult 2</category>
</item>
[...3814 lines suppressed...]
<item id="3fe1">
<id>0x3FE1</id> <nodecay />
! <category>Misc\Balista\241-249\Balista 246</category>
</item>
<item id="3fe2">
<id>0x3FE2</id> <nodecay />
! <category>Misc\Balista\241-249\Balista 247</category>
</item>
<item id="3fe3">
<id>0x3FE3</id> <nodecay />
! <category>Misc\Balista\241-249\Balista 248</category>
</item>
<item id="3fe4">
<id>0x3FE4</id> <nodecay />
! <category>Misc\Balista\241-249\Balista 249</category>
</item>
|
|
From: <as...@us...> - 2004-01-22 04:36:35
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands
In directory sc8-pr-cvs1:/tmp/cvs-serv6495
Added Files:
cast.py
Log Message:
command to cast a spell
--- NEW FILE: cast.py ---
#===============================================================#
# ) (\_ | WOLFPACK 13.0.0 Scripts #
# (( _/{ "-; | Created by: aszlig #
# )).-' {{ ;'` | Revised by: #
# ( ( ;._ \\ ctr | Last Modification: Created #
#===============================================================#
# cast Command #
#===============================================================#
import wolfpack
from wolfpack.magic import *
def CmdCast( socket, command, args ):
try:
args = int( args );
except:
socket.sysmessage( "Usage: cast <spell-id>" )
castSpell( socket.player, args )
return OK
def onLoad():
wolfpack.registercommand( "cast", CmdCast )
|
|
From: <as...@us...> - 2004-01-22 04:33:19
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1:/tmp/cvs-serv6017/definitions Modified Files: scripts.xml Log Message: included magic scripts Index: scripts.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/scripts.xml,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** scripts.xml 22 Jan 2004 03:52:22 -0000 1.71 --- scripts.xml 22 Jan 2004 04:33:16 -0000 1.72 *************** *** 39,42 **** --- 39,43 ---- <script>wolfpack.commands.action</script> <script>wolfpack.commands.bank</script> + <script>wolfpack.commands.cast</script> <script>wolfpack.commands.decoration</script> <script>wolfpack.commands.export</script> *************** *** 54,61 **** <script>runebook</script> <script>scroll</script> ! <script>spells</script> <script>wolfpack.magic.reactivearmor</script> <script>wolfpack.magic.trap</script> ! <script>spells.circle4.firefield</script> <script>spells.circle1</script> <script>spells.circle2</script> --- 55,73 ---- <script>runebook</script> <script>scroll</script> ! <!--<script>spells</script>--> ! <script>wolfpack.magic</script> ! <script>wolfpack.magic.spell</script> ! <script>wolfpack.magic.circle1</script> ! <script>wolfpack.magic.circle2</script> ! <script>wolfpack.magic.circle3</script> ! <script>wolfpack.magic.circle4</script> ! <script>wolfpack.magic.circle5</script> ! <script>wolfpack.magic.circle6</script> ! <script>wolfpack.magic.circle7</script> ! <script>wolfpack.magic.circle8</script> ! <script>wolfpack.magic.firefield</script> <script>wolfpack.magic.reactivearmor</script> <script>wolfpack.magic.trap</script> ! <!--<script>spells.circle4.firefield</script> <script>spells.circle1</script> <script>spells.circle2</script> *************** *** 65,69 **** <script>spells.circle6</script> <script>spells.circle7</script> ! <script>spells.circle8</script> <!-- Multis --> --- 77,81 ---- <script>spells.circle6</script> <script>spells.circle7</script> ! <script>spells.circle8</script>--> <!-- Multis --> |
|
From: <as...@us...> - 2004-01-22 04:31:54
|
Update of /cvsroot/wpdev/xmlscripts In directory sc8-pr-cvs1:/tmp/cvs-serv5550 Modified Files: definitions.xml Log Message: added reagends (wtf removed them?) Index: definitions.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions.xml,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** definitions.xml 27 Dec 2003 20:45:48 -0000 1.60 --- definitions.xml 22 Jan 2004 04:31:51 -0000 1.61 *************** *** 96,99 **** --- 96,100 ---- <include file="definitions/items/equipment/misc.xml"/> <include file="definitions/items/equipment/potions.xml"/> + <include file="definitions/items/equipment/reagents.xml"/> <include file="definitions/items/misc/animations.xml"/> <include file="definitions/items/misc/figurines.xml"/> |
|
From: <dar...@us...> - 2004-01-22 04:06:15
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1:/tmp/cvs-serv1785 Modified Files: access.xml Log Message: Modified the plevels for existing ACLs. Index: access.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/access.xml,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** access.xml 1 Oct 2003 10:10:33 -0000 1.6 --- access.xml 22 Jan 2004 04:06:07 -0000 1.7 *************** *** 9,13 **** <definitions> <!-- Default Player privs --> ! <acl id="player"> <group name="command"> <action name="WHERE" permit="true" /> --- 9,13 ---- <definitions> <!-- Default Player privs --> ! <acl id="player" plevel="1"> <group name="command"> <action name="WHERE" permit="true" /> *************** *** 20,24 **** <!-- Admin privs --> ! <acl id="admin"> <group name="command"> <action name="any" permit="true" /> --- 20,24 ---- <!-- Admin privs --> ! <acl id="admin" plevel="100"> <group name="command"> <action name="any" permit="true" /> *************** *** 33,37 **** <!-- GameMaster privs --> ! <acl id="gm"> <group name="command"> <action name="any" permit="true" /> --- 33,37 ---- <!-- GameMaster privs --> ! <acl id="gm" plevel="50"> <group name="command"> <action name="any" permit="true" /> *************** *** 43,47 **** <!-- Counselor privs --> ! <acl id="counselor"> <group name="command"> <action name="any" permit="true" /> --- 43,47 ---- <!-- Counselor privs --> ! <acl id="counselor" plevel="25"> <group name="command"> <action name="any" permit="true" /> |
|
From: <dar...@us...> - 2004-01-22 04:03:24
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv1379/python
Modified Files:
char.cpp
Log Message:
Allowed python access to the plevel from character objects as well. Makes it easier...
Index: char.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/char.cpp,v
retrieving revision 1.111
retrieving revision 1.112
diff -C2 -d -r1.111 -r1.112
*** char.cpp 25 Nov 2003 19:41:30 -0000 1.111
--- char.cpp 22 Jan 2004 04:03:21 -0000 1.112
***************
*** 1742,1750 ****
P_PLAYER player = dynamic_cast<P_PLAYER>( self->pChar );
! if ( !player )
return PyFalse;
return player->isGM() ? PyTrue : PyFalse;
! }
! else if( !strcmp( "region", name ) )
return PyGetRegionObject( self->pChar->region() );
--- 1742,1763 ----
P_PLAYER player = dynamic_cast<P_PLAYER>( self->pChar );
! if (!player)
return PyFalse;
+
return player->isGM() ? PyTrue : PyFalse;
! } else if (!strcmp("plevel", name)) {
! P_PLAYER player = dynamic_cast<P_PLAYER>( self->pChar );
!
! if (!player)
! return PyInt_FromLong(1);
!
! cAccount *account = player->account();
!
! if (account) {
! return PyInt_FromLong(account->plevel());
! } else {
! return PyInt_FromLong(1);
! }
! } else if( !strcmp( "region", name ) )
return PyGetRegionObject( self->pChar->region() );
|
|
From: <dar...@us...> - 2004-01-22 03:59:01
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv524/python
Modified Files:
pyaccount.cpp
Log Message:
Allowed python access to the plevel too.
Index: pyaccount.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/pyaccount.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** pyaccount.cpp 9 Sep 2003 23:09:31 -0000 1.18
--- pyaccount.cpp 22 Jan 2004 03:58:58 -0000 1.19
***************
*** 223,228 ****
return PyFalse;
}
! else
return Py_FindMethod( wpAccountMethods, (PyObject*)self, name );
}
--- 223,231 ----
return PyFalse;
}
! else if(!strcmp(name,"plevel")) {
! return PyInt_FromLong(self->account->plevel());
! } else {
return Py_FindMethod( wpAccountMethods, (PyObject*)self, name );
+ }
}
|
|
From: <dar...@us...> - 2004-01-22 03:57:30
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv348
Modified Files:
accounts.cpp accounts.h commands.cpp commands.h
Log Message:
Added a numeric plevel to ACLs.
Index: accounts.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -d -r1.73 -r1.74
*** accounts.cpp 21 Jan 2004 22:14:07 -0000 1.73
--- accounts.cpp 22 Jan 2004 03:57:26 -0000 1.74
***************
*** 226,229 ****
--- 226,237 ----
}
+ unsigned char cAccount::plevel() const {
+ if (acl_) {
+ return acl_->plevel;
+ } else {
+ return 1;
+ }
+ }
+
/*****************************************************************************
cAccounts member functions
Index: accounts.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/accounts.h,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** accounts.h 21 Jan 2004 22:14:07 -0000 1.33
--- accounts.h 22 Jan 2004 03:57:26 -0000 1.34
***************
*** 79,84 ****
QString login() const;
-
QString password() const;
void remove();
void setPassword( const QString& );
--- 79,84 ----
QString login() const;
QString password() const;
+ unsigned char plevel() const;
void remove();
void setPassword( const QString& );
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.212
retrieving revision 1.213
diff -C2 -d -r1.212 -r1.213
*** commands.cpp 21 Jan 2004 22:14:07 -0000 1.212
--- commands.cpp 22 Jan 2004 03:57:26 -0000 1.213
***************
*** 156,163 ****
QString ACLname = *it;
!
// While we are in this loop we are building an ACL
cAcl *acl = new cAcl;
acl->name = ACLname;
QMap< QString, bool > group;
QString groupName;
--- 156,168 ----
QString ACLname = *it;
!
// While we are in this loop we are building an ACL
cAcl *acl = new cAcl;
acl->name = ACLname;
+ acl->plevel = Tag->getAttribute("plevel", "1").toUShort();
+ if (acl->plevel == 0 || acl->plevel == 255) {
+ acl->plevel = 1;
+ }
+
QMap< QString, bool > group;
QString groupName;
Index: commands.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** commands.h 11 Jan 2004 04:54:07 -0000 1.16
--- commands.h 22 Jan 2004 03:57:27 -0000 1.17
***************
*** 53,56 ****
--- 53,57 ----
public:
QString name;
+ unsigned char plevel;
QMap< QString, QMap< QString, bool > > groups;
};
|
|
From: <dar...@us...> - 2004-01-22 03:52:26
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1:/tmp/cvs-serv32133 Modified Files: scripts.xml Log Message: Added a file for keys and added the 'lock command. Index: scripts.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/scripts.xml,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** scripts.xml 25 Nov 2003 18:54:12 -0000 1.70 --- scripts.xml 22 Jan 2004 03:52:22 -0000 1.71 *************** *** 33,36 **** --- 33,37 ---- <script>equipment</script> <script>bandages</script> + <script>key</script> <!-- Commands --> |
|
From: <dar...@us...> - 2004-01-22 03:52:26
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/misc In directory sc8-pr-cvs1:/tmp/cvs-serv32133/items/misc Modified Files: misc.xml Log Message: Added a file for keys and added the 'lock command. Index: misc.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/misc/misc.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** misc.xml 3 Oct 2003 17:54:22 -0000 1.7 --- misc.xml 22 Jan 2004 03:52:21 -0000 1.8 *************** *** 150,153 **** --- 150,154 ---- <type>7</type> <category>Misc\Keys\Copper Key</category> + <events>key</events> </item> *************** *** 156,159 **** --- 157,161 ---- <type>7</type> <category>Misc\Keys\Gold Key</category> + <events>key</events> </item> *************** *** 162,165 **** --- 164,168 ---- <type>7</type> <category>Misc\Keys\Iron Key</category> + <events>key</events> </item> *************** *** 188,191 **** --- 191,195 ---- <type>7</type> <category>Misc\Keys\Magic Key</category> + <events>key</events> </item> *************** *** 194,197 **** --- 198,202 ---- <type>7</type> <category>Misc\Keys\Rusty Iron Key</category> + <events>key</events> </item> |
|
From: <dar...@us...> - 2004-01-22 03:51:25
|
Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv31985
Modified Files:
lock.py tooltip.py
Added Files:
key.py
Log Message:
Added a file for keys and added the 'lock command.
--- NEW FILE: key.py ---
# TODO: implementation of renaming and unlocking/locking etc.
import wolfpack
import wolfpack.gumps
def onLoad():
pass
def onUse(char, key):
char.message('A shiny key!')
return 1
def onShowTooltip(char, item, tooltip):
tooltip.add(0xF9060 + item.id, '')
# Add the lock id for gms
if char.gm:
lock = 'None'
if item.hastag('lock'):
lock = str(item.gettag('lock'))
tooltip.add(1050045, " \t" + "Lock: " + lock + "\t ")
tooltip.send(char)
# We still should apply the default handling
return 1
Index: lock.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/lock.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** lock.py 8 Oct 2003 01:42:07 -0000 1.1
--- lock.py 22 Jan 2004 03:51:22 -0000 1.2
***************
*** 1,3 ****
--- 1,98 ----
+ import wolfpack
+ from wolfpack.gumps import cGump
+ import random
+
+ def gump_response(char, args, response):
+ # Add a lock to this item
+ if response.button == 1 and len(args) == 1:
+ item = wolfpack.finditem(args[0])
+
+ if item:
+ # 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
+ item.settag('lock', response.text[1])
+
+ char.socket.sysmessage('Added the lock to the item.')
+
+ # Should we create a key in the backpack of the user?
+ if 1 in response.switches:
+ keys = ['100e', '100f', '1010', '1013']
+ key = wolfpack.additem(random.choice(keys))
+ key.settag('lock', response.text[1])
+ key.container = char.getbackpack()
+ key.update()
+
+ char.socket.sysmessage('A key has been added to your backpack.')
+
+ return
+
+ def lock_response(char, args, target):
+ # Check if an item was targetted
+ if not target.item:
+ char.socket.sysmessage('You have to target an item.')
+ return
+
+ # Build the lock gump
+ gump = cGump(x=100, y=100, callback="lock.gump_response")
+ gump.setArgs([target.item.serial])
+
+ # Check if the item already has a lock
+ if 'lock' in target.item.events and target.item.hastag('lock'):
+ gump.addBackground(id=0x2436, width=450, height=350)
+
+ lock = str(target.item.gettag('lock'))
+ locked = 0
+ if target.item.hastag('locked') and int(target.item.gettag('locked')) != 0:
+ locked = 1
+
+ text = '<basefont color="#FECECE"><h3>Manage Lock</h3><br><basefont color="#FEFEFE">This dialog will help you to manage the lock of this item.'
+ gump.addHtmlGump(x=20, y=20, width=410, height=200, html=text)
+
+ # The targetted item is unlocked
+ else:
+ gump.addBackground(id=0x2436, width=425, height=285)
+
+ text = '<basefont color="#FECECE"><h3>Add Lock</h3><br><basefont color="#FEFEFE">This dialog will help you to add a lock to this item.Please enter a unique identifier for this lock. The lock has to share the same identifier with any key that is supposed to fit.'
+ gump.addHtmlGump(x=20, y=20, width=390, height=200, html=text)
+
+ # Create a random key id (several characters are excluded that can be easily mistaken for something else)
+ parts = ['A','B','C','D','E','F','G','H','J','K','L','M','N','P','Q','R','S','T','U','V','W','X','Y','Z','2','3','4','5','6','7','8','9']
+ rkeyid = ''
+
+ for i in range(1,8):
+ rkeyid += random.choice(parts)
+
+ # InputField for the key id
+ gump.addText(x=20, y=105, text='Please enter an id for this lock:', hue=0x835)
+ gump.addResizeGump(x=20, y=128, id=0xBB8, width=160, height=25)
+ gump.addInputField(x=25, y=130, width=150, height=20, hue=0x834, id=1, starttext=rkeyid)
+
+ # "Create a key in my backpack"
+ gump.addCheckbox(x=20, y=167, off=0x25f8, on=0x25fb, id=1)
+ gump.addText(x=55, y=171, text='Create a key in my backpack.', hue=0x835)
+
+ # Add Button
+ gump.addText( x=50, y=212, text='Add lock', hue=0x835 )
+ gump.addButton( x=20, y=212, up=0x26af, down=0x26b1, returncode=1 )
+
+ gump.addText( x=50, y=242, text='Cancel', hue=0x835 )
+ gump.addButton( x=20, y=242, up=0x26af, down=0x26b1, returncode=0 )
+
+ gump.send(char)
+
+ def commandLock( socket, command, arguments ):
+ # Select a target you want to edit.
+ socket.sysmessage("Select a target you want to modify.")
+ socket.attachtarget("lock.lock_response")
+
+ def onLoad():
+ wolfpack.registercommand("lock", commandLock)
+
#
# Event for Locking Items
***************
*** 12,19 ****
if lock != 'magic':
! lock = int( lock )
!
! if item.hastag( 'locked' ):
! locked = int( item.gettag( 'locked' ) )
else:
locked = 0
--- 107,112 ----
if lock != 'magic':
! if item.hastag('locked'):
! locked = int(item.gettag('locked'))
else:
locked = 0
***************
*** 25,33 ****
backpack = char.getbackpack()
! if searchkey( backpack, lock ):
if 'door' in events:
! char.message( 501282 ) # quickly open / relock
return 0
! char.message( 502503 ) # Thats locked
return 1
--- 118,126 ----
backpack = char.getbackpack()
! if searchkey(backpack, lock):
if 'door' in events:
! char.message(501282) # quickly open / relock
return 0
! char.message(502503) # Thats locked
return 1
Index: tooltip.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/tooltip.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** tooltip.py 29 Dec 2003 13:33:12 -0000 1.12
--- tooltip.py 22 Jan 2004 03:51:22 -0000 1.13
***************
*** 46,49 ****
--- 46,58 ----
modifiers( target, tooltip )
+
+ # If the character is a gm and the targetted item has a lock, display the lock id
+ if sender.gm and 'lock' in target.events:
+ lock = 'None'
+
+ if target.hastag('lock'):
+ lock = str(target.gettag('lock'))
+
+ tooltip.add(1050045, " \t" + "Lock: " + lock + "\t ")
if isspellbook( target ):
***************
*** 54,58 ****
tooltip.send( sender )
-
return 1
--- 63,66 ----
***************
*** 126,130 ****
params = str( target.gettag( tagname ) )
tooltip.add( modifiers[ tagname ][0], params )
!
--- 134,138 ----
params = str( target.gettag( tagname ) )
tooltip.add( modifiers[ tagname ][0], params )
!
|
|
From: <thi...@us...> - 2004-01-22 01:09:37
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv3659
Modified Files:
pythonscript.cpp pythonscript.h
Log Message:
Should automatically unload if deleted
Index: pythonscript.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** pythonscript.cpp 23 Sep 2003 12:40:18 -0000 1.12
--- pythonscript.cpp 22 Jan 2004 01:09:27 -0000 1.13
***************
*** 29,40 ****
//==================================================================================
- #include <qglobal.h>
-
- #if defined (Q_OS_UNIX)
- #include <limits.h> //compatability issue. GCC 2.96 doesn't have limits include
- #else
- #include <limits> // Python tries to redefine some of this stuff, so include first
- #endif
-
#include "pythonscript.h"
#include "globals.h"
--- 29,32 ----
***************
*** 45,48 ****
--- 37,41 ----
// Library Includes
#include <qfile.h>
+ #include <qglobal.h>
// Extension includes
***************
*** 50,54 ****
#include "python/target.h"
! cPythonScript::cPythonScript()
{
codeModule = 0;
--- 43,47 ----
#include "python/target.h"
! cPythonScript::cPythonScript() : loaded(false)
{
codeModule = 0;
***************
*** 59,66 ****
--- 52,62 ----
cPythonScript::~cPythonScript()
{
+ if ( loaded )
+ unload();
}
void cPythonScript::unload( void )
{
+ loaded = false;
// Free Cached Events
for( unsigned int i = 0; i < EVENT_COUNT; ++i )
***************
*** 127,135 ****
}
}
!
return true;
}
! PyObject *cPythonScript::callEvent( ePythonEvent event, PyObject *args, bool ignoreErrors )
{
PyObject *result = 0;
--- 123,136 ----
}
}
! loaded = true;
return true;
}
! bool cPythonScript::isLoaded() const
! {
! return loaded;
! }
!
! PyObject* cPythonScript::callEvent( ePythonEvent event, PyObject *args, bool ignoreErrors )
{
PyObject *result = 0;
***************
*** 146,150 ****
}
! PyObject *cPythonScript::callEvent( const QString &name, PyObject *args, bool ignoreErrors )
{
PyObject *result = 0;
--- 147,151 ----
}
! PyObject* cPythonScript::callEvent( const QString &name, PyObject *args, bool ignoreErrors )
{
PyObject *result = 0;
***************
*** 180,186 ****
}
! bool cPythonScript::callEventHandler( const QString &name, PyObject *args, bool ignoreErrors )
{
! PyObject *result = callEvent( name, args, ignoreErrors );
bool handled = false;
--- 181,187 ----
}
! bool cPythonScript::callEventHandler( const QString &name, PyObject* args, bool ignoreErrors )
{
! PyObject* result = callEvent( name, args, ignoreErrors );
bool handled = false;
***************
*** 196,200 ****
// Standard Handler for Python ScriptChains assigned to objects
! bool cPythonScript::callChainedEventHandler( ePythonEvent event, cPythonScript **chain, PyObject *args )
{
bool handled = false;
--- 197,201 ----
// Standard Handler for Python ScriptChains assigned to objects
! bool cPythonScript::callChainedEventHandler( ePythonEvent event, cPythonScript** chain, PyObject* args )
{
bool handled = false;
***************
*** 276,280 ****
}
}
-
return result;
}
--- 277,280 ----
Index: pythonscript.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** pythonscript.h 24 Nov 2003 20:27:27 -0000 1.11
--- pythonscript.h 22 Jan 2004 01:09:27 -0000 1.12
***************
*** 137,140 ****
--- 137,141 ----
protected:
QString name_; // Important!
+ bool loaded;
PyObject *codeModule; // This object stores the compiled Python Module
PyObject *events[EVENT_COUNT];
***************
*** 150,153 ****
--- 151,155 ----
bool load( const cElement *element );
void unload( void );
+ bool isLoaded() const;
static bool canChainHandleEvent( ePythonEvent event, cPythonScript **chain );
|
|
From: <as...@us...> - 2004-01-21 22:45:28
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/professions In directory sc8-pr-cvs1:/tmp/cvs-serv6446/professions Modified Files: alchemist.xml Log Message: splitted up Index: alchemist.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/professions/alchemist.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** alchemist.xml 19 Jan 2004 18:22:19 -0000 1.8 --- alchemist.xml 21 Jan 2004 22:45:25 -0000 1.9 *************** *** 254,415 **** </item> <item id="1829"> <id>0x1829</id> ! <category>Professions\Alchemist\Flask Stand</category> </item> <item id="182a"> <id>0x182a</id> ! <category>Professions\Alchemist\Flask 1</category> </item> <item id="182b"> <id>0x182b</id> ! <category>Professions\Alchemist\Flask 2</category> </item> <item id="182c"> <id>0x182c</id> ! <category>Professions\Alchemist\Flask 3</category> </item> <item id="182d"> <id>0x182d</id> ! <category>Professions\Alchemist\Flask 4</category> ! </item> ! ! <item id="182e"> ! <id>0x182e</id> ! <category>Professions\Alchemist\Flask 5</category> ! </item> ! ! <item id="182f"> ! <id>0x182f</id> ! <category>Professions\Alchemist\Flask 6</category> ! </item> ! ! <item id="1830"> ! <id>0x1830</id> ! <category>Professions\Alchemist\Flask 7</category> ! </item> ! ! <item id="1831"> ! <id>0x1831</id> ! <category>Professions\Alchemist\Flask 8</category> ! </item> ! ! <item id="1832"> ! <id>0x1832</id> ! <category>Professions\Alchemist\Flask 9</category> ! </item> ! ! <item id="1833"> ! <id>0x1833</id> ! <category>Professions\Alchemist\Flask 10</category> ! </item> ! ! <item id="1834"> ! <id>0x1834</id> ! <category>Professions\Alchemist\Flask 11</category> ! </item> ! ! <item id="1835"> ! <id>0x1835</id> ! <category>Professions\Alchemist\Flask 12</category> ! </item> ! ! <item id="1836"> ! <id>0x1836</id> ! <category>Professions\Alchemist\Flask 13</category> ! </item> ! ! <item id="1837"> ! <id>0x1837</id> ! <category>Professions\Alchemist\Flask 14</category> ! </item> ! ! <item id="1838"> ! <id>0x1838</id> ! <category>Professions\Alchemist\Flask 15</category> ! </item> ! ! <item id="1839"> ! <id>0x1839</id> ! <category>Professions\Alchemist\Flask 16</category> ! </item> ! ! <item id="183a"> ! <id>0x183a</id> ! <category>Professions\Alchemist\Flask 17</category> ! </item> ! ! <item id="183b"> ! <id>0x183b</id> ! <category>Professions\Alchemist\Flask 18</category> ! </item> ! ! <item id="183c"> ! <id>0x183c</id> ! <category>Professions\Alchemist\Flask 19</category> ! </item> ! ! <item id="183d"> ! <id>0x183d</id> ! <category>Professions\Alchemist\Flask 20</category> ! </item> ! ! <item id="183e"> ! <id>0x183e</id> ! <category>Professions\Alchemist\Flask 21</category> ! </item> ! ! <item id="183f"> ! <id>0x183f</id> ! <category>Professions\Alchemist\Flask 22</category> ! </item> ! ! <item id="1840"> ! <id>0x1840</id> ! <category>Professions\Alchemist\Flask 23</category> ! </item> ! ! <item id="1841"> ! <id>0x1841</id> ! <category>Professions\Alchemist\Flask 24</category> ! </item> ! ! <item id="1842"> ! <id>0x1842</id> ! <category>Professions\Alchemist\Flask 25</category> ! </item> ! ! <item id="1843"> ! <id>0x1843</id> ! <category>Professions\Alchemist\Flask 26</category> ! </item> ! ! <item id="1844"> ! <id>0x1844</id> ! <category>Professions\Alchemist\Flask 27</category> ! </item> ! ! <item id="1845"> ! <id>0x1845</id> ! <category>Professions\Alchemist\Flask 28</category> ! </item> ! ! <item id="1846"> ! <id>0x1846</id> ! <category>Professions\Alchemist\Flask 29</category> ! </item> ! ! <item id="1847"> ! <id>0x1847</id> ! <category>Professions\Alchemist\Flask 30</category> ! </item> ! ! <item id="1848"> ! <id>0x1848</id> ! <category>Professions\Alchemist\Flask 31</category> </item> --- 254,416 ---- </item> + <!-- Flask --> <item id="1829"> <id>0x1829</id> ! <category>Professions\Alchemist\Flask\Flask Stand</category> </item> <item id="182a"> <id>0x182a</id> ! <category>Professions\Alchemist\Flask\Flask 1</category> </item> <item id="182b"> <id>0x182b</id> ! <category>Professions\Alchemist\Flask\Flask 2</category> </item> <item id="182c"> <id>0x182c</id> ! <category>Professions\Alchemist\Flask\Flask 3</category> </item> <item id="182d"> <id>0x182d</id> ! <category>Professions\Alchemist\Flask\Flask 4</category> ! </item> ! ! <item id="182e"> ! <id>0x182e</id> ! <category>Professions\Alchemist\Flask\Flask 5</category> ! </item> ! ! <item id="182f"> ! <id>0x182f</id> ! <category>Professions\Alchemist\Flask\Flask 6</category> ! </item> ! ! <item id="1830"> ! <id>0x1830</id> ! <category>Professions\Alchemist\Flask\Flask 7</category> ! </item> ! ! <item id="1831"> ! <id>0x1831</id> ! <category>Professions\Alchemist\Flask\Flask 8</category> ! </item> ! ! <item id="1832"> ! <id>0x1832</id> ! <category>Professions\Alchemist\Flask\Flask 9</category> ! </item> ! ! <item id="1833"> ! <id>0x1833</id> ! <category>Professions\Alchemist\Flask\Flask 10</category> ! </item> ! ! <item id="1834"> ! <id>0x1834</id> ! <category>Professions\Alchemist\Flask\Flask 11</category> ! </item> ! ! <item id="1835"> ! <id>0x1835</id> ! <category>Professions\Alchemist\Flask\Flask 12</category> ! </item> ! ! <item id="1836"> ! <id>0x1836</id> ! <category>Professions\Alchemist\Flask\Flask 13</category> ! </item> ! ! <item id="1837"> ! <id>0x1837</id> ! <category>Professions\Alchemist\Flask\Flask 14</category> ! </item> ! ! <item id="1838"> ! <id>0x1838</id> ! <category>Professions\Alchemist\Flask\Flask 15</category> ! </item> ! ! <item id="1839"> ! <id>0x1839</id> ! <category>Professions\Alchemist\Flask\Flask 16</category> ! </item> ! ! <item id="183a"> ! <id>0x183a</id> ! <category>Professions\Alchemist\Flask\Flask 17</category> ! </item> ! ! <item id="183b"> ! <id>0x183b</id> ! <category>Professions\Alchemist\Flask\Flask 18</category> ! </item> ! ! <item id="183c"> ! <id>0x183c</id> ! <category>Professions\Alchemist\Flask\Flask 19</category> ! </item> ! ! <item id="183d"> ! <id>0x183d</id> ! <category>Professions\Alchemist\Flask\Flask 20</category> ! </item> ! ! <item id="183e"> ! <id>0x183e</id> ! <category>Professions\Alchemist\Flask\Flask 21</category> ! </item> ! ! <item id="183f"> ! <id>0x183f</id> ! <category>Professions\Alchemist\Flask\Flask 22</category> ! </item> ! ! <item id="1840"> ! <id>0x1840</id> ! <category>Professions\Alchemist\Flask\Flask 23</category> ! </item> ! ! <item id="1841"> ! <id>0x1841</id> ! <category>Professions\Alchemist\Flask\Flask 24</category> ! </item> ! ! <item id="1842"> ! <id>0x1842</id> ! <category>Professions\Alchemist\Flask\Flask 25</category> ! </item> ! ! <item id="1843"> ! <id>0x1843</id> ! <category>Professions\Alchemist\Flask\Flask 26</category> ! </item> ! ! <item id="1844"> ! <id>0x1844</id> ! <category>Professions\Alchemist\Flask\Flask 27</category> ! </item> ! ! <item id="1845"> ! <id>0x1845</id> ! <category>Professions\Alchemist\Flask\Flask 28</category> ! </item> ! ! <item id="1846"> ! <id>0x1846</id> ! <category>Professions\Alchemist\Flask\Flask 29</category> ! </item> ! ! <item id="1847"> ! <id>0x1847</id> ! <category>Professions\Alchemist\Flask\Flask 30</category> ! </item> ! ! <item id="1848"> ! <id>0x1848</id> ! <category>Professions\Alchemist\Flask\Flask 31</category> </item> |
|
From: <as...@us...> - 2004-01-21 22:45:28
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/buildings
In directory sc8-pr-cvs1:/tmp/cvs-serv6446/buildings
Modified Files:
banners.xml furniture.xml
Log Message:
splitted up
Index: banners.xml
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/buildings/banners.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** banners.xml 27 Sep 2003 19:49:13 -0000 1.3
--- banners.xml 21 Jan 2004 22:45:25 -0000 1.4
***************
*** 13,732 ****
<item id="1586">
<id>0x1586</id> <nodecay />
! <category>Decoration\Banners\Banner 1 (W/E) 1</category>
</item>
<item id="1587">
<id>0x1587</id> <nodecay />
! <category>Decoration\Banners\Banner 1 (W/E) 2</category>
</item>
[...1434 lines suppressed...]
<id>0x158f</id> <nodecay />
! <category>Decoration\Banners\Banner Hanger (W/E)</category>
</item>
<item id="1626">
<id>0x1626</id> <nodecay />
! <category>Decoration\Banners\Banner Hanger (N/S)</category>
</item>
</definitions>
--- 734,743 ----
<item id="158f">
<id>0x158f</id> <nodecay />
! <category>Decoration\Banners\Banner Hanger\Banner Hanger (W/E)</category>
</item>
<item id="1626">
<id>0x1626</id> <nodecay />
! <category>Decoration\Banners\Banner Hanger\Banner Hanger (N/S)</category>
</item>
</definitions>
Index: furniture.xml
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/buildings/furniture.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** furniture.xml 27 Sep 2003 19:49:13 -0000 1.8
--- furniture.xml 21 Jan 2004 22:45:25 -0000 1.9
***************
*** 218,719 ****
<!-- Decoration / Bedroom -->
<item id="a55">
<id>0x0a55</id> <nodecay />
! <category>Decoration\Bedroom\Bedroll 1 (W/E) (Open)</category>
</item>
<item id="a56">
<id>0x0a56</id> <nodecay />
! <category>Decoration\Bedroom\Bedroll 1 (N/S) (Open)</category>
[...2036 lines suppressed...]
<item id="1dc3">
<id>0x1dc3</id> <nodecay />
! <category>Decoration\Tables\Marble Table\Marble Table (N/S) (2/3)</category>
</item>
<item id="1dc4">
<id>0x1dc4</id> <nodecay />
! <category>Decoration\Tables\Marble Table\Marble Table (W/E) (1/3)</category>
</item>
<item id="1dc5">
<id>0x1dc5</id> <nodecay />
! <category>Decoration\Tables\Marble Table\Marble Table (W/E) (3/3)</category>
</item>
<item id="1dc6">
<id>0x1dc6</id> <nodecay />
! <category>Decoration\Tables\Marble Table\Marble Table (W/E) (2/3)</category>
</item>
|