Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv29459
Modified Files:
basechar.cpp basechar.h pythonscript.cpp pythonscript.h
Log Message:
custom houses
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** basechar.cpp 15 Sep 2003 19:56:23 -0000 1.44
--- basechar.cpp 16 Sep 2003 18:15:24 -0000 1.45
***************
*** 1221,1227 ****
return false;
}
! bool cBaseChar::onCHLevelChange( SERIAL multi_serial )
{
! cMulti* multi = dynamic_cast< cMulti* >( FindItemBySerial( multi_serial ) );
return false;
}
--- 1221,1248 ----
return false;
}
! bool cBaseChar::onCHLevelChange( uint level )
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onCHLevelChange( this, level ) )
! return true;
!
! ++i;
! }
! }
!
! // Try to process the hooks then
! QValueVector< cPythonScript* > hooks;
! QValueVector< cPythonScript* >::const_iterator it;
!
! hooks = ScriptManager->getGlobalHooks( OBJECT_CHAR, EVENT_CHLEVELCHANGE );
! for( it = hooks.begin(); it != hooks.end(); ++it )
! if( (*it)->onCHLevelChange( this, level ) )
! return true;
!
!
return false;
}
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** basechar.h 15 Sep 2003 19:56:23 -0000 1.35
--- basechar.h 16 Sep 2003 18:15:24 -0000 1.36
***************
*** 170,174 ****
QString onShowPaperdollName( P_CHAR pOrigin ); // only change the viewed name
virtual bool onShowTooltip( P_PLAYER sender, cUOTxTooltipList* tooltip ); // Shows a tool tip for specific object
! virtual bool onCHLevelChange( SERIAL multi_serial ); // Fired when player moving trough levels
bool onSkillGain( UI08 Skill, SI32 min, SI32 max, bool success );
bool onStatGain( UI08 stat, SI08 amount );
--- 170,174 ----
QString onShowPaperdollName( P_CHAR pOrigin ); // only change the viewed name
virtual bool onShowTooltip( P_PLAYER sender, cUOTxTooltipList* tooltip ); // Shows a tool tip for specific object
! virtual bool onCHLevelChange( uint level ); // Fired when player moving trough levels
bool onSkillGain( UI08 Skill, SI32 min, SI32 max, bool success );
bool onStatGain( UI08 stat, SI08 amount );
Index: pythonscript.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.cpp,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** pythonscript.cpp 8 Sep 2003 10:58:47 -0000 1.9
--- pythonscript.cpp 16 Sep 2003 18:15:24 -0000 1.10
***************
*** 387,390 ****
--- 387,402 ----
}
+ bool cPythonScript::onCHLevelChange( P_CHAR pChar, uint level )
+ {
+ PyHasMethod( "onCHLevelChange" )
+
+ PyObject *tuple = PyTuple_New( 2 );
+ PyTuple_SetItem( tuple, 0, PyGetCharObject( pChar ) );
+ PyTuple_SetItem( tuple, 1, PyInt_FromLong( level ) );
+
+ return PyEvalMethod( "onCHLevelChange", tuple );
+ }
+
+
unsigned int cPythonScript::onDamage( P_CHAR pChar, unsigned char type, unsigned int amount, cUObject *source )
{
Index: pythonscript.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** pythonscript.h 30 Aug 2003 17:00:09 -0000 1.7
--- pythonscript.h 16 Sep 2003 18:15:24 -0000 1.8
***************
*** 112,115 ****
--- 112,117 ----
bool onShowToolTip( P_CHAR pChar, cUObject *pObject, cUOTxTooltipList* tooltip );
+ bool onCHLevelChange( P_CHAR pChar, uint level );
+
bool onSpeech( cUObject *listener, P_CHAR talker, const QString &text, const QValueVector< UINT16 >& keywords );
|