Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv3205/src
Modified Files:
commands.cpp dragdrop.cpp items.cpp targetrequests.cpp
targetrequests.h wolf.dsp wolfpack.cpp wolfpack.pro
Removed Files:
spellbook.cpp spellbook.h
Log Message:
Moved Spellbook from Code to Python
Index: commands.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v
retrieving revision 1.192
retrieving revision 1.193
diff -C2 -d -r1.192 -r1.193
*** commands.cpp 9 Jul 2003 20:23:16 -0000 1.192
--- commands.cpp 26 Jul 2003 01:10:54 -0000 1.193
***************
*** 52,56 ****
#include "resources.h"
#include "contextmenu.h"
- #include "spellbook.h"
#include "pythonscript.h"
--- 52,55 ----
***************
*** 988,1034 ****
}
- void commandAddSpell( cUOSocket *socket, const QString &command, QStringList &args ) throw()
- {
- Q_UNUSED(command);
- bool ok = false;
- UINT8 spell = 0;
-
- if( args.count() > 0 )
- spell = args[0].toUInt( &ok );
-
- // Get the spellid
- if( !ok )
- {
- socket->sysMessage( tr( "Usage: addspell <spell-id>" ) );
- return;
- }
-
-
- socket->sysMessage( tr( "Please select the spellbook you want to add this spell to." ) );
- socket->attachTarget( new cModifySpellbook( spell, false ) );
- }
-
- void commandRemoveSpell( cUOSocket *socket, const QString &command, QStringList &args ) throw()
- {
- Q_UNUSED(command);
- bool ok = false;
- UINT8 spell = 0;
-
- if( args.count() > 0 )
- spell = args[0].toUInt( &ok );
-
- // Get the spellid
- if( !ok )
- {
- socket->sysMessage( tr( "Usage: removespell <spell-id>" ) );
- return;
- }
-
-
- socket->sysMessage( tr( "Please select the spellbook you want to remove this spell from." ) );
- socket->attachTarget( new cModifySpellbook( spell, true ) );
- }
-
-
void commandAddEvent( cUOSocket *socket, const QString &command, QStringList &args ) throw()
{
--- 987,990 ----
***************
*** 1320,1324 ****
{ "ADDITEM", commandAddItem },
{ "ADDNPC", commandAddNpc },
- { "ADDSPELL", commandAddSpell },
{ "ALLMOVE", commandAllMove },
{ "ALLSHOW", commandAllShow },
--- 1276,1279 ----
***************
*** 1340,1344 ****
{ "REMOVE", commandRemove },
{ "REMOVEEVENT", commandRemoveEvent },
- { "REMOVESPELL", commandRemoveSpell },
{ "RESEND", commandResend },
{ "RESTOCK", commandRestock },
--- 1295,1298 ----
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.189
retrieving revision 1.190
diff -C2 -d -r1.189 -r1.190
*** dragdrop.cpp 20 Jul 2003 00:04:51 -0000 1.189
--- dragdrop.cpp 26 Jul 2003 01:10:54 -0000 1.190
***************
*** 45,49 ****
#include "network/uorxpackets.h"
#include "network/uotxpackets.h"
- #include "spellbook.h"
#include "multis.h"
#include "dragdrop.h"
--- 45,48 ----
***************
*** 714,717 ****
--- 713,719 ----
if( pItem->onDropOnItem( pCont ) )
{
+ if( pItem->free )
+ return;
+
if( socket->dragging() )
socket->bounceItem( socket->dragging(), BR_NO_REASON );
***************
*** 721,724 ****
--- 723,729 ----
else if( pCont->onDropOnItem( pItem ) )
{
+ if( pItem->free )
+ return;
+
if( socket->dragging() )
socket->bounceItem( socket->dragging(), BR_NO_REASON );
***************
*** 783,821 ****
socket->sysMessage( tr( "As you let go of the item it disappears." ) );
return;
- }
-
- // Spell Book
- cSpellBook *pBook = dynamic_cast< cSpellBook* >( pCont );
- if( pBook )
- {
- SI08 spellId = calcSpellId( pItem );
-
- if( pItem->type() != 1105 || spellId < 0 )
- {
- socket->sysMessage( tr( "You can only put scrolls into a spellbook" ) );
- socket->bounceItem( pItem, BR_NO_REASON );
- return;
- }
-
- if( pBook->hasSpell( spellId ) )
- {
- socket->sysMessage( tr( "That spellbook already contains this spell" ) );
- socket->bounceItem( pItem, BR_NO_REASON );
- return;
- }
-
- if( pItem->amount() > 1 )
- {
- socket->sysMessage( tr( "You can only put 1 scroll into a spellbook at a time" ) );
- socket->bounceItem( pItem, BR_NO_REASON );
- return;
- }
- else
- {
- pBook->addSpell( spellId );
- Items->DeleItem( pItem );
- pBook->update( socket );
- return;
- }
}
--- 788,791 ----
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.324
retrieving revision 1.325
diff -C2 -d -r1.324 -r1.325
*** items.cpp 21 Jul 2003 00:08:04 -0000 1.324
--- items.cpp 26 Jul 2003 01:10:54 -0000 1.325
***************
*** 51,55 ****
#include "network.h"
#include "multis.h"
- #include "spellbook.h"
#include "persistentbroker.h"
#include "dbdriver.h"
--- 51,54 ----
***************
*** 317,322 ****
case 0x0e80: return 1;
case 0x0e83: return 4;
-
- case 0x0EFA: return 4; // spellbook. Position shouldn't matter, but as it can be opened like a backpack...(Duke)
case 0x2006: return 5; // a corpse/coffin
--- 316,319 ----
***************
*** 1134,1144 ****
nItem = nBook;
- }
- else if( type == "spellbook" )
- {
- cSpellBook *spellBook = new cSpellBook();
- spellBook->Init( true );
- spellBook->applyDefinition( DefSection );
- nItem = spellBook;
}
else
--- 1131,1134 ----
Index: targetrequests.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.cpp,v
retrieving revision 1.68
retrieving revision 1.69
diff -C2 -d -r1.68 -r1.69
*** targetrequests.cpp 20 Jul 2003 00:04:51 -0000 1.68
--- targetrequests.cpp 26 Jul 2003 01:10:54 -0000 1.69
***************
*** 44,48 ****
#include "scriptmanager.h"
#include "pythonscript.h"
- #include "spellbook.h"
#include "books.h"
#include "house.h"
--- 44,47 ----
***************
*** 1056,1107 ****
else
socket->sysMessage( "You need to select either an item or a character" );
- return true;
- }
-
- bool cModifySpellbook::responsed( cUOSocket *socket, cUORxTarget *target )
- {
- if( !socket->player() )
- return true;
-
- // Check if we really targetted a spellbook
- if( isItemSerial( target->serial() ) )
- {
- P_ITEM pItem = FindItemBySerial( target->serial() );
-
- if( pItem )
- {
- cSpellBook *pBook = dynamic_cast< cSpellBook* >( pItem );
-
- if( pBook )
- {
- if( spell >= 64 )
- {
- socket->sysMessage( tr( "The spell id you specified is invalid." ) );
- }
- else
- {
- if( deleteMode )
- {
- pBook->removeSpell( spell );
- pBook->update( socket );
- socket->sysMessage( tr( "You removed spell %1 from this spellbook." ).arg( spell ) );
- }
- else
- {
- pBook->addSpell( spell );
- socket->sysMessage( tr( "You added spell %1 to this spellbook." ).arg( spell ) );
- }
- pBook->update( socket );
- }
- }
- else
- socket->sysMessage( tr( "This is not a valid spellbook." ) );
- }
- else
- socket->sysMessage( tr( "This is not a valid spellbook." ) );
- }
- else
- socket->sysMessage( tr( "This is not a valid spellbook." ) );
-
return true;
}
--- 1055,1058 ----
Index: targetrequests.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -d -r1.39 -r1.40
*** targetrequests.h 17 Jul 2003 09:14:12 -0000 1.39
--- targetrequests.h 26 Jul 2003 01:10:55 -0000 1.40
***************
*** 689,705 ****
};
- class cModifySpellbook: public cTargetRequest
- {
- Q_OBJECT
- private:
- UINT8 spell;
- bool deleteMode;
- public:
- cModifySpellbook( UINT8 _spell, bool _deleteMode = false ) : spell(_spell), deleteMode(_deleteMode) {}
-
- bool responsed( cUOSocket *socket, cUORxTarget *target );
- virtual void canceled( cUOSocket *socket ) { Q_UNUSED(socket); }
- };
-
class cAddEventTarget: public cTargetRequest
{
--- 689,692 ----
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.199
retrieving revision 1.200
diff -C2 -d -r1.199 -r1.200
*** wolf.dsp 22 Jul 2003 17:16:56 -0000 1.199
--- wolf.dsp 26 Jul 2003 01:10:55 -0000 1.200
***************
*** 1,23 ****
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE This is not a valid makefile. To build this project using NMAKE,
! !MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE You can specify a configuration when running NMAKE
! !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Possible choices for configuration are:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (based on "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE
--- 1,23 ----
# Microsoft Developer Studio Project File - Name="wolf" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
! # ** NICHT BEARBEITEN **
# TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=wolf - Win32 Debug
! !MESSAGE Dies ist kein gültiges Makefile. Zum Erstellen dieses Projekts mit NMAKE
! !MESSAGE verwenden Sie den Befehl "Makefile exportieren" und führen Sie den Befehl
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak".
!MESSAGE
! !MESSAGE Sie können beim Ausführen von NMAKE eine Konfiguration angeben
! !MESSAGE durch Definieren des Makros CFG in der Befehlszeile. Zum Beispiel:
!MESSAGE
!MESSAGE NMAKE /f "wolf.mak" CFG="wolf - Win32 Debug"
!MESSAGE
! !MESSAGE Für die Konfiguration stehen zur Auswahl:
!MESSAGE
! !MESSAGE "wolf - Win32 Release" (basierend auf "Win32 (x86) Console Application")
! !MESSAGE "wolf - Win32 Debug" (basierend auf "Win32 (x86) Console Application")
!MESSAGE
***************
*** 26,30 ****
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=xicl6.exe
RSC=rc.exe
--- 26,30 ----
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=cl.exe
RSC=rc.exe
***************
*** 50,54 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.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 /machine:I386
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib flatstore.lib /nologo /subsystem:console /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"D:\wolfpack\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
--- 50,54 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! 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 /machine:I386
# ADD LINK32 kernel32.lib user32.lib advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib flatstore.lib /nologo /subsystem:console /map /machine:I386 /nodefaultlib:"libcmt MSVCRTD" /out:"D:\wolfpack\wolfpack.exe" /libpath:"lib\ZThread\lib" /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Release" /opt:ref /opt:nowin98
***************
*** 75,79 ****
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! LINK32=xilink6.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 advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib flatstore.lib /nologo /version:12.9 /subsystem:console /map /debug /machine:I386 /out:"..\Wolfpack.exe" /pdbtype:sept /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
--- 75,79 ----
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
! 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 advapi32.lib ws2_32.lib $(QTDIR)\lib\qt-mt312.lib libmysql.lib flatstore.lib /nologo /version:12.9 /subsystem:console /map /debug /machine:I386 /out:"..\Wolfpack.exe" /pdbtype:sept /libpath:"lib\Python\lib" /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
***************
*** 307,314 ****
# Begin Source File
- SOURCE=.\spellbook.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\srvparams.cpp
# End Source File
--- 307,310 ----
***************
*** 1104,1140 ****
# Begin Source File
- SOURCE=.\spellbook.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
- # PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing spellbook.h...
- InputDir=.
- InputPath=.\spellbook.h
- InputName=spellbook
-
- "$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp
-
- # End Custom Build
-
- !ELSEIF "$(CFG)" == "wolf - Win32 Debug"
-
- # PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing spellbook.h...
- InputDir=.
- InputPath=.\spellbook.h
- InputName=spellbook
-
- "$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp
-
- # End Custom Build
-
- !ENDIF
-
- # End Source File
- # Begin Source File
-
SOURCE=.\srvparams.h
# End Source File
--- 1100,1103 ----
***************
*** 1515,1518 ****
--- 1478,1489 ----
# Begin Source File
+ SOURCE=.\python\pypacket.cpp
+ # End Source File
+ # Begin Source File
+
+ SOURCE=.\python\pypacket.h
+ # End Source File
+ # Begin Source File
+
SOURCE=.\python\pyregion.cpp
# End Source File
***************
*** 1617,1624 ****
SOURCE=.\moc_resources.cpp
- # End Source File
- # Begin Source File
-
- SOURCE=.\moc_spellbook.cpp
# End Source File
# Begin Source File
--- 1588,1591 ----
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.433
retrieving revision 1.434
diff -C2 -d -r1.433 -r1.434
*** wolfpack.cpp 22 Jul 2003 17:16:56 -0000 1.433
--- wolfpack.cpp 26 Jul 2003 01:10:55 -0000 1.434
***************
*** 60,64 ****
#include "wptargetrequests.h"
#include "python/engine.h"
- #include "spellbook.h"
#include "persistentbroker.h"
#include "corpse.h"
--- 60,63 ----
***************
*** 959,963 ****
cItem::registerInFactory();
cBook::registerInFactory();
- cSpellBook::registerInFactory();
cCorpse::registerInFactory();
cBoat::registerInFactory();
--- 958,961 ----
Index: wolfpack.pro
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.pro,v
retrieving revision 1.138
retrieving revision 1.139
diff -C2 -d -r1.138 -r1.139
*** wolfpack.pro 9 Jul 2003 01:20:47 -0000 1.138
--- wolfpack.pro 26 Jul 2003 01:10:55 -0000 1.139
***************
*** 118,123 ****
wpdefmanager.h \
wptargetrequests.h \
! corpse.h \
! spellbook.h
SOURCES = \
--- 118,122 ----
wpdefmanager.h \
wptargetrequests.h \
! corpse.h
SOURCES = \
***************
*** 194,199 ****
world.cpp \
wpdefmanager.cpp \
! wptargetrequests.cpp \
! spellbook.cpp
# Twofish Module
--- 193,197 ----
world.cpp \
wpdefmanager.cpp \
! wptargetrequests.cpp
# Twofish Module
***************
*** 224,230 ****
python/pyaccount.cpp \
python/pycoord.cpp \
! python/pyregion.cpp \
python/pytooltip.cpp \
! python/socket.cpp \
HEADERS += python/content.h
--- 222,229 ----
python/pyaccount.cpp \
python/pycoord.cpp \
! python/pypacket.cpp \
! python/pyregion.cpp \
python/pytooltip.cpp \
! python/socket.cpp \
HEADERS += python/content.h
--- spellbook.cpp DELETED ---
--- spellbook.h DELETED ---
|