wpdev-commits Mailing List for Wolfpack Emu (Page 197)
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: <dar...@us...> - 2003-08-28 20:51:36
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv20213 Modified Files: yarn.py Log Message: moved some properties from cItem to python Index: yarn.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/yarn.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** yarn.py 28 Aug 2003 20:47:57 -0000 1.3 --- yarn.py 28 Aug 2003 20:51:32 -0000 1.4 *************** *** 62,68 **** else: - target.item.delete() - - else: target.item.settag( 'amount', 0 ) item_new = wolfpack.additem( "f9a" ) --- 62,65 ---- *************** *** 70,75 **** item_new.update() char.socket.clilocmessage( 0x7A290 ) # You create some cloth and put it in your backpack. - - else: - char.socket.clilocmessage( 0x7A28F ) # Try using that on a loom. - return --- 67,68 ---- |
|
From: <dar...@us...> - 2003-08-28 20:48:31
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1:/tmp/cvs-serv19476/skills Modified Files: tasteid.py Log Message: moved some properties from cItem to python Index: tasteid.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/tasteid.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tasteid.py 27 Apr 2003 07:31:38 -0000 1.1 --- tasteid.py 28 Aug 2003 20:47:57 -0000 1.2 *************** *** 72,80 **** #char.socket.clilocmessage( 502821, "", 0x3b2, 3, item ) # poison potion/keg - if item.more1 in range( 5, 9 ): - char.socket.clilocmessage( 502822, "", 0x3b2, 3, item ) - # poison level - if char.poisoned < ( item.more1 - 4 ): - char.poisoned = item.more1 - 4 return --- 72,75 ---- |
|
From: <dar...@us...> - 2003-08-28 20:48:31
|
Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv19476
Modified Files:
commoditydeed.py multideed.py potions.py signpost.py yarn.py
Log Message:
moved some properties from cItem to python
Index: commoditydeed.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commoditydeed.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** commoditydeed.py 28 Mar 2003 22:16:33 -0000 1.1
--- commoditydeed.py 28 Aug 2003 20:47:57 -0000 1.2
***************
*** 13,17 ****
def onShowToolTip( sender, target, tooltip ):
! if target.morex == 1:
filled( target, tooltip )
else:
--- 13,17 ----
def onShowToolTip( sender, target, tooltip ):
! if target.gettag( 'filled' ) == 1:
filled( target, tooltip )
else:
***************
*** 96,100 ****
deed.settag( "color", color )
deed.settag( "amount", amount )
! deed.morex = 1
target.item.delete()
char.socket.clilocmessage( 0xFF9F0, "", 0x3b2, 3 )
--- 96,100 ----
deed.settag( "color", color )
deed.settag( "amount", amount )
! deed.settag( "filled", 1 )
target.item.delete()
char.socket.clilocmessage( 0xFF9F0, "", 0x3b2, 3 )
Index: multideed.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/multideed.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** multideed.py 24 May 2003 20:36:14 -0000 1.6
--- multideed.py 28 Aug 2003 20:47:57 -0000 1.7
***************
*** 197,203 ****
signpost.moveto( newpos )
sign.moveto( newpos )
! sign.morex = multi.serial
! sign.morey = signpost.serial
! #sign.morez = woodenpost.serial
sign.events = ["signpost"]
#woodenpost.update()
--- 197,201 ----
signpost.moveto( newpos )
sign.moveto( newpos )
! sign.settag( 'house', multi.serial )
sign.events = ["signpost"]
#woodenpost.update()
Index: potions.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/potions.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** potions.py 11 Feb 2003 21:31:19 -0000 1.5
--- potions.py 28 Aug 2003 20:47:57 -0000 1.6
***************
*** 69,73 ****
amount = 0
! pType = potion.more1
# Lesser Heal
--- 69,73 ----
amount = 0
! pType = int( potion.gettag( "type" ) )
# Lesser Heal
***************
*** 101,105 ****
amount = 0
! pType = potion.more1
# Agility
--- 101,105 ----
amount = 0
! pType = int( potion.gettag( "type" ) )
# Agility
***************
*** 127,131 ****
amount = 0
! pType = potion.more1
# Strength
--- 127,131 ----
amount = 0
! pType = int( potion.gettag( "type" ) )
# Strength
***************
*** 172,180 ****
return 1
! pType = item.more1
!
! if not potions.has_key( pType ):
! char.socket.sysmessage( "This potion has an unknown type: %u" % pType )
! return 1
potions[ pType ]( char, item )
--- 172,177 ----
return 1
! if not potions.has_key( int( item.gettag( "type" ) ) ):
! return 0
potions[ pType ]( char, item )
Index: signpost.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/signpost.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** signpost.py 24 May 2003 20:36:14 -0000 1.3
--- signpost.py 28 Aug 2003 20:47:57 -0000 1.4
***************
*** 287,291 ****
def customize( char, item ):
! multi = wolfpack.findmulti( item.morex )
multi.sendcustomhouse( char )
#char.socket.sysmessage( "Multi serial : %i" % multi.serial )
--- 287,294 ----
def customize( char, item ):
! if not item.hastag( 'house' ):
! return
!
! multi = wolfpack.findmulti( int( item.gettag( 'house' ) ) )
multi.sendcustomhouse( char )
#char.socket.sysmessage( "Multi serial : %i" % multi.serial )
Index: yarn.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/yarn.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** yarn.py 8 Feb 2003 13:07:38 -0000 1.2
--- yarn.py 28 Aug 2003 20:47:57 -0000 1.3
***************
*** 55,63 ****
char.soundeffect( 0x48 )
! if ( target.item.more1 < 5 ):
! target.item.more1 = target.item.more1 + 1
!
else:
! target.item.more1 = 0
item_new = wolfpack.additem( "f9a" )
if not wolfpack.utilities.tocontainer( item_new, char.getbackpack() ):
--- 55,69 ----
char.soundeffect( 0x48 )
! if target.item.hastag( 'amount' ):
! amount = int( target.item.gettag( 'amount' ) )
!
! if amount < 5:
! target.item.settag( 'amount', amount + 1 )
!
else:
! target.item.delete()
!
! else:
! target.item.settag( 'amount', 0 )
item_new = wolfpack.additem( "f9a" )
if not wolfpack.utilities.tocontainer( item_new, char.getbackpack() ):
|
|
From: <dar...@us...> - 2003-08-28 20:48:31
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands In directory sc8-pr-cvs1:/tmp/cvs-serv19476/wolfpack/commands Modified Files: info.py Log Message: moved some properties from cItem to python Index: info.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/commands/info.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** info.py 26 Aug 2003 01:59:05 -0000 1.7 --- info.py 28 Aug 2003 20:47:57 -0000 1.8 *************** *** 684,703 **** gump.addText( 50, 140, "Time unused:", 0x834 ) gump.addInputField( 200, 140, 200, 16, 0x834, 32, str( item.timeunused ) ) - gump.addText( 50, 160, "Creator:", 0x834 ) - gump.addInputField( 200, 160, 200, 16, 0x834, 33, str( item.creator ) ) - gump.addText( 50, 180, "Made with skill no.:", 0x834 ) - gump.addInputField( 200, 180, 200, 16, 0x834, 34, str( item.madewith ) ) - gump.addText( 50, 200, "Morex:", 0x834 ) - gump.addInputField( 200, 200, 200, 16, 0x834, 35, str( item.morex ) ) - gump.addText( 50, 220, "Morey:", 0x834 ) - gump.addInputField( 200, 220, 200, 16, 0x834, 36, str( item.morey ) ) - gump.addText( 50, 240, "Morez:", 0x834 ) - gump.addInputField( 200, 240, 200, 16, 0x834, 37, str( item.morez ) ) - gump.addText( 50, 260, "More1:", 0x834 ) - gump.addInputField( 200, 260, 200, 16, 0x834, 38, str( item.more1 ) ) - gump.addText( 50, 280, "More2:", 0x834 ) - gump.addInputField( 200, 280, 200, 16, 0x834, 39, str( item.more2 ) ) - gump.addText( 50, 300, "More3:", 0x834 ) - gump.addInputField( 200, 300, 200, 16, 0x834, 40, str( item.more3 ) ) gump.addText( 310, 340, "Page "+str( page_ )+" of "+str( pages ), 0x834 ) --- 684,687 ---- *************** *** 707,734 **** gump.addPageButton( 290, 340, 0x0FA, 0x0FA, page_+1 ) - page_ = page_ + 1 - gump.startPage( page_ ) - - gump.addResizeGump( 195, 120, 0xBB8, 215, 20 ) - #gump.addResizeGump( 195, 140, 0xBB8, 215, 20 ) - #gump.addResizeGump( 195, 160, 0xBB8, 215, 20 ) - #gump.addResizeGump( 195, 180, 0xBB8, 215, 20 ) - #gump.addResizeGump( 195, 200, 0xBB8, 215, 20 ) - - gump.addText( 50, 120, "More4:", 0x834 ) - gump.addInputField( 200, 120, 200, 16, 0x834, 41, str( item.more4 ) ) - #gump.addText( 50, 140, "Moreb1:", 0x834 ) - #gump.addInputField( 200, 140, 200, 16, 0x834, 42, str( item.moreb1 ) ) - #gump.addText( 50, 160, "Moreb2:", 0x834 ) - #gump.addInputField( 200, 160, 200, 16, 0x834, 43, str( item.moreb2 ) ) - #gump.addText( 50, 180, "Moreb3:", 0x834 ) - #gump.addInputField( 200, 180, 200, 16, 0x834, 44, str( item.moreb3 ) ) - #gump.addText( 50, 200, "Moreb4:", 0x834 ) - #gump.addInputField( 200, 200, 200, 16, 0x834, 45, str( item.moreb4 ) ) - - gump.addText( 310, 340, "Page "+str( page_ )+" of "+str( pages ), 0x834 ) - # prev page - gump.addPageButton( 270, 340, 0x0FC, 0x0FC, page_-1 ) - gump.send( socket ) --- 691,694 ---- *************** *** 769,774 **** elif key == 9: item.layer = int( hex2dec( textentries[ key ] ) ) - elif key == 10: - item.good = int( hex2dec( textentries[ key ] ) ) elif key == 11: item.type = int( hex2dec( textentries[ key ] ) ) --- 729,732 ---- *************** *** 785,794 **** elif key == 17: item.hidamage = int( hex2dec( textentries[ key ] ) ) - elif key == 18: - item.strength = int( hex2dec( textentries[ key ] ) ) - elif key == 19: - item.dexterity = int( hex2dec( textentries[ key ] ) ) - elif key == 20: - item.intelligence = int( hex2dec( textentries[ key ] ) ) elif key == 21: item.dye = int( hex2dec( textentries[ key ] ) ) --- 743,746 ---- *************** *** 801,806 **** elif key == 25: item.visible = int( hex2dec( textentries[ key ] ) ) - elif key == 26: - item.rank = int( hex2dec( textentries[ key ] ) ) elif key == 27: if ( textentries[ key ] == '' ): --- 753,756 ---- *************** *** 819,849 **** elif key == 32: item.timeunused = int( hex2dec( textentries[ key ] ) ) ! elif key == 33: ! item.creator = textentries[ key ] ! elif key == 34: ! item.madewith = int( hex2dec( textentries[ key ] ) ) ! elif key == 35: ! item.morex = int( hex2dec( textentries[ key ] ) ) ! elif key == 36: ! item.morey = int( hex2dec( textentries[ key ] ) ) ! elif key == 37: ! item.morez = int( hex2dec( textentries[ key ] ) ) ! elif key == 38: ! item.more1 = int( hex2dec( textentries[ key ] ) ) ! elif key == 39: ! item.more2 = int( hex2dec( textentries[ key ] ) ) ! elif key == 40: ! item.more3 = int( hex2dec( textentries[ key ] ) ) ! elif key == 41: ! item.more4 = int( hex2dec( textentries[ key ] ) ) ! elif key == 42: ! item.moreb1 = int( hex2dec( textentries[ key ] ) ) ! elif key == 43: ! item.moreb2 = int( hex2dec( textentries[ key ] ) ) ! elif key == 44: ! item.moreb3 = int( hex2dec( textentries[ key ] ) ) ! elif key == 45: ! item.moreb4 = int( hex2dec( textentries[ key ] ) ) ! if choice.button == 1: iteminfo( socket, item ) --- 769,773 ---- elif key == 32: item.timeunused = int( hex2dec( textentries[ key ] ) ) ! if choice.button == 1: iteminfo( socket, item ) |
|
From: <thi...@us...> - 2003-08-28 04:22:20
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv17908/wolfpack
Modified Files:
gumps.py
Log Message:
Added NoticeGump
Index: gumps.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/gumps.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** gumps.py 28 Aug 2003 04:07:01 -0000 1.10
--- gumps.py 28 Aug 2003 04:22:16 -0000 1.11
***************
*** 243,248 ****
callback = args[0]
state = args[1]
! if choice.button == 0 or not callback or not socket:
callback( player, False, state )
if choice.button == 1:
callback( player, True, state )
--- 243,301 ----
callback = args[0]
state = args[1]
! if not callback:
! return
! if choice.button == 0 or not socket:
callback( player, False, state )
if choice.button == 1:
callback( player, True, state )
+
+
+ class NoticeGump:
+
+ def __init__(self, header, headerColor, content, contentColor, width, height, callback, state ):
+ self.callback = callback
+ self.state = state
+
+ self.gump = cGump( 1, 0, 0, (640 - width) / 2, (480 - height) / 2 )
+ self.gump.startPage( 0 )
+ self.gump.addBackground( 5054, width, height )
+ self.gump.addTiledGump( 10, 10, width - 20, 20, 2624 )
+ self.gump.addCheckerTrans( 10, 10, width - 20, 20 )
+ self.gump.addXmfHtmlGump( 10, 10, width - 20, 20, header, 0, 0, headerColor )
+ self.gump.addTiledGump( 10, 40, width - 20, height - 80, 2624 )
+ self.gump.addCheckerTrans( 10, 40, width - 20, height - 80 )
+ if type( content ) is IntType:
+ self.gump.addXmfHtmlGump( 10, 40, width - 20, height - 80, content, 0, 1, contentColor )
+ else:
+ self.gump.addHtmlGump( 10, 40, width - 20, height - 80, "<BASEFONT COLOR=#%x>%s</BASEFONT>" % ( contentColor, content ), 0, 1 )
+
+ self.gump.addTiledGump( 10, height - 30, width - 20, 20, 2624 )
+ self.gump.addCheckerTrans( 10, height - 30, width - 20, 20 )
+ self.gump.addButton( 10, height - 30, 4005, 4007, 0 )
+ self.gump.addXmfHtmlGump( 40, height - 30, 170, 20, 1011036, 0, 0, 32767 )
+
+ def send( self, char ) :
+ # There are two possibilities
+ socket = None
+
+ if type( char ).__name__ == "wpchar":
+ socket = char.socket
+ elif type( char ).__name__ == "wpsocket":
+ socket = char
+ else:
+ raise TypeError( "You passed an invalid socket." )
+
+ self.gump.setArgs([self.callback, self.state])
+ self.gump.setCallback("wolfpack.gumps.NoticeGump_onResponse")
+ self.gump.send( socket )
+
+
+ def NoticeGump_onResponse( player, args, choice ):
+ socket = player.socket
+ callback = args[0]
+ state = args[1]
+ if not callback:
+ return
+ if choice.button == 0 or not socket:
+ callback( player, state )
+
|
|
From: <thi...@us...> - 2003-08-28 04:07:04
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv15992/wolfpack
Modified Files:
gumps.py
Log Message:
added WarningGump
Index: gumps.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/gumps.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** gumps.py 17 Jun 2003 20:55:55 -0000 1.9
--- gumps.py 28 Aug 2003 04:07:01 -0000 1.10
***************
*** 33,36 ****
--- 33,38 ----
elif type( char ).__name__ == "wpsocket":
socket = char
+ else:
+ raise TypeError( "You passed an invalid socket." )
# Dump the gump data
***************
*** 53,60 ****
self.layout.insert( 0, '{ nomove }' )
! if not socket:
! raise TypeError( "You passed an invalid socket." )
! else:
! socket.sendgump( self.x, self.y, 0, 0, 0, self.serialid, self.typeid, self.layout, self.texts, self.callback, self.args )
# For "rawly" modifying the list
--- 55,59 ----
self.layout.insert( 0, '{ nomove }' )
! socket.sendgump( self.x, self.y, 0, 0, 0, self.serialid, self.typeid, self.layout, self.texts, self.callback, self.args )
# For "rawly" modifying the list
***************
*** 191,192 ****
--- 190,248 ----
def add( self, line ):
self.layout.append( line )
+
+
+
+ class WarningGump:
+
+ def __init__(self, header, headerColor, content, contentColor, width, height, callback, state ):
+ self.callback = callback
+ self.state = state
+
+ self.gump = cGump( 1, 0, 0, (640 - width) / 2, (480 - height) / 2 )
+ self.gump.startPage( 0 )
+ self.gump.addBackground( 5054, width, height )
+ self.gump.addTiledGump( 10, 10, width - 20, 20, 2624 )
+ self.gump.addCheckerTrans( 10, 10, width - 20, 20 )
+ self.gump.addXmfHtmlGump( 10, 10, width - 20, 20, header, 0, 0, headerColor )
+ self.gump.addTiledGump( 10, 40, width - 20, height - 80, 2624 )
+ self.gump.addCheckerTrans( 10, 40, width - 20, height - 80 )
+ if type( content ) is IntType:
+ self.gump.addXmfHtmlGump( 10, 40, width - 20, height - 80, content, 0, 1, contentColor )
+ else:
+ self.gump.addHtmlGump( 10, 40, width - 20, height - 80, "<BASEFONT COLOR=#%x>%s</BASEFONT>" % ( contentColor, content ), 0, 1 )
+
+ self.gump.addTiledGump( 10, height - 30, width - 20, 20, 2624 )
+ self.gump.addCheckerTrans( 10, height - 30, width - 20, 20 )
+ self.gump.addButton( 10, height - 30, 4005, 4007, 1 )
+ self.gump.addXmfHtmlGump( 40, height - 30, 170, 20, 1011036, 0, 0, 32767 )
+
+ self.gump.addButton( 10 + ((width - 20) / 2), height - 30, 4005, 4007, 0 )
+ self.gump.addXmfHtmlGump( 40 + ((width - 20) / 2), height - 30, 170, 20, 1011012, 0, 0, 32767 )
+
+ # set the callback
+
+ def send( self, char ) :
+ # There are two possibilities
+ socket = None
+
+ if type( char ).__name__ == "wpchar":
+ socket = char.socket
+ elif type( char ).__name__ == "wpsocket":
+ socket = char
+ else:
+ raise TypeError( "You passed an invalid socket." )
+
+ self.gump.setArgs([self.callback, self.state])
+ self.gump.setCallback("wolfpack.gumps.WarningGump_onResponse")
+ self.gump.send( socket )
+
+
+
+ def WarningGump_onResponse( player, args, choice ):
+ socket = player.socket
+ callback = args[0]
+ state = args[1]
+ if choice.button == 0 or not callback or not socket:
+ callback( player, False, state )
+ if choice.button == 1:
+ callback( player, True, state )
|
|
From: <thi...@us...> - 2003-08-28 04:05:51
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv15819
Modified Files:
basechar.h dragdrop.cpp persistentbroker.cpp player.h wolf.dsp
world.cpp
Log Message:
Fixed saving of players even if they didn't change
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** basechar.h 27 Aug 2003 21:11:41 -0000 1.27
--- basechar.h 28 Aug 2003 04:05:42 -0000 1.28
***************
*** 145,148 ****
--- 145,149 ----
bool Owns( P_ITEM pi ) const;
virtual void callGuards();
+ virtual void flagUnchanged();
// Wrapper events
***************
*** 555,558 ****
--- 556,565 ----
P_CHAR guarding_;
};
+
+ inline void cBaseChar::flagUnchanged()
+ {
+ cBaseChar::changed_ = false;
+ cUObject::flagUnchanged();
+ }
inline P_CHAR cBaseChar::guarding() const
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.193
retrieving revision 1.194
diff -C2 -d -r1.193 -r1.194
*** dragdrop.cpp 27 Aug 2003 21:11:41 -0000 1.193
--- dragdrop.cpp 28 Aug 2003 04:05:42 -0000 1.194
***************
*** 54,81 ****
#define DBGFILE "dragdrop.cpp"
- // Lord Binaries "Three Dimension" Drop-bug-fix
- /* if (clientDimension[s]==3)
- {
- // UO:3D clients send SOMETIMES two dragg packets for a single dragg action.
- // sometimes we HAVE to swallow it, sometimes it has to be interpreted
- // if UO:3D specific item loss problems are reported, this is probably the code to blame :)
- // LB
- P_ITEM pi = FindItemBySerial(pp->Iserial);
-
- if( (pp->TxLoc==-1) && (pp->TyLoc==-1) && (pp->Tserial==0) && (EVILDRAGG[s]==1) )
- {
- EVILDRAGG[s]=0;
- return;
- }
- else if( (pp->TxLoc==-1) && (pp->TyLoc==-1) && (pp->Tserial==0) && (EVILDRAGG[s]==0) )
- {
- bounceItem( ps, pi );
- return;
- }
- else if( ( (pp->TxLoc!=-1) && (pp->TyLoc!=-1) && ( pp->Tserial!=-1)) || ( (isItemSerial(pp->Iserial)) && (isItemSerial(pp->Tserial)) ) )
- EVILDRAGG[s] = 1;
- else
- EVILDRAGG[s] = 0;
- } */
// New Class implementation
--- 54,57 ----
***************
*** 1000,1035 ****
void cDragItems::dropOnTrainer( cUOSocket* socket, P_ITEM pItem, P_CHAR pTrainer )
{
- /* P_CHAR pChar = socket->player();
-
- if( pItem->id() != 0xEED )
- {
- pTrainer->talk( tr("You need to give me gold if you want me to train you!") );
- bounceItem( socket, pItem );
- return;
- }
-
- pTrainer->talk( tr("I thank thee for thy payment. That should give thee a good start on thy way. Farewell!") );
-
- Q_UINT8 skill = pTrainer->trainingplayerin();
- Q_INT32 skillSum = pChar->getSkillSum();
- Q_INT32 skillDelta = pTrainer->getTeachingDelta( pChar, skill, skillSum );
-
- //goldsfx( client->socket(), pItem->amount() );
-
- if( pItem->amount() > skillDelta )
- {
- pItem->ReduceAmount( skillDelta );
- bounceItem( socket, pItem );
- }
- else
- {
- skillDelta = pItem->amount();
- pItem->remove();
- }
-
- pChar->setSkillValue( skill, pChar->skillValue( skill ) + skillDelta );
- socket->sendSkill( skill );
-
- // we will not reset the trainer id here because he may want to give him more money
- */
}
--- 976,978 ----
Index: persistentbroker.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.cpp,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** persistentbroker.cpp 27 Aug 2003 15:29:18 -0000 1.16
--- persistentbroker.cpp 28 Aug 2003 04:05:42 -0000 1.17
***************
*** 157,160 ****
--- 157,161 ----
throw QString( "PersistentBroker not connected to database." );
+ //qWarning( query );
bool result = connection->exec(query);
if( !result )
Index: player.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** player.h 27 Aug 2003 20:35:10 -0000 1.19
--- player.h 28 Aug 2003 04:05:42 -0000 1.20
***************
*** 258,262 ****
inline void cPlayer::flagUnchanged()
{
! cPlayer::changed_ = true;
cBaseChar::flagUnchanged();
}
--- 258,262 ----
inline void cPlayer::flagUnchanged()
{
! cPlayer::changed_ = false;
cBaseChar::flagUnchanged();
}
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.207
retrieving revision 1.208
diff -C2 -d -r1.207 -r1.208
*** wolf.dsp 27 Aug 2003 15:29:18 -0000 1.207
--- wolf.dsp 28 Aug 2003 04:05:42 -0000 1.208
***************
*** 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
--- 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
***************
*** 26,30 ****
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=cl.exe
RSC=rc.exe
--- 26,30 ----
# PROP Scc_ProjName "wolf"
# PROP Scc_LocalPath "."
! CPP=xicl6.exe
RSC=rc.exe
***************
*** 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 /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=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 /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,81 ****
# 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 /nologo /version:12.9 /subsystem:console /map /debug /machine:I386 /out:"..\Wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
--- 75,81 ----
# 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-mt320.lib libmysql.lib /nologo /version:12.9 /subsystem:console /map /debug /machine:I386 /out:"..\Wolfpack.exe" /pdbtype:sept /libpath:"lib\bugreport\lib" /libpath:"flatstore\Debug"
# SUBTRACT LINK32 /pdb:none
***************
*** 392,424 ****
SOURCE=.\basechar.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
# PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing basechar.h...
- InputDir=.
- InputPath=.\basechar.h
- InputName=basechar
-
- "$(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 basechar.h...
- InputDir=.
- InputPath=.\basechar.h
- InputName=basechar
-
- "$(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
--- 392,396 ----
***************
*** 433,498 ****
SOURCE=.\boats.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
- # PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing boats.h...
- InputDir=.
- InputPath=.\boats.h
- InputName=boats
-
- "$(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 boats.h...
- InputDir=.
- InputPath=.\boats.h
- InputName=boats
-
- "$(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=.\books.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
# PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing books.h...
- InputDir=.
- InputPath=.\books.h
- InputName=books
-
- "$(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 books.h...
- InputDir=.
- InputPath=.\books.h
- InputName=books
-
- "$(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
--- 405,414 ----
***************
*** 553,585 ****
SOURCE=.\corpse.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
# PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing corpse.h...
- InputDir=.
- InputPath=.\corpse.h
- InputName=corpse
-
- "$(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 corpse.h...
- InputDir=.
- InputPath=.\corpse.h
- InputName=corpse
-
- "$(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
--- 469,473 ----
***************
*** 685,697 ****
# PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing house.h...
- InputDir=.
- InputPath=.\house.h
- InputName=house
-
- "$(InputDir)\moc_$(InputName).cpp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
- %qtdir%\bin\moc.exe $(InputDir)\$(InputName).h -o $(InputDir)\moc_$(InputName).cpp
-
- # End Custom Build
!ENDIF
--- 573,576 ----
***************
*** 742,774 ****
SOURCE=.\items.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
- # PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing items.h...
- InputDir=.
- InputPath=.\items.h
- InputName=items
-
- "$(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 items.h...
- InputDir=.
- InputPath=.\items.h
- InputName=items
-
- "$(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
--- 621,625 ----
***************
*** 857,889 ****
SOURCE=.\npc.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
- # PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing npc.h...
- InputDir=.
- InputPath=.\npc.h
- InputName=npc
-
- "$(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 npc.h...
- InputDir=.
- InputPath=.\npc.h
- InputName=npc
-
- "$(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
--- 708,712 ----
***************
*** 922,954 ****
SOURCE=.\persistentobject.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
- # PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing persistentobject.h...
- InputDir=.
- InputPath=.\persistentobject.h
- InputName=persistentobject
-
- "$(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 persistentobject.h...
- InputDir=.
- InputPath=.\persistentobject.h
- InputName=persistentobject
-
- "$(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
--- 745,749 ----
***************
*** 963,995 ****
SOURCE=.\player.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
# PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing player.h...
- InputDir=.
- InputPath=.\player.h
- InputName=player
-
- "$(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 player.h...
- InputDir=.
- InputPath=.\player.h
- InputName=player
-
- "$(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
--- 758,762 ----
***************
*** 1224,1256 ****
SOURCE=.\uobject.h
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
- # PROP Ignore_Default_Tool 1
- # Begin Custom Build - MOCing uobject.h...
- InputDir=.
- InputPath=.\uobject.h
- InputName=uobject
-
- "$(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 uobject.h...
- InputDir=.
- InputPath=.\uobject.h
- InputName=uobject
-
- "$(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
--- 991,995 ----
***************
*** 1498,1513 ****
# Begin Source File
- SOURCE=.\moc_basechar.cpp
- # End Source File
- # Begin Source File
-
- SOURCE=.\moc_boats.cpp
- # End Source File
- # Begin Source File
-
- SOURCE=.\moc_books.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\moc_commands.cpp
--- 1237,1240 ----
***************
*** 1523,1546 ****
# Begin Source File
- SOURCE=.\moc_corpse.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\moc_gumps.cpp
# End Source File
# Begin Source File
- SOURCE=.\moc_house.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\moc_iserialization.cpp
# End Source File
# Begin Source File
- SOURCE=.\moc_items.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\moc_makemenus.cpp
# End Source File
--- 1250,1261 ----
***************
*** 1551,1566 ****
# Begin Source File
- SOURCE=.\moc_npc.cpp
- # End Source File
- # Begin Source File
-
- SOURCE=.\moc_persistentobject.cpp
- # End Source File
- # Begin Source File
-
- SOURCE=.\moc_player.cpp
- # End Source File
- # Begin Source File
-
SOURCE=.\moc_resources.cpp
# End Source File
--- 1266,1269 ----
***************
*** 1576,1592 ****
SOURCE=.\moc_TmpEff.cpp
- # End Source File
- # Begin Source File
-
- SOURCE=.\moc_uobject.cpp
-
- !IF "$(CFG)" == "wolf - Win32 Release"
-
- !ELSEIF "$(CFG)" == "wolf - Win32 Debug"
-
- # ADD CPP /GR
-
- !ENDIF
-
# End Source File
# Begin Source File
--- 1279,1282 ----
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** world.cpp 27 Aug 2003 23:20:56 -0000 1.33
--- world.cpp 28 Aug 2003 04:05:42 -0000 1.34
***************
*** 65,69 ****
// UNCOMMENT THIS IF YOU WANT TO USE A HASHMAP
! #define WP_USE_HASH_MAP
// Important compile switch
--- 65,69 ----
// UNCOMMENT THIS IF YOU WANT TO USE A HASHMAP
! //#define WP_USE_HASH_MAP
// Important compile switch
***************
*** 463,467 ****
p->purgePendingObjects();
! persistentBroker->executeQuery( "BEGIN;" );
try
--- 463,467 ----
p->purgePendingObjects();
! //persistentBroker->executeQuery( "BEGIN;" );
try
***************
*** 477,481 ****
catch( QString &e )
{
! persistentBroker->executeQuery( "ROLLBACK;" );
clConsole.ChangeColor( WPC_RED );
--- 477,481 ----
catch( QString &e )
{
! //persistentBroker->executeQuery( "ROLLBACK;" );
clConsole.ChangeColor( WPC_RED );
***************
*** 487,491 ****
}
! persistentBroker->executeQuery( "COMMIT;" );
ISerialization *archive = cPluginFactory::serializationArchiver( "xml" );
--- 487,491 ----
}
! //persistentBroker->executeQuery( "COMMIT;" );
ISerialization *archive = cPluginFactory::serializationArchiver( "xml" );
|
|
From: <dar...@us...> - 2003-08-27 23:21:02
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv31853
Modified Files:
boats.cpp books.cpp corpse.cpp guildstones.cpp house.cpp
items.cpp items.h npc.cpp player.cpp resources.cpp uobject.cpp
wolfpack.cpp world.cpp
Log Message:
moved some properties from cItem to python
Index: boats.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/boats.cpp,v
retrieving revision 1.109
retrieving revision 1.110
diff -C2 -d -r1.109 -r1.110
*** boats.cpp 27 Aug 2003 20:35:09 -0000 1.109
--- boats.cpp 27 Aug 2003 23:20:55 -0000 1.110
***************
*** 1241,1245 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cBoat' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cBoat", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cBoat", sqlString );
--- 1241,1245 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cBoat' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cBoat", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cBoat", sqlString );
Index: books.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/books.cpp,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -d -r1.44 -r1.45
*** books.cpp 27 Aug 2003 16:06:12 -0000 1.44
--- books.cpp 27 Aug 2003 23:20:56 -0000 1.45
***************
*** 54,58 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cBook' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerSqlQuery( "cBook", sqlString );
--- 54,58 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cBook' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerSqlQuery( "cBook", sqlString );
Index: corpse.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/corpse.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** corpse.cpp 27 Aug 2003 16:06:12 -0000 1.33
--- corpse.cpp 27 Aug 2003 23:20:56 -0000 1.34
***************
*** 57,61 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cCorpse' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cCorpse", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cCorpse", sqlString );
--- 57,61 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cCorpse' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cCorpse", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cCorpse", sqlString );
Index: guildstones.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/guildstones.cpp,v
retrieving revision 1.75
retrieving revision 1.76
diff -C2 -d -r1.75 -r1.76
*** guildstones.cpp 20 Aug 2003 17:10:48 -0000 1.75
--- guildstones.cpp 27 Aug 2003 23:20:56 -0000 1.76
***************
*** 172,176 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cGuildStone' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cGuildStone", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cGuildStone", sqlString );
--- 172,176 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cGuildStone' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cGuildStone", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cGuildStone", sqlString );
Index: house.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/house.cpp,v
retrieving revision 1.112
retrieving revision 1.113
diff -C2 -d -r1.112 -r1.113
*** house.cpp 23 Aug 2003 15:20:29 -0000 1.112
--- house.cpp 27 Aug 2003 23:20:56 -0000 1.113
***************
*** 363,367 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cHouse' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cHouse", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cHouse", sqlString );
--- 363,367 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cHouse' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cHouse", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cHouse", sqlString );
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.339
retrieving revision 1.340
diff -C2 -d -r1.339 -r1.340
*** items.cpp 27 Aug 2003 21:43:57 -0000 1.339
--- items.cpp 27 Aug 2003 23:20:56 -0000 1.340
***************
*** 104,108 ****
this->morez_ = src.morez_;
this->amount_ = src.amount_;
- this->dye_ = src.dye_;
this->def_ = src.def_;
this->lodamage_=src.lodamage_;
--- 104,107 ----
***************
*** 120,124 ****
this->sellprice_ = src.sellprice_;
this->restock_ = src.restock_;
- this->disabled_ = src.disabled_;
this->poisoned_ = src.poisoned_;
this->time_unused=src.time_unused;
--- 119,122 ----
***************
*** 127,131 ****
this->setTags( src.tags() );
- this->accuracy_ = 100;
this->container_ = src.container_;
this->totalweight_ = src.totalweight_;
--- 125,128 ----
***************
*** 460,464 ****
addField("morez", morez_);
addField("amount", amount_);
- addField("dye", dye_);
addField("decaytime", (decaytime_ > uiCurrentTime) ? decaytime_ - uiCurrentTime : 0 );
addField("def", def_);
--- 457,460 ----
***************
*** 479,484 ****
addField("buyprice", buyprice_);
addField("restock", restock_);
- addField("disabled", disabled_);
- addField("accuracy", accuracy_);
addCondition( "serial", serial() );
--- 475,478 ----
***************
*** 592,596 ****
this->morez_=0;
this->amount_ = 1; // Amount of items in pile
- this->dye_=0; // Reserved: Can item be dyed by dye kit
this->def_=0; // Item defense
this->lodamage_=0; //Minimum Damage weapon inflicts
--- 586,589 ----
***************
*** 606,614 ****
// Everything decays by default.
this->priv_ = 0; // Bit 0, nodecay off/on. Bit 1, newbie item off/on. Bit 2 Dispellable
- this->disabled_ = 0; //Item is disabled, cant trigger.
this->poisoned_ = 0; //AntiChrist -- for poisoning skill
this->time_unused = 0;
this->timeused_last=getNormalizedTime();
- this->accuracy_ = 100;
}
--- 599,605 ----
***************
*** 1289,1295 ****
// <nodye />
else if( TagName == "dye" )
! this->setDye(1);
else if( TagName == "nodye" )
! this->setDye(0);
// <corpse />
--- 1280,1286 ----
// <nodye />
else if( TagName == "dye" )
! this->setDye( true );
else if( TagName == "nodye" )
! this->setDye( false );
// <corpse />
***************
*** 1959,1963 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT /*! STRAIGHT_JOIN SQL_SMALL_RESULT */ uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cItem' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cItem", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cItem", sqlString );
--- 1950,1954 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cItem' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cItem", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cItem", sqlString );
***************
*** 1982,1986 ****
if( containerSerial != INVALID_SERIAL ) // if it's invalid, we won't set.
! container_ = (cUObject*)containerSerial;
// ugly optimization ends here.
--- 1973,1977 ----
if( containerSerial != INVALID_SERIAL ) // if it's invalid, we won't set.
! container_ = reinterpret_cast<cUObject*>(containerSerial);
// ugly optimization ends here.
***************
*** 1997,2001 ****
morez_ = atoi( result[offset++] );
amount_ = atoi( result[offset++] );
- dye_ = atoi( result[offset++] );
decaytime_ = atoi( result[offset++] );
if( decaytime_ > 0 )
--- 1988,1991 ----
***************
*** 2018,2023 ****
buyprice_ = atoi( result[offset++] );
restock_ = atoi( result[offset++] );
- disabled_ = atoi( result[offset++] );
- accuracy_ = atoi( result[offset++] );
// Their own weight should already be set.
--- 2008,2011 ----
***************
*** 2030,2034 ****
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.color,items.cont,items.layer,items.type,items.type2,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.dye,items.decaytime,items.def,items.hidamage,items.lodamage,items.time_unused,items.weight,items.hp,items.maxhp,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
--- 2018,2022 ----
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.color,items.cont,items.layer,items.type,items.type2,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.decaytime,items.def,items.hidamage,items.lodamage,items.time_unused,items.weight,items.hp,items.maxhp,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
***************
*** 2248,2252 ****
}
else SET_INT_PROPERTY( "antispamtimer", antispamtimer_ )
- else SET_INT_PROPERTY( "accuracy", accuracy_ )
else if( name == "container" )
--- 2236,2239 ----
***************
*** 2289,2293 ****
else SET_INT_PROPERTY( "morey", morey_ )
else SET_INT_PROPERTY( "morez", morez_ )
- else SET_INT_PROPERTY( "dye", dye_ )
else SET_INT_PROPERTY( "defense", def_ )
else SET_INT_PROPERTY( "decaytime", decaytime_ )
--- 2276,2279 ----
***************
*** 2317,2321 ****
else SET_INT_PROPERTY( "buyprice", buyprice_ )
else SET_INT_PROPERTY( "restock", restock_ )
- else SET_INT_PROPERTY( "disabled", disabled_ )
else SET_INT_PROPERTY( "poisoned", poisoned_ )
else SET_INT_PROPERTY( "incognito", incognito )
--- 2303,2306 ----
***************
*** 2374,2377 ****
--- 2359,2366 ----
return 0;
}
+ else if( name == "dye" )
+ {
+ setDye( value.toInt() != 0 ? true : false );
+ }
else if( name == "corpse" )
{
***************
*** 2405,2409 ****
else GET_PROPERTY( "totalweight", totalweight_ )
else GET_PROPERTY( "antispamtimer", (int)antispamtimer_ )
- else GET_PROPERTY( "accuracy", accuracy_ )
// container
--- 2394,2397 ----
***************
*** 2427,2431 ****
else GET_PROPERTY( "morey", (int)morey_ )
else GET_PROPERTY( "morez", (int)morez_ )
- else GET_PROPERTY( "dye", dye_ )
else GET_PROPERTY( "defense", (int)def_ )
else GET_PROPERTY( "decaytime", (int)decaytime_ )
--- 2415,2418 ----
***************
*** 2439,2443 ****
else GET_PROPERTY( "sellprice", sellprice_ )
else GET_PROPERTY( "restock", restock_ )
- else GET_PROPERTY( "disabled", (int)disabled_ )
else GET_PROPERTY( "poisoned", (int)poisoned_ )
else GET_PROPERTY( "incognito", incognito ? 1 : 0 )
--- 2426,2429 ----
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.175
retrieving revision 1.176
diff -C2 -d -r1.175 -r1.176
*** items.h 27 Aug 2003 21:43:57 -0000 1.175
--- items.h 27 Aug 2003 23:20:56 -0000 1.176
***************
*** 90,93 ****
--- 90,94 ----
SI16 hp() const { return hp_; } // Number of hitpoints an item has
SI16 maxhp() const { return maxhp_; } // Maximum number of hitpoints an item has
+ bool dye() const { return priv_&0x80; } // Can the item be dyed
bool corpse() const { return priv_&0x40; } // Is the item a corpse
bool newbie() const { return priv_&0x02; } // Is the Item Newbie
***************
*** 96,100 ****
int totalweight() const { return totalweight_; }
uint antispamtimer() const { return antispamtimer_;}
- ushort accuracy() const { return accuracy_; } // for weapons, could be used for certain tools too.
cUObject* container() const { return container_; }
int sellprice() const { return sellprice_; } // Price this item is being bought at by normal vendors
--- 97,100 ----
***************
*** 107,116 ****
uint morex() const { return morex_; }
uint morey() const { return morey_; }
! uint morez() const { return morez_; }
! uchar dye() const { return dye_; }
uint def() const { return def_; }
uchar magic() const { return magic_; }
uint decaytime() const { return decaytime_; }
- uint disabled() const { return disabled_; }
uint poisoned() const { return poisoned_; }
uchar visible() const { return visible_;}
--- 107,114 ----
uint morex() const { return morex_; }
uint morey() const { return morey_; }
! uint morez() const { return morez_; }
uint def() const { return def_; }
uchar magic() const { return magic_; }
uint decaytime() const { return decaytime_; }
uint poisoned() const { return poisoned_; }
uchar visible() const { return visible_;}
***************
*** 125,132 ****
void setRestock( ushort nValue ) { restock_ = nValue; flagChanged();}
void setLayer( uchar nValue ) { layer_ = nValue; flagChanged();};
! void setTwohanded( bool nValue ) { nValue ? priv_ &= 0x20 : priv_ |= 0xDF; flagChanged(); changed( TOOLTIP );};
void setType( UI32 nValue ) { type_ = nValue; flagChanged();};
void setType2( UI32 nValue ) { type2_ = nValue; flagChanged();};
! void setSecured( bool nValue ) { ( nValue ) ? priv_ &= 0x08 : priv_ |= 0xF7; flagChanged(); changed( TOOLTIP );};
void setSpeed( SI16 nValue ) { speed_ = nValue; flagChanged(); changed( TOOLTIP );};
void setHidamage( SI16 nValue ) { hidamage_ = nValue; flagChanged(); changed( TOOLTIP );};
--- 123,131 ----
void setRestock( ushort nValue ) { restock_ = nValue; flagChanged();}
void setLayer( uchar nValue ) { layer_ = nValue; flagChanged();};
! void setTwohanded( bool nValue ) { nValue ? priv_ |= 0x20 : priv_ &= 0xDF; flagChanged(); changed( TOOLTIP );};
! void setDye( bool nValue ) { nValue ? priv_ |= 0x80 : priv_ &= 0x7F; flagChanged();}
void setType( UI32 nValue ) { type_ = nValue; flagChanged();};
void setType2( UI32 nValue ) { type2_ = nValue; flagChanged();};
! void setSecured( bool nValue ) { ( nValue ) ? priv_ |= 0x08 : priv_ &= 0xF7; flagChanged(); changed( TOOLTIP );};
void setSpeed( SI16 nValue ) { speed_ = nValue; flagChanged(); changed( TOOLTIP );};
void setHidamage( SI16 nValue ) { hidamage_ = nValue; flagChanged(); changed( TOOLTIP );};
***************
*** 142,146 ****
void setTotalweight( int data );
void setAntispamtimer ( uint data ) { antispamtimer_ = data; flagChanged();}
- void setAccuracy( ushort data ) { accuracy_ = data; flagChanged();}
cItem();
--- 141,144 ----
***************
*** 159,163 ****
void setMoreY( uint data ) { morey_ = data; flagChanged();}
void setMoreZ( uint data ) { morez_ = data; flagChanged();}
- void setDye( uchar data ) { dye_ = data; flagChanged();}
void setDef( uint data ) { def_ = data; flagChanged(); changed( TOOLTIP );}
void setMagic( uchar data ) { magic_ = data; flagChanged(); changed( TOOLTIP );}
--- 157,160 ----
***************
*** 166,170 ****
void setSellprice( int data ) { sellprice_ = data; flagChanged(); changed( TOOLTIP );}
- void setDisabled(uint data) { disabled_ = data; flagChanged();}
void setPoisoned(uint data) { poisoned_ = data; flagChanged();}
void setVisible( uchar d ) { visible_ = d; flagChanged();}
--- 163,166 ----
***************
*** 273,277 ****
int totalweight_;
uint antispamtimer_;
- ushort accuracy_; // for weapons, could be used for certain tools too.
int sellprice_;
int buyprice_;
--- 269,272 ----
***************
*** 287,295 ****
uint morey_;
uint morez_;
- uchar dye_; // Reserved: Can item be dyed by dye kit
uint def_; // Item defense
uchar magic_; // 0=Default as stored in client, 1=Always movable, 2=Never movable, 3=Owner movable, 4=Locked Down
uint decaytime_;
- uint disabled_; //Item is disabled, cant trigger.
uint poisoned_; //AntiChrist -- for poisoning skill
SERIAL ownserial_;
--- 282,288 ----
***************
*** 305,309 ****
// 5 | 20 | Twohanded
// 6 | 40 | Corpse
! // 7 | 80 | <unused>
uchar priv_;
};
--- 298,302 ----
// 5 | 20 | Twohanded
// 6 | 40 | Corpse
! // 7 | 80 | Dye
uchar priv_;
};
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** npc.cpp 27 Aug 2003 21:11:41 -0000 1.35
--- npc.cpp 27 Aug 2003 23:20:56 -0000 1.36
***************
*** 98,102 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT /*! STRAIGHT_JOIN SQL_SMALL_RESULT */ uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cNPC' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType( "cNPC", productCreator );
UObjectFactory::instance()->registerSqlQuery( "cNPC", sqlString );
--- 98,102 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cNPC' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType( "cNPC", productCreator );
UObjectFactory::instance()->registerSqlQuery( "cNPC", sqlString );
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** player.cpp 27 Aug 2003 21:43:57 -0000 1.30
--- player.cpp 27 Aug 2003 23:20:56 -0000 1.31
***************
*** 91,95 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT /*! STRAIGHT_JOIN SQL_SMALL_RESULT */ uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cPlayer' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType( "cPlayer", productCreator );
UObjectFactory::instance()->registerSqlQuery( "cPlayer", sqlString );
--- 91,95 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cPlayer' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType( "cPlayer", productCreator );
UObjectFactory::instance()->registerSqlQuery( "cPlayer", sqlString );
Index: resources.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/resources.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** resources.cpp 27 Aug 2003 20:35:10 -0000 1.43
--- resources.cpp 27 Aug 2003 23:20:56 -0000 1.44
***************
*** 1461,1465 ****
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT uobjectmap.serial,uobjectmap.type,%1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cResourceItem' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cResourceItem", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cResourceItem", sqlString );
--- 1461,1465 ----
QStringList fields, tables, conditions;
buildSqlString( fields, tables, conditions ); // Build our SQL string
! QString sqlString = QString( "SELECT %1 FROM uobjectmap,%2 WHERE uobjectmap.type = 'cResourceItem' AND %3" ).arg( fields.join( "," ) ).arg( tables.join( "," ) ).arg( conditions.join( " AND " ) );
UObjectFactory::instance()->registerType("cResourceItem", productCreator);
UObjectFactory::instance()->registerSqlQuery( "cResourceItem", sqlString );
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.110
retrieving revision 1.111
diff -C2 -d -r1.110 -r1.111
*** uobject.cpp 27 Aug 2003 20:35:10 -0000 1.110
--- uobject.cpp 27 Aug 2003 23:20:56 -0000 1.111
***************
*** 116,120 ****
void cUObject::load( char **result, UINT16 &offset )
{
! name_ = result[offset++];
serial_ = atoi(result[offset++]);
multis_ = atoi(result[offset++]);
--- 116,121 ----
void cUObject::load( char **result, UINT16 &offset )
{
! name_ = result[offset] == 0 ? QString::null : result[offset];
! offset++;
serial_ = atoi(result[offset++]);
multis_ = atoi(result[offset++]);
***************
*** 211,214 ****
--- 212,216 ----
void cUObject::buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions )
{
+ // We are requiring fixed order by now, so this *is* possible
fields.push_back( "uobject.name,uobject.serial,uobject.multis,uobject.direction,uobject.pos_x,uobject.pos_y,uobject.pos_z,uobject.pos_map,uobject.events,uobject.bindmenu,uobject.havetags" );
tables.push_back( "uobject" );
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.444
retrieving revision 1.445
diff -C2 -d -r1.444 -r1.445
*** wolfpack.cpp 27 Aug 2003 21:43:57 -0000 1.444
--- wolfpack.cpp 27 Aug 2003 23:20:56 -0000 1.445
***************
*** 560,580 ****
#endif
*/
- /*clConsole.send( QString::number( sizeof cUObject ) + "\n" );
- clConsole.send( QString::number( sizeof cItem ) + "\n" );
-
- clConsole.send( "STARTING UP\n" );
- Sleep( 5000 );
-
- for( unsigned int x = 0; x < 100000; ++x )
- {
- cItem *pItem = new cItem;
- pItem->Init();
- }
-
- clConsole.send( "STARTING UP\n" );
- Sleep( 5000 );
-
- return 0;*/
-
QApplication app( argc, argv, false ); // we need one instance
QTranslator translator( 0 ); // must be valid thru app life.
--- 560,563 ----
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** world.cpp 27 Aug 2003 21:43:57 -0000 1.32
--- world.cpp 27 Aug 2003 23:20:56 -0000 1.33
***************
*** 217,223 ****
//UINT32 sTime = getNormalizedTime();
- UINT16 offset;
cUObject *object;
-
progress_display progress( count );
--- 217,221 ----
***************
*** 226,234 ****
while( res.fetchrow() )
{
char **row = res.data();
// do something with data
! object = UObjectFactory::instance()->createObject( type );
! offset = 2; // Skip the first two fields
object->load( row, offset );
--- 224,232 ----
while( res.fetchrow() )
{
+ unsigned short offset = 0;
char **row = res.data();
// do something with data
! object = UObjectFactory::instance()->createObject( type );
object->load( row, offset );
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv12500
Modified Files:
items.cpp items.h makemenus.cpp player.cpp prototypes.h
wolfpack.cpp world.cpp
Log Message:
moved some properties from cItem to python
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.338
retrieving revision 1.339
diff -C2 -d -r1.338 -r1.339
*** items.cpp 27 Aug 2003 21:11:41 -0000 1.338
--- items.cpp 27 Aug 2003 21:43:57 -0000 1.339
***************
*** 74,78 ****
// constructor
cItem::cItem(): container_(0), totalweight_(0), incognito(false),
! rndvaluerate_(0), timeused_last(0), sellprice_( 0 ),
buyprice_( 0 ), restock_( 1 ), antispamtimer_( 0 )
{
--- 74,78 ----
// constructor
cItem::cItem(): container_(0), totalweight_(0), incognito(false),
! timeused_last(0), sellprice_( 0 ),
buyprice_( 0 ), restock_( 1 ), antispamtimer_( 0 )
{
***************
*** 85,94 ****
flagChanged();
this->name_ = src.name_;
- this->creator_ = src.creator_;
this->incognito = src.incognito;
- this->madewith_ = src.madewith_;
- this->rank_ = src.rank_;
- this->good_ = src.good_;
- this->rndvaluerate_ = src.rndvaluerate_;
this->setMultis( src.multis() );
--- 85,89 ----
***************
*** 110,114 ****
this->amount_ = src.amount_;
this->dye_ = src.dye_;
- this->att_ = src.att_;
this->def_ = src.def_;
this->lodamage_=src.lodamage_;
--- 105,108 ----
***************
*** 450,474 ****
addField("serial", serial());
addField("id", id());
! addStrField("creator", creator_);
! addField("sk_name", madewith_);
! addField("color", color());
SERIAL contserial = INVALID_SERIAL;
if ( container_ )
contserial = container_->serial();
! addField("cont", contserial);
! addField("layer", layer_);
! addField("type", type_);
! addField("type2", type2_);
! addField("more1", more1_);
! addField("more2", more2_);
! addField("more3", more3_);
! addField("more4", more4_);
! addField("morex", morex_);
! addField("morey", morey_);
! addField("morez", morez_);
addField("amount", amount_);
addField("dye", dye_);
addField("decaytime", (decaytime_ > uiCurrentTime) ? decaytime_ - uiCurrentTime : 0 );
- addField("att", att_);
addField("def", def_);
addField("hidamage", hidamage_);
--- 444,465 ----
addField("serial", serial());
addField("id", id());
! addField("color", color());
SERIAL contserial = INVALID_SERIAL;
if ( container_ )
contserial = container_->serial();
! addField("cont", contserial);
! addField("layer", layer_);
! addField("type", type_);
! addField("type2", type2_);
! addField("more1", more1_);
! addField("more2", more2_);
! addField("more3", more3_);
! addField("more4", more4_);
! addField("morex", morex_);
! addField("morey", morey_);
! addField("morez", morez_);
addField("amount", amount_);
addField("dye", dye_);
addField("decaytime", (decaytime_ > uiCurrentTime) ? decaytime_ - uiCurrentTime : 0 );
addField("def", def_);
addField("hidamage", hidamage_);
***************
*** 478,482 ****
addField("hp", hp_);
addField("maxhp", maxhp_);
- addField("rank", rank_);
addField("speed", speed_);
addField("poisoned", poisoned_);
--- 469,472 ----
***************
*** 490,494 ****
addField("restock", restock_);
addField("disabled", disabled_);
- addField("good", good_);
addField("accuracy", accuracy_);
--- 480,483 ----
***************
*** 583,599 ****
this->setSerial( World::instance()->findItemSerial() );
- // We need to implement NULL checking here.
- this->creator_ = QString::null;
-
this->container_ = 0;
this->incognito=false;//AntiChrist - incognito
- this->madewith_=0; // Added by Magius(CHE)
- this->rank_ = 0; // Magius(CHE)
- this->good_=-1; // Magius(CHE)
- this->rndvaluerate_=0; // Magius(CHE) (2)
! this->setMultis( INVALID_SERIAL );//Multi serial
this->free = false;
! this->setId(0x0001); // Item visuals as stored in the client
this->setPos( Coord_cl(100, 100, 0) );
this->color_ = 0x00; // Hue
--- 572,581 ----
this->setSerial( World::instance()->findItemSerial() );
this->container_ = 0;
this->incognito=false;//AntiChrist - incognito
! this->setMultis( INVALID_SERIAL ); //Multi serial
this->free = false;
! this->setId( 0x0001 ); // Item visuals as stored in the client
this->setPos( Coord_cl(100, 100, 0) );
this->color_ = 0x00; // Hue
***************
*** 611,615 ****
this->amount_ = 1; // Amount of items in pile
this->dye_=0; // Reserved: Can item be dyed by dye kit
- this->att_=0; // Item attack
this->def_=0; // Item defense
this->lodamage_=0; //Minimum Damage weapon inflicts
--- 593,596 ----
***************
*** 1216,1223 ****
this->setSpeed( Value.toLong() );
- // <good>10</good>
- else if( TagName == "good" )
- this->good_ = Value.toInt();
-
// <lightsource>10</lightsource>
else if( TagName == "lightsource" )
--- 1197,1200 ----
***************
*** 1532,1539 ****
itemname = getName();
- // Add creator's mark (if any)
- if( !creator_.isEmpty() && madewith() )
- itemname.append( tr( " crafted by %2" ).arg( creator_ ) );
-
// Amount information
if( amount_ > 1 )
--- 1509,1512 ----
***************
*** 1834,1861 ****
}
- void cItem::applyRank( UI08 rank )
- {
- // Variables to change: LODAMAGE,HIDAMAGE,ATT,DEF,HP,MAXHP
- double minmod = (double)(rank-1) * 10.0f / 100.0f;
- double maxmod = (double)(rank+1) * 10.0f / 100.0f;
- UINT16 minhp_ = (UINT16)floor( minmod * (double)hp() );
- UINT16 maxhp_ = (UINT16)floor( maxmod * (double)hp() );
- INT16 minlodam = (UINT16)floor( minmod * (double)lodamage() );
- INT16 maxlodam = (UINT16)floor( maxmod * (double)lodamage() );
- INT16 minhidam = (UINT16)floor( minmod * (double)hidamage() );
- INT16 maxhidam = (UINT16)floor( maxmod * (double)hidamage() );
- UINT16 mindef = (UINT16)floor( minmod * (double)def() );
- UINT16 maxdef = (UINT16)floor( maxmod * (double)def() );
-
- changed( TOOLTIP );
- flagChanged();
- setLodamage( RandomNum( minlodam, maxlodam ) );
- setHidamage( RandomNum( minhidam, maxhidam ) );
- def_ = RandomNum( mindef, maxdef );
- setMaxhp( RandomNum( minhp_, maxhp_ ) );
- setHp( maxhp() );
- this->rank_ = rank_;
- }
-
void cItem::talk( const QString &message, UI16 color, UINT8 type, bool autospam, cUOSocket* socket )
{
--- 1807,1810 ----
***************
*** 2024,2029 ****
id_ = atoi( result[offset++] );
- creator_ = result[offset++];
- madewith_ = atoi( result[offset++] );
color_ = atoi( result[offset++] );
--- 1973,1976 ----
***************
*** 2054,2058 ****
if( decaytime_ > 0 )
decaytime_ += uiCurrentTime;
- att_ = atoi( result[offset++] );
def_ = atoi( result[offset++] );
hidamage_ = atoi( result[offset++] );
--- 2001,2004 ----
***************
*** 2062,2066 ****
hp_ = atoi( result[offset++] );
maxhp_ = atoi( result[offset++] );
- rank_ = atoi( result[offset++] );
speed_ = atoi( result[offset++] );
poisoned_ = atoi( result[offset++] );
--- 2008,2011 ----
***************
*** 2074,2078 ****
restock_ = atoi( result[offset++] );
disabled_ = atoi( result[offset++] );
- good_ = atoi( result[offset++] );
accuracy_ = atoi( result[offset++] );
--- 2019,2022 ----
***************
*** 2086,2090 ****
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.creator,items.sk_name,items.color,items.cont,items.layer,items.type,items.type2,items.offspell,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.dye,items.decaytime,items.att,items.def,items.hidamage,items.lodamage,items.time_unused,items.weight,items.hp,items.maxhp,items.rank,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.good,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
--- 2030,2034 ----
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.color,items.cont,items.layer,items.type,items.type2,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.dye,items.decaytime,items.def,items.hidamage,items.lodamage,items.time_unused,items.weight,items.hp,items.maxhp,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
***************
*** 2346,2350 ****
else SET_INT_PROPERTY( "morez", morez_ )
else SET_INT_PROPERTY( "dye", dye_ )
- else SET_INT_PROPERTY( "attack", att_ )
else SET_INT_PROPERTY( "defense", def_ )
else SET_INT_PROPERTY( "decaytime", decaytime_ )
--- 2290,2293 ----
***************
*** 2376,2384 ****
else SET_INT_PROPERTY( "disabled", disabled_ )
else SET_INT_PROPERTY( "poisoned", poisoned_ )
- else SET_INT_PROPERTY( "rank", rank_ )
- else SET_STR_PROPERTY( "creator", creator_ )
- else SET_INT_PROPERTY( "good", good_ )
- else SET_INT_PROPERTY( "rndvaluerate", rndvaluerate_ )
- else SET_INT_PROPERTY( "madewith", madewith_ )
else SET_INT_PROPERTY( "incognito", incognito )
else SET_INT_PROPERTY( "timeunused", time_unused )
--- 2319,2322 ----
***************
*** 2490,2494 ****
else GET_PROPERTY( "morez", (int)morez_ )
else GET_PROPERTY( "dye", dye_ )
- else GET_PROPERTY( "attack", (int)att_ )
else GET_PROPERTY( "defense", (int)def_ )
else GET_PROPERTY( "decaytime", (int)decaytime_ )
--- 2428,2431 ----
***************
*** 2504,2512 ****
else GET_PROPERTY( "disabled", (int)disabled_ )
else GET_PROPERTY( "poisoned", (int)poisoned_ )
- else GET_PROPERTY( "rank", rank_ )
- else GET_PROPERTY( "creator", creator_ )
- else GET_PROPERTY( "good", good_ )
- else GET_PROPERTY( "rndvaluerate", rndvaluerate_ )
- else GET_PROPERTY( "madewith", madewith_ )
else GET_PROPERTY( "incognito", incognito ? 1 : 0 )
else GET_PROPERTY( "timeunused", (int)time_unused )
--- 2441,2444 ----
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.174
retrieving revision 1.175
diff -C2 -d -r1.174 -r1.175
*** items.h 27 Aug 2003 21:11:41 -0000 1.174
--- items.h 27 Aug 2003 21:43:57 -0000 1.175
***************
*** 109,113 ****
uint morez() const { return morez_; }
uchar dye() const { return dye_; }
- uint att() const { return att_; }
uint def() const { return def_; }
uchar magic() const { return magic_; }
--- 109,112 ----
***************
*** 115,141 ****
uint disabled() const { return disabled_; }
uint poisoned() const { return poisoned_; }
- int rank() const { return rank_; }
- QString creator() const { return creator_;}
uchar visible() const { return visible_;}
uchar priv() const { return priv_; }
- int good() const { return good_; }
- int rndvaluerate() const { return rndvaluerate_; }
- int madewith() const { return madewith_; }
//***************************END ADDED GETTERS************
- //----------------------[ ADVANCED PROPERTIES GETTERS ]------------------
-
- short charge_count() const { return charge_count_; }
- short charge_spell() const { return charge_spell_; }
-
- ushort drb_base() const { return drb_base_; }
- ushort drb_current() const { return drb_current_; }
- ushort uses_base() const { return uses_base_; }
- ushort uses_current() const { return uses_current_; }
-
-
- //------------------[ END OF ADVANCED PROPERTIES GETTERS ]---------------
-
// Setters
void setId( ushort nValue ) { id_ = nValue; flagChanged();};
--- 114,122 ----
***************
*** 162,166 ****
void setAntispamtimer ( uint data ) { antispamtimer_ = data; flagChanged();}
void setAccuracy( ushort data ) { accuracy_ = data; flagChanged();}
- void setCreator( const QString& d ) { creator_ = d; flagChanged(); changed( TOOLTIP );}
cItem();
--- 143,146 ----
***************
*** 171,175 ****
void toBackpack( P_CHAR pChar );
void showName( cUOSocket *socket );
- void applyRank( uchar rank );
//*****************************************ADDED SETTERS ***************
void setMore1( uchar data ) { more1_ = data; flagChanged();}
--- 151,154 ----
***************
*** 181,185 ****
void setMoreZ( uint data ) { morez_ = data; flagChanged();}
void setDye( uchar data ) { dye_ = data; flagChanged();}
- void setAtt( uint data ) { att_ = data; flagChanged();}
void setDef( uint data ) { def_ = data; flagChanged(); changed( TOOLTIP );}
void setMagic( uchar data ) { magic_ = data; flagChanged(); changed( TOOLTIP );}
--- 160,163 ----
***************
*** 190,214 ****
void setDisabled(uint data) { disabled_ = data; flagChanged();}
void setPoisoned(uint data) { poisoned_ = data; flagChanged();}
- void setRank(int data) { rank_ = data; flagChanged();}
void setVisible( uchar d ) { visible_ = d; flagChanged();}
void setPriv( uchar d ) { priv_ = d; flagChanged(); changed( TOOLTIP );}
- void setGood( int d ) { good_ = d; flagChanged();}
- void setRndValueRate( int d ) { rndvaluerate_ = d; flagChanged();}
- void setMadeWith( int d ) { madewith_ = d; flagChanged(); changed( TOOLTIP );}
void setContainer( cUObject* d ) { container_ = d; flagChanged(); }
//*******************************************END ADDED SETTERS**********
- //----------------------[ ADVANCED PROPERTIES SETTERS ]------------------
- void setChargeCount( short data ) { charge_count_ = data; }
- void setChargeSpell( short data ) { charge_spell_ = data; }
-
- void setDrb_base( ushort data ) { drb_base_ = data; }
- void setDrb_current( ushort data ) { drb_current_ = data; }
- void setUses_base( ushort data ) { uses_base_ = data; }
- void setUses_current( ushort data ) { uses_current_ = data; }
-
- //------------------[ END OF ADVANCED PROPERTIES SETTERS ]---------------
-
SERIAL spawnserial;
--- 168,177 ----
***************
*** 325,329 ****
uint morez_;
uchar dye_; // Reserved: Can item be dyed by dye kit
- uint att_; // Item attack
uint def_; // Item defense
uchar magic_; // 0=Default as stored in client, 1=Always movable, 2=Never movable, 3=Owner movable, 4=Locked Down
--- 288,291 ----
***************
*** 331,341 ****
uint disabled_; //Item is disabled, cant trigger.
uint poisoned_; //AntiChrist -- for poisoning skill
- int rank_; //Magius(CHE) --- for rank system, this value is the LEVEL of the item from 1 to 10. Simply multiply the rank*10 and calculate the MALUS this item has from the original.
- // for example: RANK 5 ---> 5*10=50% of malus
- // this item has same values decreased by 50%..
- // RANK 1 ---> 1*10=10% this item has 90% of malus!
- // RANK 10 --> 10*10=100% this item has no malus! RANK 10 is automatically setted if you select RANKSYSTEM 0.
- // Vars: LODAMAGE,HIDAMAGE,ATT,DEF,HP,MAXHP
- QString creator_; // Store the name of the player made this item
SERIAL ownserial_;
uchar visible_; // 0=Normally Visible, 1=Owner & GM Visible, 2=GM Visible
--- 293,296 ----
***************
*** 352,370 ****
// 7 | 80 | <unused>
uchar priv_;
-
- int good_; // Store type of GOODs to trade system! (Plz not set as UNSIGNED) --- Magius(CHE)
- int rndvaluerate_; // Store the value calculated base on RANDOMVALUE in region.scp. ---- MAgius(CHE) (2)
- uchar madewith_; // Store the skills used to make this item -- Magius(CHE)
-
- // ADVANCED ITEM PROPERTIES
- // Charges
- ushort charge_count_; //Charges count
- ushort charge_spell_; //Charge spell
-
- // Durability
- ushort drb_base_; //Durability base
- ushort drb_current_; //Durability current
- ushort uses_base_; //Uses base
- ushort uses_current_; //Uses current
};
--- 307,310 ----
Index: makemenus.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/makemenus.cpp,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -d -r1.55 -r1.56
*** makemenus.cpp 20 Aug 2003 17:10:48 -0000 1.55
--- makemenus.cpp 27 Aug 2003 21:43:57 -0000 1.56
***************
*** 541,544 ****
--- 541,546 ----
rank = 1;
+ // Currently unused. This is such a mess i just dont have an overview
+
// finally lets create the items/npcs!
***************
*** 558,562 ****
if( pItem->isPileable() )
pItem->setAmount( miit.current()->amount() );
- pItem->applyRank( rank );
pBackpack->addItem( pItem );
pItem->update();
--- 560,563 ----
***************
*** 571,575 ****
if( pItem )
{
- pItem->applyRank( rank );
pBackpack->addItem( pItem );
pItem->update();
--- 572,575 ----
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** player.cpp 27 Aug 2003 21:11:41 -0000 1.29
--- player.cpp 27 Aug 2003 21:43:57 -0000 1.30
***************
*** 703,708 ****
pMount->setDexterity( pi->tags().get("dexterity").toInt() );
pMount->setIntelligence( pi->tags().get("intelligence").toInt() );
- pMount->setWanderX2( pi->att() );
- pMount->setWanderY2( pi->def() );
pMount->setHitpoints( pi->hp() );
pMount->setFame( pi->lodamage() );
--- 703,706 ----
***************
*** 798,803 ****
pMountItem->tags().set( "dexterity", pMount->dexterity() );
pMountItem->tags().set( "intelligence", pMount->intelligence() );
! pMountItem->setAtt( pMount->wanderX2() );
! pMountItem->setDef( pMount->wanderY2() );
pMountItem->setHp( pMount->hitpoints() );
pMountItem->setLodamage( pMount->fame() );
--- 796,800 ----
pMountItem->tags().set( "dexterity", pMount->dexterity() );
pMountItem->tags().set( "intelligence", pMount->intelligence() );
!
pMountItem->setHp( pMount->hitpoints() );
pMountItem->setLodamage( pMount->fame() );
Index: prototypes.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/prototypes.h,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -d -r1.102 -r1.103
*** prototypes.h 23 Aug 2003 15:20:29 -0000 1.102
--- prototypes.h 27 Aug 2003 21:43:57 -0000 1.103
***************
*** 62,66 ****
void playmonstersound(P_CHAR monster, unsigned short id, int sfx);
void sellaction(int s);
- void StoreItemRandomValue(P_ITEM pi,QString tmpreg); // by Magius(CHE) (2) for trade system
void clearalltrades();
--- 62,65 ----
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.443
retrieving revision 1.444
diff -C2 -d -r1.443 -r1.444
*** wolfpack.cpp 27 Aug 2003 20:35:10 -0000 1.443
--- wolfpack.cpp 27 Aug 2003 21:43:57 -0000 1.444
***************
*** 1167,1215 ****
}
- void StoreItemRandomValue(P_ITEM pi,QString tmpreg)
- { // Function Created by Magius(CHE) for trade System
- int max=0,min=0;
-
- if( pi == NULL )
- return;
- if (pi->good()<0) return;
-
- if (tmpreg == "none" )
- {
- P_ITEM pio = pi->getOutmostItem();
- if (!pio) return;
- cTerritory* Region;
- if (pio->isInWorld())
- {
- Region = AllTerritories::instance()->region( pio->pos().x, pio->pos().y, pio->pos().map );
- if( Region != NULL )
- tmpreg = Region->name();
- }
- else
- {
- P_CHAR pc = dynamic_cast<P_CHAR>(pio->container());
- if (!pc) return;
- Region = AllTerritories::instance()->region( pc->pos().x, pc->pos().y, pc->pos().map );
- if( Region != NULL )
- tmpreg = Region->name();
- }
- return;
- }
-
- if( pi->good() < 0 || pi->good() > 255 )
- return;
-
- cTerritory* Region = AllTerritories::instance()->region( tmpreg );
-
- min=Region->tradesystem_[pi->good()].rndmin;
- max=Region->tradesystem_[pi->good()].rndmax;
-
- if (max!=0 || min!=0)
- {
- pi->setRndValueRate( RandomNum(min,max) );
- }
- }
-
-
void init_creatures(void) // assigns the basesound, soundflag, who_am_i flag of all npcs
// LB 9.8.99/17.9/20.9
--- 1167,1170 ----
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -d -r1.31 -r1.32
*** world.cpp 27 Aug 2003 20:35:10 -0000 1.31
--- world.cpp 27 Aug 2003 21:43:57 -0000 1.32
***************
*** 346,353 ****
}
- // "Store Random value", whatever it does...
- if( pi->container() && pi->container()->isItem() )
- StoreItemRandomValue(pi, "none");
-
/* // effect on dex ? like plate eg.
if( pi->dx2() && pi->container() && pi->container()->isChar() )
--- 346,349 ----
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv5540/src
Modified Files:
basechar.cpp basechar.h customtags.cpp dragdrop.cpp items.cpp
items.h npc.cpp player.cpp
Log Message:
moved some properties from cItem to python
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** basechar.cpp 27 Aug 2003 20:35:09 -0000 1.37
--- basechar.cpp 27 Aug 2003 21:11:41 -0000 1.38
***************
*** 756,777 ****
}
- void cBaseChar::removeItemBonus(cItem* pi)
- {
- changed( TOOLTIP );
- changed_ = true;
- strength_ -= pi->strengthMod();
- dexterity_ -= pi->dexterityMod();
- intelligence_ -= pi->intelligenceMod();
- }
-
- void cBaseChar::giveItemBonus(cItem* pi)
- {
- changed( TOOLTIP );
- changed_ = true;
- strength_ += pi->strengthMod();
- dexterity_ += pi->dexterityMod();
- intelligence_ += pi->intelligenceMod();
- }
-
void cBaseChar::Init( bool createSerial )
{
--- 756,759 ----
***************
*** 919,924 ****
if( pHitItem->layer() != 0x0B && pHitItem->layer() != 0x10 && pHitItem->layer() != 0x15 )
{
! if( pHitItem->wearOut() )
! removeItemBonus( pHitItem ); // remove BONUS STATS given by equipped special items
}
}
--- 901,905 ----
if( pHitItem->layer() != 0x0B && pHitItem->layer() != 0x10 && pHitItem->layer() != 0x15 )
{
! pHitItem->wearOut();
}
}
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** basechar.h 27 Aug 2003 20:35:09 -0000 1.26
--- basechar.h 27 Aug 2003 21:11:41 -0000 1.27
***************
*** 134,139 ****
bool Wears(P_ITEM pi);
unsigned int getSkillSum() const;
- void removeItemBonus(cItem* pi);
- void giveItemBonus(cItem* pi);
void Init(bool ser = true);
bool isSameAs(P_CHAR pc);
--- 134,137 ----
Index: customtags.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** customtags.cpp 27 Aug 2003 20:35:10 -0000 1.27
--- customtags.cpp 27 Aug 2003 21:11:41 -0000 1.28
***************
*** 658,669 ****
{
if( d.tags_ )
- tags_ = d.tags_;
- else
tags_ = new QMap< QString, cVariant >( *d.tags_ );
changed = true;
}
! cCustomTags& cCustomTags::operator=( const cCustomTags& tags)
{
changed = true;
--- 658,669 ----
{
if( d.tags_ )
tags_ = new QMap< QString, cVariant >( *d.tags_ );
+ else
+ tags_ = 0;
changed = true;
}
! cCustomTags& cCustomTags::operator=( const cCustomTags& tags )
{
changed = true;
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.192
retrieving revision 1.193
diff -C2 -d -r1.192 -r1.193
*** dragdrop.cpp 27 Aug 2003 20:35:10 -0000 1.192
--- dragdrop.cpp 27 Aug 2003 21:11:41 -0000 1.193
***************
*** 192,198 ****
P_CHAR wearer = dynamic_cast<P_CHAR>( pItem->container() );
- if( wearer )
- wearer->removeItemBonus( pItem );
-
// resend the stat window
if( wearer && wearer->objectType() == enPlayer )
--- 192,195 ----
***************
*** 290,302 ****
if( equip && ( equip->layer() == tile.layer ) )
equip->toBackpack( wearer );
-
- wearer->removeItemBonus( equip );
}
// *finally* equip the item
wearer->addItem( static_cast<cBaseChar::enLayer>(item->layer()), item );
-
- // Add the item bonuses
- wearer->giveItemBonus( item );
}
--- 287,294 ----
***************
*** 391,430 ****
}
- // Required Strength
- if( pItem->strengthReq() > pWearer->strength() )
- {
- if( pWearer == pChar )
- socket->sysMessage( tr( "You cannot wear that item, you seem not strong enough" ) );
- else
- socket->sysMessage( tr( "This person can't wear that item, seems not strong enough" ) );
-
- socket->bounceItem( pItem, BR_NO_REASON );
- return;
- }
-
- // Required Dexterity
- if( pItem->dexterityReq() > pWearer->dexterity() )
- {
- if( pWearer == pChar )
- socket->sysMessage( tr( "You cannot wear that item, you seem not agile enough" ) );
- else
- socket->sysMessage( tr( "This person can't wear that item, seems not agile enough" ) );
-
- socket->bounceItem( pItem, BR_NO_REASON );
- return;
- }
-
- // Required Intelligence
- if( pItem->intelligenceReq() > pWearer->intelligence() )
- {
- if( pWearer == pChar )
- socket->sysMessage( tr( "You cannot wear that item, you seem not smart enough" ) );
- else
- socket->sysMessage( tr( "This person can't wear that item, seems not smart enough" ) );
-
- socket->bounceItem( pItem, BR_NO_REASON );
- return;
- }
-
// Males can't wear female armor
if( ( pChar->bodyID() == 0x0190 ) && ( pItem->id() >= 0x1C00 ) && ( pItem->id() <= 0x1C0D ) )
--- 383,386 ----
***************
*** 471,477 ****
// At this point we're certain that we can wear the item
pWearer->addItem( static_cast<cBaseChar::enLayer>(pTile.layer), pItem );
-
- // Apply the bonuses
- pWearer->giveItemBonus( pItem );
if( pWearer->objectType() == enPlayer )
--- 427,430 ----
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.337
retrieving revision 1.338
diff -C2 -d -r1.337 -r1.338
*** items.cpp 27 Aug 2003 20:35:10 -0000 1.337
--- items.cpp 27 Aug 2003 21:11:41 -0000 1.338
***************
*** 74,78 ****
// constructor
cItem::cItem(): container_(0), totalweight_(0), incognito(false),
! rndvaluerate_(0), dooropen_(0),timeused_last(0), sellprice_( 0 ),
buyprice_( 0 ), restock_( 1 ), antispamtimer_( 0 )
{
--- 74,78 ----
// constructor
cItem::cItem(): container_(0), totalweight_(0), incognito(false),
! rndvaluerate_(0), timeused_last(0), sellprice_( 0 ),
buyprice_( 0 ), restock_( 1 ), antispamtimer_( 0 )
{
***************
*** 100,104 ****
this->type_ = src.type_;
this->type2_ = src.type2_;
- this->offspell_ = src.offspell_;
this->weight_ = src.weight_;
this->more1_ = src.more1_;
--- 100,103 ----
***************
*** 110,115 ****
this->morez_ = src.morez_;
this->amount_ = src.amount_;
- this->doordir_ = src.doordir_;
- this->dooropen_ = src.dooropen_;
this->dye_ = src.dye_;
this->att_ = src.att_;
--- 109,112 ----
***************
*** 119,128 ****
this->hp_ = src.hp_;
this->maxhp_ = src.maxhp_;
- this->st_ = src.st_;
- this->st2_ = src.st2_;
- this->dx_ = src.dx_;
- this->dx2_ = src.dx2_;
- this->in_ = src.in_;
- this->in2_ = src.in2_;
this->speed_=src.speed_;
this->magic_ = src.magic_;
--- 116,119 ----
***************
*** 469,473 ****
addField("type", type_);
addField("type2", type2_);
- addField("offspell", offspell_);
addField("more1", more1_);
addField("more2", more2_);
--- 460,463 ----
***************
*** 478,482 ****
addField("morez", morez_);
addField("amount", amount_);
- addField("doordir", doordir_);
addField("dye", dye_);
addField("decaytime", (decaytime_ > uiCurrentTime) ? decaytime_ - uiCurrentTime : 0 );
--- 468,471 ----
***************
*** 485,489 ****
addField("hidamage", hidamage_);
addField("lodamage", lodamage_);
- addField("st", st_);
addField("time_unused", time_unused);
addField("weight", weight_);
--- 474,477 ----
***************
*** 491,499 ****
addField("maxhp", maxhp_);
addField("rank", rank_);
- addField("st2", st2_);
- addField("dx", dx_);
- addField("dx2", dx2_);
- addField("intelligence", in_);
- addField("intelligence2", in2_);
addField("speed", speed_);
addField("poisoned", poisoned_);
--- 479,482 ----
***************
*** 618,622 ****
this->type_=0; // For things that do special things on doubleclicking
this->type2_=0;
- this->offspell_ = 0;
this->weight_ = 0;
this->more1_=0; // For various stuff
--- 601,604 ----
***************
*** 628,633 ****
this->morez_=0;
this->amount_ = 1; // Amount of items in pile
- this->doordir_=0; // Reserved for doors
- this->dooropen_=0;
this->dye_=0; // Reserved: Can item be dyed by dye kit
this->att_=0; // Item attack
--- 610,613 ----
***************
*** 637,646 ****
this->hp_=0; //Number of hit points an item has.
this->maxhp_=0; // Max number of hit points an item can have.
- this->st_=0; // The strength needed to equip the item
- this->st2_=0; // The strength the item gives
- this->dx_ = 0; // The dexterity needed to equip the item
- this->dx2_ = 0; // The dexterity the item gives
- this->in_ = 0; // The intelligence needed to equip the item
- this->in2_ = 0; // The intelligence the item gives
this->speed_=0; //The speed of the weapon
this->magic_ = 0; // 0=Default as stored in client, 1=Always movable, 2=Never movable, 3=Owner movable.
--- 617,620 ----
***************
*** 1325,1344 ****
this->setTwohanded( false );
- // <requires type="xx">2</requires>
- else if( TagName == "requires" )
- {
- if( !Tag->hasAttribute( "type" ) )
- return;
-
- QString Type = Tag->getAttribute( "type" );
-
- if( Type == "str" )
- this->st_ = Value.toULong();
- else if( Type == "dex" )
- this->dx_ = Value.toULong();
- else if( Type == "int" )
- this->in_ = Value.toULong();
- }
-
// <visible />
// <invisible />
--- 1299,1302 ----
***************
*** 1351,1370 ****
this->visible_ = 1;
- // <modifier type="xx">2</modifier>
- else if( TagName == "modifier" )
- {
- if( !Tag->hasAttribute( "type" ) )
- return;
-
- QString Type = Tag->getAttribute( "type" );
-
- if( Type == "str" )
- this->st2_ = Value.toShort();
- else if( Type == "dex" )
- this->dx2_ = Value.toShort();
- else if( Type == "int" )
- this->in2_ = Value.toShort();
- }
-
// <dye />
// <nodye />
--- 1309,1312 ----
***************
*** 1532,1597 ****
}
- // <requires type="xx">2</requires>
- else if( TagName == "requires" )
- {
- if( !Tag->hasAttribute( "type" ) )
- return;
-
- QString Type = Tag->getAttribute( "type" );
-
- if( Type == "str" )
- {
- if( Value.contains(".") || Value.contains(",") )
- st_ = (INT32)ceil((float)st_ * Value.toFloat());
- else
- this->st_ += Value.toLong();
- }
- else if( Type == "dex" )
- {
- if( Value.contains(".") || Value.contains(",") )
- dx_ = (INT32)ceil((float)dx_ * Value.toFloat());
- else
- this->dx_ += Value.toLong();
- }
- else if( Type == "int" )
- {
- if( Value.contains(".") || Value.contains(",") )
- in_ = (INT32)ceil((float)in_ * Value.toFloat());
- else
- this->in_ += Value.toLong();
- }
- }
-
- // <modifier type="xx">2</modifier>
- else if( TagName == "modifier" )
- {
- if( !Tag->hasAttribute( "type" ) )
- return;
-
- QString Type = Tag->getAttribute( "type" );
-
- if( Type == "str" )
- {
- if( Value.contains(".") || Value.contains(",") )
- st2_ = (INT32)ceil((float)st2_ * Value.toFloat());
- else
- this->st2_ += Value.toLong();
- }
- else if( Type == "dex" )
- {
- if( Value.contains(".") || Value.contains(",") )
- dx2_ = (INT32)ceil((float)dx2_ * Value.toFloat());
- else
- this->dx2_ += Value.toLong();
- }
- else if( Type == "int" )
- {
- if( Value.contains(".") || Value.contains(",") )
- in2_ = (INT32)ceil((float)in2_ * Value.toFloat());
- else
- this->in2_ += Value.toLong();
- }
- }
-
else
cUObject::processNode( Tag );
--- 1474,1477 ----
***************
*** 2065,2069 ****
}
! this->remove();
return true;
}
--- 1945,1949 ----
}
! remove();
return true;
}
***************
*** 2162,2166 ****
type_ = atoi( result[offset++] );
type2_ = atoi( result[offset++] );
- offspell_ = atoi( result[offset++] );
more1_ = atoi( result[offset++] );
more2_ = atoi( result[offset++] );
--- 2042,2045 ----
***************
*** 2171,2175 ****
morez_ = atoi( result[offset++] );
amount_ = atoi( result[offset++] );
- doordir_ = atoi( result[offset++] );
dye_ = atoi( result[offset++] );
decaytime_ = atoi( result[offset++] );
--- 2050,2053 ----
***************
*** 2180,2184 ****
hidamage_ = atoi( result[offset++] );
lodamage_ = atoi( result[offset++] );
- st_ = atoi( result[offset++] );
time_unused = atoi( result[offset++] );
weight_ = atoi( result[offset++] );
--- 2058,2061 ----
***************
*** 2186,2194 ****
maxhp_ = atoi( result[offset++] );
rank_ = atoi( result[offset++] );
- st2_ = atoi( result[offset++] );
- dx_ = atoi( result[offset++] );
- dx2_ = atoi( result[offset++] );
- in_ = atoi( result[offset++] );
- in2_ = atoi( result[offset++] );
speed_ = atoi( result[offset++] );
poisoned_ = atoi( result[offset++] );
--- 2063,2066 ----
***************
*** 2214,2218 ****
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.creator,items.sk_name,items.color,items.cont,items.layer,items.type,items.type2,items.offspell,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.doordir,items.dye,items.decaytime,items.att,items.def,items.hidamage,items.lodamage,items.st,items.time_unused,items.weight,items.hp,items.maxhp,items.rank,items.st2,items.dx,items.dx2,items.intelligence,items.intelligence2,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.good,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
--- 2086,2090 ----
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.creator,items.sk_name,items.color,items.cont,items.layer,items.type,items.type2,items.offspell,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.dye,items.decaytime,items.att,items.def,items.hidamage,items.lodamage,items.time_unused,items.weight,items.hp,items.maxhp,items.rank,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.good,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
***************
*** 2409,2413 ****
else SET_INT_PROPERTY( "type", type_ )
else SET_INT_PROPERTY( "type2", type2_ )
- else SET_INT_PROPERTY( "offspell", offspell_ )
else SET_INT_PROPERTY( "speed", speed_ )
else SET_INT_PROPERTY( "lodamage", lodamage_ )
--- 2281,2284 ----
***************
*** 2474,2524 ****
else SET_INT_PROPERTY( "morey", morey_ )
else SET_INT_PROPERTY( "morez", morez_ )
- else SET_INT_PROPERTY( "doordir", doordir_ )
- else SET_INT_PROPERTY( "dooropen", dooropen_ )
else SET_INT_PROPERTY( "dye", dye_ )
else SET_INT_PROPERTY( "attack", att_ )
else SET_INT_PROPERTY( "defense", def_ )
- else SET_INT_PROPERTY( "strength", st_ )
- else SET_INT_PROPERTY( "dexterity", dx_ )
- else SET_INT_PROPERTY( "intelligence", in_ )
- else if( name == "strength2" )
- {
- P_CHAR pChar = dynamic_cast< P_CHAR >( container_ );
- if( pChar )
- pChar->removeItemBonus( this );
-
- st2_ = value.toInt();
-
- if( pChar )
- pChar->giveItemBonus( this );
-
- return 0;
- }
- else if( name == "dexterity2" )
- {
- P_CHAR pChar = dynamic_cast< P_CHAR >( container_ );
- if( pChar )
- pChar->removeItemBonus( this );
-
- dx2_ = value.toInt();
-
- if( pChar )
- pChar->giveItemBonus( this );
-
- return 0;
- }
- else if( name == "intelligence2" )
- {
- P_CHAR pChar = dynamic_cast< P_CHAR >( container_ );
- if( pChar )
- pChar->removeItemBonus( this );
-
- in2_ = value.toInt();
-
- if( pChar )
- pChar->giveItemBonus( this );
-
- return 0;
- }
else SET_INT_PROPERTY( "decaytime", decaytime_ )
--- 2345,2351 ----
***************
*** 2630,2634 ****
else GET_PROPERTY( "type", type_ )
else GET_PROPERTY( "type2", type2_ )
- else GET_PROPERTY( "offspell", offspell_ )
else GET_PROPERTY( "speed", speed_ )
else GET_PROPERTY( "lodamage", lodamage_ )
--- 2457,2460 ----
***************
*** 2663,2677 ****
else GET_PROPERTY( "morey", (int)morey_ )
else GET_PROPERTY( "morez", (int)morez_ )
- else GET_PROPERTY( "doordir", doordir_ )
- else GET_PROPERTY( "dooropen", dooropen_ )
else GET_PROPERTY( "dye", dye_ )
else GET_PROPERTY( "attack", (int)att_ )
else GET_PROPERTY( "defense", (int)def_ )
- else GET_PROPERTY( "strength", st_ )
- else GET_PROPERTY( "strength2", st2_ )
- else GET_PROPERTY( "dexterity", dx_ )
- else GET_PROPERTY( "dexterity2", dx2_ )
- else GET_PROPERTY( "intelligence", in_ )
- else GET_PROPERTY( "intelligence2", in2_ )
else GET_PROPERTY( "decaytime", (int)decaytime_ )
--- 2489,2495 ----
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.173
retrieving revision 1.174
diff -C2 -d -r1.173 -r1.174
*** items.h 27 Aug 2003 20:35:10 -0000 1.173
--- items.h 27 Aug 2003 21:11:41 -0000 1.174
***************
*** 81,85 ****
UI32 type() const { return type_; } // Used for hardcoded behaviour
UI32 type2() const { return type2_; }
- uchar offspell() const { return offspell_; }
bool secured() const { return priv_&0x08; } // Is the container secured (houses)
SI16 speed() const { return speed_; } // Weapon speed
--- 81,84 ----
***************
*** 109,123 ****
uint morey() const { return morey_; }
uint morez() const { return morez_; }
- uchar doordir() const { return doordir_; }
- uchar dooropen() const { return dooropen_; }
uchar dye() const { return dye_; }
uint att() const { return att_; }
uint def() const { return def_; }
- short strengthReq() const { return st_; }
- short strengthMod() const { return st2_; }
- short dexterityReq() const { return dx_; }
- short dexterityMod() const { return dx2_; }
- short intelligenceReq() const { return in_; }
- short intelligenceMod() const { return in2_; }
uchar magic() const { return magic_; }
uint decaytime() const { return decaytime_; }
--- 108,114 ----
***************
*** 156,160 ****
void setType( UI32 nValue ) { type_ = nValue; flagChanged();};
void setType2( UI32 nValue ) { type2_ = nValue; flagChanged();};
- void setOffspell( uchar nValue ) { offspell_ = nValue; flagChanged();};
void setSecured( bool nValue ) { ( nValue ) ? priv_ &= 0x08 : priv_ |= 0xF7; flagChanged(); changed( TOOLTIP );};
void setSpeed( SI16 nValue ) { speed_ = nValue; flagChanged(); changed( TOOLTIP );};
--- 147,150 ----
***************
*** 190,204 ****
void setMoreY( uint data ) { morey_ = data; flagChanged();}
void setMoreZ( uint data ) { morez_ = data; flagChanged();}
- void setDoorDir( uchar data ) { doordir_ = data; flagChanged();}
- void setDoorOpen( uchar data ) { dooropen_ = data; flagChanged();}
void setDye( uchar data ) { dye_ = data; flagChanged();}
void setAtt( uint data ) { att_ = data; flagChanged();}
void setDef( uint data ) { def_ = data; flagChanged(); changed( TOOLTIP );}
- void setStrengthReq( short data ) { st_ = data; flagChanged(); changed( TOOLTIP );}
- void setStrengthMod( short data ) { st2_ = data; flagChanged(); changed( TOOLTIP );}
- void setDexterityReq( short data ) { dx_ = data; flagChanged(); changed( TOOLTIP );}
- void setDexterityMod( short data ) { dx2_ = data; flagChanged(); changed( TOOLTIP );}
- void setIntelligenceReq( short data ) { in_ = data; flagChanged(); changed( TOOLTIP );}
- void setIntelligenceMod( short data ) { in2_ = data; flagChanged(); changed( TOOLTIP );}
void setMagic( uchar data ) { magic_ = data; flagChanged(); changed( TOOLTIP );}
void setDecayTime( uint data ) { decaytime_ = data; }
--- 180,186 ----
***************
*** 322,326 ****
ushort type_;
ushort type2_;
- uchar offspell_; // Whats that for ?!
SI16 speed_;
SI16 weight_;
--- 304,307 ----
***************
*** 343,357 ****
uint morey_;
uint morez_;
- uchar doordir_; // Reserved for doors
- uchar dooropen_;
uchar dye_; // Reserved: Can item be dyed by dye kit
uint att_; // Item attack
uint def_; // Item defense
- short st_; // The strength needed to equip the item
- short st2_; // The strength the item gives
- short dx_; // The dexterity needed to equip the item
- short dx2_; // The dexterity the item gives
- short in_; // The intelligence needed to equip the item
- short in2_; // The intelligence the item gives
uchar magic_; // 0=Default as stored in client, 1=Always movable, 2=Never movable, 3=Owner movable, 4=Locked Down
uint decaytime_;
--- 324,330 ----
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** npc.cpp 27 Aug 2003 20:35:10 -0000 1.34
--- npc.cpp 27 Aug 2003 21:11:41 -0000 1.35
***************
*** 574,581 ****
P_ITEM pi_j = *iit;
- if( !pi_j->newbie() )
- removeItemBonus( pi_j );
-
- // unequip trigger...
if( pi_j->layer() != 0x0B && pi_j->layer() != 0x10 )
{ // Let's check all items, except HAIRS and BEARD
--- 574,577 ----
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** player.cpp 27 Aug 2003 20:35:10 -0000 1.28
--- player.cpp 27 Aug 2003 21:11:41 -0000 1.29
***************
*** 587,593 ****
P_ITEM pi_j = *iit;
- if( !pi_j->newbie() )
- removeItemBonus( pi_j );
-
// unequip trigger...
if( pi_j->layer() != 0x0B && pi_j->layer() != 0x10 )
--- 587,590 ----
***************
*** 1238,1242 ****
// Put it onto the char
this->addItem( static_cast<cBaseChar::enLayer>( mLayer ), pItem );
- giveItemBonus( pItem );
}
}
--- 1235,1238 ----
|
|
From: <dar...@us...> - 2003-08-27 21:04:56
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv3774/scripts Modified Files: equipment.py Log Message: moved some properties from cItem to python Index: equipment.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/equipment.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** equipment.py 27 Aug 2003 20:55:05 -0000 1.1 --- equipment.py 27 Aug 2003 21:04:53 -0000 1.2 *************** *** 4,27 **** if item.hastag( 'req_str' ) and wearer.strength < int( item.gettag( 'req_str' ) ): if player != wearer: ! player.message( 'This person seems too weak to wear that.' ) return 1 else: ! player.message( 'You are too weak to wear that.' ) return 1 if item.hastag( 'req_dex' ) and wearer.dexterity < int( item.gettag( 'req_dex' ) ): if player != wearer: ! player.message( 'This person seems too clumsy to wear that.' ) return 1 else: ! player.message( 'You are too clumsy to wear that.' ) return 1 if item.hastag( 'req_int' ) and wearer.intelligence < int( item.gettag( 'req_int' ) ): if player != wearer: ! player.message( 'This person seems too dumb to wear that.' ) return 1 else: ! player.message( 'You are too dumb to wear that.' ) return 1 --- 4,27 ---- if item.hastag( 'req_str' ) and wearer.strength < int( item.gettag( 'req_str' ) ): if player != wearer: ! player.message( 'This person can\'t wear that item, seems not strong enough.' ) return 1 else: ! player.message( 'You cannot wear that item, you seem not strong enough.' ) return 1 if item.hastag( 'req_dex' ) and wearer.dexterity < int( item.gettag( 'req_dex' ) ): if player != wearer: ! player.message( 'This person can\'t wear that item, seems not agile enough.' ) return 1 else: ! player.message( 'You cannot wear that item, you seem not agile enough.' ) return 1 if item.hastag( 'req_int' ) and wearer.intelligence < int( item.gettag( 'req_int' ) ): if player != wearer: ! player.message( 'This person can\'t wear that item, seems not smart enough.' ) return 1 else: ! player.message( 'You cannot wear that item, you seem not smart enough.' ) return 1 |
|
From: <dar...@us...> - 2003-08-27 20:57:58
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/weaponry In directory sc8-pr-cvs1:/tmp/cvs-serv2189/definitions/items/weaponry Modified Files: archery.xml axes.xml fencing.xml maces.xml staffs.xml swords.xml Log Message: moved some properties from cItem to python Index: archery.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/weaponry/archery.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** archery.xml 23 Aug 2003 05:37:25 -0000 1.9 --- archery.xml 27 Aug 2003 20:57:52 -0000 1.10 *************** *** 22,26 **** <speed>25</speed> <weight>7.0</weight> ! <requires type="str">30</requires> <type>1006</type> <category>Weapons\Bows\Bow</category> --- 22,27 ---- <speed>25</speed> <weight>7.0</weight> ! <tag name="req_str" value="30" type="int" /> ! <events>equipment</events> <type>1006</type> <category>Weapons\Bows\Bow</category> *************** *** 41,45 **** <speed>24</speed> <weight>7.0</weight> ! <requires type="str">35</requires> <type>1007</type> <category>Weapons\Bows\Crossbow</category> --- 42,47 ---- <speed>24</speed> <weight>7.0</weight> ! <tag name="req_str" value="35" type="int" /> ! <events>equipment</events> <type>1007</type> <category>Weapons\Bows\Crossbow</category> *************** *** 60,64 **** <speed>22</speed> <weight>9.0</weight> ! <requires type="str">80</requires> <type>1007</type> <category>Weapons\Bows\Heavy Crossbow</category> --- 62,67 ---- <speed>22</speed> <weight>9.0</weight> ! <tag name="req_str" value="80" type="int" /> ! <events>equipment</events> <type>1007</type> <category>Weapons\Bows\Heavy Crossbow</category> *************** *** 79,83 **** <speed>25</speed> <weight>7.0</weight> ! <requires type="str">45</requires> <type>1006</type> <category>Weapons\Bows\Composite Bow</category> --- 82,87 ---- <speed>25</speed> <weight>7.0</weight> ! <tag name="req_str" value="45" type="int" /> ! <events>equipment</events> <type>1006</type> <category>Weapons\Bows\Composite Bow</category> *************** *** 98,102 **** <speed>41</speed> <weight>7.0</weight> ! <requires type="str">30</requires> <type>1007</type> <category>Weapons\Bows\Repeating Crossbow</category> --- 102,107 ---- <speed>41</speed> <weight>7.0</weight> ! <tag name="req_str" value="30" type="int" /> ! <events>equipment</events> <type>1007</type> <category>Weapons\Bows\Repeating Crossbow</category> Index: axes.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/weaponry/axes.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** axes.xml 23 Aug 2003 05:37:25 -0000 1.9 --- axes.xml 27 Aug 2003 20:57:52 -0000 1.10 *************** *** 22,26 **** <speed>31</speed> <weight>8.0</weight> ! <requires type="str">40</requires> <category>Weapons\Axes\Two Handed Axe</category> <type>1002</type> --- 22,27 ---- <speed>31</speed> <weight>8.0</weight> ! <tag name="req_str" value="40" type="int" /> ! <events>equipment</events> <category>Weapons\Axes\Two Handed Axe</category> <type>1002</type> *************** *** 40,44 **** <speed>29</speed> <weight>6.0</weight> ! <requires type="str">80</requires> <category>Weapons\Axes\Large Battle Axe</category> <type>1002</type> --- 41,46 ---- <speed>29</speed> <weight>6.0</weight> ! <tag name="req_str" value="80" type="int" /> ! <events>equipment</events> <category>Weapons\Axes\Large Battle Axe</category> <type>1002</type> *************** *** 58,62 **** <speed>33</speed> <weight>3.0</weight> ! <requires type="str">35</requires> <category>Weapons\Axes\War Axe</category> <type>1004</type> --- 60,65 ---- <speed>33</speed> <weight>3.0</weight> ! <tag name="req_str" value="35" type="int" /> ! <events>equipment</events> <category>Weapons\Axes\War Axe</category> <type>1004</type> *************** *** 76,80 **** <speed>41</speed> <weight>4.0</weight> ! <requires type="str">20</requires> <category>Weapons\Axes\Hatchet</category> <type>1002</type> --- 79,84 ---- <speed>41</speed> <weight>4.0</weight> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <category>Weapons\Axes\Hatchet</category> <type>1002</type> *************** *** 94,98 **** <speed>33</speed> <weight>3.0</weight> ! <requires type="str">40</requires> <category>Weapons\Axes\Large Battle Axe</category> <type>1002</type> --- 98,103 ---- <speed>33</speed> <weight>3.0</weight> ! <tag name="req_str" value="40" type="int" /> ! <events>equipment</events> <category>Weapons\Axes\Large Battle Axe</category> <type>1002</type> *************** *** 112,116 **** <speed>31</speed> <weight>4.0</weight> ! <requires type="str">35</requires> <type>1002</type> <category>Weapons\Axes\Battle Axe</category> --- 117,122 ---- <speed>31</speed> <weight>4.0</weight> ! <tag name="req_str" value="35" type="int" /> ! <events>equipment</events> <type>1002</type> <category>Weapons\Axes\Battle Axe</category> *************** *** 130,134 **** <speed>37</speed> <weight>4.0</weight> ! <requires type="str">35</requires> <type>1002</type> <category>Weapons\Axes\Large Battle Axe</category> --- 136,141 ---- <speed>37</speed> <weight>4.0</weight> ! <tag name="req_str" value="35" type="int" /> ! <events>equipment</events> <type>1002</type> <category>Weapons\Axes\Large Battle Axe</category> *************** *** 148,152 **** <speed>33</speed> <weight>3.0</weight> ! <requires type="str">45</requires> <type>1002</type> <category>Weapons\Axes\Double Axe</category> --- 155,160 ---- <speed>33</speed> <weight>3.0</weight> ! <tag name="req_str" value="45" type="int" /> ! <events>equipment</events> <type>1002</type> <category>Weapons\Axes\Double Axe</category> Index: fencing.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/weaponry/fencing.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** fencing.xml 23 Aug 2003 05:37:25 -0000 1.10 --- fencing.xml 27 Aug 2003 20:57:53 -0000 1.11 *************** *** 10,14 **** <item id="fencing_base"> ! <events>weapons_blades</events> <type>1005</type> </item> --- 10,14 ---- <item id="fencing_base"> ! <events>equipment,weapons_blades</events> <type>1005</type> </item> *************** *** 28,32 **** <speed>49</speed> <weight>1.0</weight> ! <requires type="str">10</requires> <category>Weapons\Fencing\Dagger</category> </item> --- 28,32 ---- <speed>49</speed> <weight>1.0</weight> ! <tag name="req_str" value="10" type="int" /> <category>Weapons\Fencing\Dagger</category> </item> *************** *** 46,50 **** <speed>53</speed> <weight>1.0</weight> ! <requires type="str">10</requires> <category>Weapons\Fencing\Kryss</category> </item> --- 46,50 ---- <speed>53</speed> <weight>1.0</weight> ! <tag name="req_str" value="10" type="int" /> <category>Weapons\Fencing\Kryss</category> </item> *************** *** 64,68 **** <speed>43</speed> <weight>10.0</weight> ! <requires type="str">50</requires> <category>Weapons\Fencing\Pitchfork</category> </item> --- 64,68 ---- <speed>43</speed> <weight>10.0</weight> ! <tag name="req_str" value="50" type="int" /> <category>Weapons\Fencing\Pitchfork</category> </item> *************** *** 82,86 **** <speed>49</speed> <weight>7.0</weight> ! <requires type="str">50</requires> <category>Weapons\Fencing\Double Bladed Staff</category> </item> --- 82,86 ---- <speed>49</speed> <weight>7.0</weight> ! <tag name="req_str" value="50" type="int" /> <category>Weapons\Fencing\Double Bladed Staff</category> </item> *************** *** 100,104 **** <speed>24</speed> <weight>12.0</weight> ! <requires type="str">95</requires> <category>Weapons\Fencing\Lance</category> </item> --- 100,104 ---- <speed>24</speed> <weight>12.0</weight> ! <tag name="req_str" value="95" type="int" /> <category>Weapons\Fencing\Lance</category> </item> *************** *** 118,122 **** <speed>37</speed> <weight>10.0</weight> ! <requires type="str">50</requires> <category>Weapons\Fencing\Pike</category> </item> --- 118,122 ---- <speed>37</speed> <weight>10.0</weight> ! <tag name="req_str" value="50" type="int" /> <category>Weapons\Fencing\Pike</category> </item> *************** *** 136,140 **** <speed>55</speed> <weight>4.0</weight> ! <requires type="str">40</requires> <category>Weapons\Fencing\Short Spear</category> </item> --- 136,140 ---- <speed>55</speed> <weight>4.0</weight> ! <tag name="req_str" value="40" type="int" /> <category>Weapons\Fencing\Short Spear</category> </item> *************** *** 154,158 **** <speed>42</speed> <weight>7.0</weight> ! <requires type="str">50</requires> <category>Weapons\Fencing\Spear</category> </item> --- 154,158 ---- <speed>42</speed> <weight>7.0</weight> ! <tag name="req_str" value="50" type="int" /> <category>Weapons\Fencing\Spear</category> </item> *************** *** 172,176 **** <speed>43</speed> <weight>1.0</weight> ! <requires type="str">35</requires> <category>Weapons\Fencing\War Fork</category> </item> --- 172,176 ---- <speed>43</speed> <weight>1.0</weight> ! <tag name="req_str" value="35" type="int" /> <category>Weapons\Fencing\War Fork</category> </item> Index: maces.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/weaponry/maces.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** maces.xml 23 Aug 2003 05:37:25 -0000 1.7 --- maces.xml 27 Aug 2003 20:57:53 -0000 1.8 *************** *** 28,32 **** <speed>40</speed> <weight>14.0</weight> ! <requires type="str">45</requires> <category>Weapons\Maces\Mace</category> </item> --- 28,33 ---- <speed>40</speed> <weight>14.0</weight> ! <tag name="req_str" value="45" type="int" /> ! <events>equipment</events> <category>Weapons\Maces\Mace</category> </item> *************** *** 46,50 **** <speed>44</speed> <weight>14.0</weight> ! <requires type="str">40</requires> <category>Weapons\Maces\Mace</category> </item> --- 47,52 ---- <speed>44</speed> <weight>14.0</weight> ! <tag name="req_str" value="40" type="int" /> ! <events>equipment</events> <category>Weapons\Maces\Mace</category> </item> *************** *** 64,68 **** <speed>26</speed> <weight>17.0</weight> ! <requires type="str">80</requires> <category>Weapons\Maces\War Mace</category> </item> --- 66,71 ---- <speed>26</speed> <weight>17.0</weight> ! <tag name="req_str" value="80" type="int" /> ! <events>equipment</events> <category>Weapons\Maces\War Mace</category> </item> *************** *** 82,86 **** <speed>28</speed> <weight>10.0</weight> ! <requires type="str">95</requires> <category>Weapons\Maces\War Hammer</category> </item> --- 85,90 ---- <speed>28</speed> <weight>10.0</weight> ! <tag name="req_str" value="95" type="int" /> ! <events>equipment</events> <category>Weapons\Maces\War Hammer</category> </item> *************** *** 100,104 **** <speed>32</speed> <weight>14.0</weight> ! <requires type="str">45</requires> <category>Weapons\Maces\Maul</category> </item> --- 104,109 ---- <speed>32</speed> <weight>14.0</weight> ! <tag name="req_str" value="45" type="int" /> ! <events>equipment</events> <category>Weapons\Maces\Maul</category> </item> *************** *** 118,122 **** <speed>28</speed> <weight>9.0</weight> ! <requires type="str">45</requires> <category>Weapons\Maces\Hammer Pick</category> </item> --- 123,128 ---- <speed>28</speed> <weight>9.0</weight> ! <tag name="req_str" value="45" type="int" /> ! <events>equipment</events> <category>Weapons\Maces\Hammer Pick</category> </item> *************** *** 136,140 **** <speed>30</speed> <weight>7.0</weight> ! <requires type="str">40</requires> <category>Weapons\Maces\Scepter</category> </item> --- 142,147 ---- <speed>30</speed> <weight>7.0</weight> ! <tag name="req_str" value="40" type="int" /> ! <events>equipment</events> <category>Weapons\Maces\Scepter</category> </item> Index: staffs.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/weaponry/staffs.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** staffs.xml 23 Aug 2003 05:37:25 -0000 1.8 --- staffs.xml 27 Aug 2003 20:57:53 -0000 1.9 *************** *** 28,32 **** <speed>39</speed> <weight>6.0</weight> ! <requires type="str">35</requires> <category>Weapons\Staves\Black Staff</category> </item> --- 28,33 ---- <speed>39</speed> <weight>6.0</weight> ! <tag name="req_str" value="35" type="int" /> ! <events>equipment</events> <category>Weapons\Staves\Black Staff</category> </item> *************** *** 45,49 **** <speed>48</speed> <weight>4.0</weight> ! <requires type="str">30</requires> <category>Weapons\Staves\Quarter Staff</category> </item> --- 46,51 ---- <speed>48</speed> <weight>4.0</weight> ! <tag name="req_str" value="30" type="int" /> ! <events>equipment</events> <category>Weapons\Staves\Quarter Staff</category> </item> *************** *** 62,66 **** <speed>33</speed> <weight>3.0</weight> ! <requires type="str">20</requires> <category>Weapons\Staves\Grarled Staff</category> </item> --- 64,69 ---- <speed>33</speed> <weight>3.0</weight> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <category>Weapons\Staves\Grarled Staff</category> </item> *************** *** 79,83 **** <speed>40</speed> <weight>2.0</weight> ! <requires type="str">20</requires> <category>Weapons\Staves\Crook</category> </item> --- 82,87 ---- <speed>40</speed> <weight>2.0</weight> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <category>Weapons\Staves\Crook</category> </item> Index: swords.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/weaponry/swords.xml,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** swords.xml 23 Aug 2003 05:37:25 -0000 1.10 --- swords.xml 27 Aug 2003 20:57:53 -0000 1.11 *************** *** 11,15 **** <item id="swords_base"> <type>1001</type> ! <events>weapons_blades</events> </item> --- 11,15 ---- <item id="swords_base"> <type>1001</type> ! <events>equipment,weapons_blades</events> </item> *************** *** 28,32 **** <speed>33</speed> <weight>6.0</weight> ! <requires type="str">30</requires> <category>Weapons\Swords\Broadsword</category> </item> --- 28,32 ---- <speed>33</speed> <weight>6.0</weight> ! <tag name="req_str" value="30" type="int" /> <category>Weapons\Swords\Broadsword</category> </item> *************** *** 46,50 **** <speed>30</speed> <weight>7.0</weight> ! <requires type="str">35</requires> <category>Weapons\Swords\Longsword 1</category> </item> --- 46,50 ---- <speed>30</speed> <weight>7.0</weight> ! <tag name="req_str" value="35" type="int" /> <category>Weapons\Swords\Longsword 1</category> </item> *************** *** 64,68 **** <speed>37</speed> <weight>6.0</weight> ! <requires type="str">25</requires> <category>Weapons\Swords\Scimitar</category> </item> --- 64,68 ---- <speed>37</speed> <weight>6.0</weight> ! <tag name="req_str" value="25" type="int" /> <category>Weapons\Swords\Scimitar</category> </item> *************** *** 82,86 **** <speed>30</speed> <weight>1.0</weight> ! <requires type="str">35</requires> <category>Weapons\Swords\Longsword 2</category> </item> --- 82,86 ---- <speed>30</speed> <weight>1.0</weight> ! <tag name="req_str" value="35" type="int" /> <category>Weapons\Swords\Longsword 2</category> </item> *************** *** 100,104 **** <speed>28</speed> <weight>6.0</weight> ! <requires type="str">40</requires> <category>Weapons\Swords\Viking Sword (N/S)</category> </item> --- 100,104 ---- <speed>28</speed> <weight>6.0</weight> ! <tag name="req_str" value="40" type="int" /> <category>Weapons\Swords\Viking Sword (N/S)</category> </item> *************** *** 118,122 **** <speed>46</speed> <weight>6.0</weight> ! <requires type="str">25</requires> <category>Weapons\Swords\Katana</category> </item> --- 118,122 ---- <speed>46</speed> <weight>6.0</weight> ! <tag name="req_str" value="25" type="int" /> <category>Weapons\Swords\Katana</category> </item> *************** *** 136,140 **** <speed>25</speed> <weight>16.0</weight> ! <requires type="str">95</requires> <category>Weapons\Swords\Halberd</category> </item> --- 136,140 ---- <speed>25</speed> <weight>16.0</weight> ! <tag name="req_str" value="95" type="int" /> <category>Weapons\Swords\Halberd</category> </item> *************** *** 154,158 **** <speed>44</speed> <weight>8.0</weight> ! <requires type="str">25</requires> <category>Weapons\Swords\Cutlass</category> </item> --- 154,158 ---- <speed>44</speed> <weight>8.0</weight> ! <tag name="req_str" value="25" type="int" /> <category>Weapons\Swords\Cutlass</category> </item> *************** *** 172,176 **** <speed>28</speed> <weight>7.0</weight> ! <requires type="str">45</requires> <category>Weapons\Swords\Bardiche</category> </item> --- 172,176 ---- <speed>28</speed> <weight>7.0</weight> ! <tag name="req_str" value="45" type="int" /> <category>Weapons\Swords\Bardiche</category> </item> *************** *** 190,194 **** <speed>46</speed> <weight>1.0</weight> ! <requires type="str">10</requires> <category>Weapons\Swords\Cleaver</category> </item> --- 190,194 ---- <speed>46</speed> <weight>1.0</weight> ! <tag name="req_str" value="10" type="int" /> <category>Weapons\Swords\Cleaver</category> </item> *************** *** 208,212 **** <speed>49</speed> <weight>1.0</weight> ! <requires type="str">5</requires> <category>Weapons\Swords\Skinning Knive</category> </item> --- 208,212 ---- <speed>49</speed> <weight>1.0</weight> ! <tag name="req_str" value="5" type="int" /> <category>Weapons\Swords\Skinning Knive</category> </item> *************** *** 226,230 **** <speed>49</speed> <weight>1.0</weight> ! <requires type="str">5</requires> <category>Weapons\Swords\Butcher Knife</category> </item> --- 226,230 ---- <speed>49</speed> <weight>1.0</weight> ! <tag name="req_str" value="5" type="int" /> <category>Weapons\Swords\Butcher Knife</category> </item> *************** *** 244,248 **** <speed>35</speed> <weight>11.0</weight> ! <requires type="str">50</requires> <category>Weapons\Swords\Pickaxe</category> <category>Professions\Miner\Pickaxe (N/S)</category> --- 244,248 ---- <speed>35</speed> <weight>11.0</weight> ! <tag name="req_str" value="50" type="int" /> <category>Weapons\Swords\Pickaxe</category> <category>Professions\Miner\Pickaxe (N/S)</category> *************** *** 263,267 **** <speed>36</speed> <weight>5.0</weight> ! <requires type="str">25</requires> <category>Weapons\Swords\Bone Harvester</category> </item> --- 263,267 ---- <speed>36</speed> <weight>5.0</weight> ! <tag name="req_str" value="25" type="int" /> <category>Weapons\Swords\Bone Harvester</category> </item> *************** *** 281,285 **** <speed>47</speed> <weight>8.0</weight> ! <requires type="str">55</requires> <category>Weapons\Swords\Crescent Blade</category> </item> --- 281,285 ---- <speed>47</speed> <weight>8.0</weight> ! <tag name="req_str" value="55" type="int" /> <category>Weapons\Swords\Crescent Blade</category> </item> *************** *** 299,303 **** <speed>32</speed> <weight>10.0</weight> ! <requires type="str">45</requires> <category>Weapons\Swords\Scythe</category> </item> --- 299,303 ---- <speed>32</speed> <weight>10.0</weight> ! <tag name="req_str" value="45" type="int" /> <category>Weapons\Swords\Scythe</category> </item> *************** *** 317,321 **** <speed>37</speed> <weight>12.0</weight> ! <requires type="str">40</requires> <category>Weapons\Swords\Bladed Staff</category> </item> --- 317,321 ---- <speed>37</speed> <weight>12.0</weight> ! <tag name="req_str" value="40" type="int" /> <category>Weapons\Swords\Bladed Staff</category> </item> |
|
From: <dar...@us...> - 2003-08-27 20:57:57
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1:/tmp/cvs-serv2189/definitions Modified Files: scripts.xml Log Message: moved some properties from cItem to python Index: scripts.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/scripts.xml,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** scripts.xml 27 Aug 2003 20:02:21 -0000 1.53 --- scripts.xml 27 Aug 2003 20:57:53 -0000 1.54 *************** *** 29,33 **** <script>environment</script> <script>door</script> ! <script>armor</script> <!-- Commands --> --- 29,33 ---- <script>environment</script> <script>door</script> ! <script>equipment</script> <!-- Commands --> |
|
From: <dar...@us...> - 2003-08-27 20:57:56
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/armory In directory sc8-pr-cvs1:/tmp/cvs-serv2189/definitions/items/armory Modified Files: bone.xml chainmail.xml leather.xml studded.xml Log Message: moved some properties from cItem to python Index: bone.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/armory/bone.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** bone.xml 23 Aug 2003 22:05:00 -0000 1.4 --- bone.xml 27 Aug 2003 20:57:52 -0000 1.5 *************** *** 9,13 **** <definitions> ! <!-- Bone ARms --> <item id="1453"> <id>0x1453</id> --- 9,13 ---- <definitions> ! <!-- Bone Arms --> <item id="1453"> <id>0x1453</id> *************** *** 15,19 **** <decay /> <nodye /> - <requires type="str">55</requires> <defense>3</defense> <durability><random min="25" max="30" /></durability> --- 15,18 ---- *************** *** 22,25 **** --- 21,26 ---- <value>0</value> <category>Armor\Bone\Bone Arms</category> + <tag name="req_str" value="55" type="int" /> + <events>equipment</events> </item> *************** *** 30,34 **** <decay /> <nodye /> ! <requires type="str">60</requires> <defense>3</defense> <durability><random min="25" max="30" /></durability> --- 31,36 ---- <decay /> <nodye /> ! <tag name="req_str" value="60" type="int" /> ! <events>equipment</events> <defense>3</defense> <durability><random min="25" max="30" /></durability> *************** *** 45,49 **** <decay /> <nodye /> ! <requires type="str">55</requires> <defense>3</defense> <durability><random min="25" max="30" /></durability> --- 47,52 ---- <decay /> <nodye /> ! <tag name="req_str" value="55" type="int" /> ! <events>equipment</events> <defense>3</defense> <durability><random min="25" max="30" /></durability> *************** *** 60,64 **** <decay /> <nodye /> ! <requires type="str">20</requires> <defense>3</defense> <durability><random min="25" max="30" /></durability> --- 63,68 ---- <decay /> <nodye /> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <defense>3</defense> <durability><random min="25" max="30" /></durability> *************** *** 75,79 **** <decay /> <nodye /> ! <requires type="str">55</requires> <defense>3</defense> <durability><random min="25" max="30" /></durability> --- 79,84 ---- <decay /> <nodye /> ! <tag name="req_str" value="55" type="int" /> ! <events>equipment</events> <defense>3</defense> <durability><random min="25" max="30" /></durability> Index: chainmail.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/armory/chainmail.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** chainmail.xml 23 Aug 2003 22:05:00 -0000 1.5 --- chainmail.xml 27 Aug 2003 20:57:52 -0000 1.6 *************** *** 12,16 **** <decay /> <nodye /> ! <requires type="str">60</requires> <defense>4</defense> <durability><random min="45" max="60" /></durability> --- 12,17 ---- <decay /> <nodye /> ! <tag name="req_str" value="60" type="int" /> ! <events>equipment</events> <defense>4</defense> <durability><random min="45" max="60" /></durability> *************** *** 29,33 **** <decay /> <nodye /> ! <requires type="str">60</requires> <defense>4</defense> <durability><random min="45" max="60" /></durability> --- 30,35 ---- <decay /> <nodye /> ! <tag name="req_str" value="60" type="int" /> ! <events>equipment</events> <defense>4</defense> <durability><random min="45" max="60" /></durability> *************** *** 46,50 **** <decay /> <nodye /> ! <requires type="str">60</requires> <defense>4</defense> <durability><random min="45" max="60" /></durability> --- 48,53 ---- <decay /> <nodye /> ! <tag name="req_str" value="60" type="int" /> ! <events>equipment</events> <defense>4</defense> <durability><random min="45" max="60" /></durability> Index: leather.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/armory/leather.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** leather.xml 23 Aug 2003 22:05:00 -0000 1.5 --- leather.xml 27 Aug 2003 20:57:52 -0000 1.6 *************** *** 18,22 **** <decay /> <nodye /> ! <requires type="str">20</requires> <defense>2</defense> <durability><random min="30" max="40" /></durability> --- 18,23 ---- <decay /> <nodye /> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="30" max="40" /></durability> *************** *** 34,38 **** <decay /> <nodye /> ! <requires type="str">20</requires> <defense>2</defense> <durability><random min="30" max="40" /></durability> --- 35,40 ---- <decay /> <nodye /> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="30" max="40" /></durability> *************** *** 50,54 **** <decay /> <nodye /> ! <requires type="str">20</requires> <defense>2</defense> <durability><random min="30" max="40" /></durability> --- 52,57 ---- <decay /> <nodye /> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="30" max="40" /></durability> *************** *** 66,70 **** <decay /> <nodye /> ! <requires type="str">20</requires> <defense>2</defense> <durability><random min="30" max="40" /></durability> --- 69,74 ---- <decay /> <nodye /> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="30" max="40" /></durability> *************** *** 82,86 **** <decay /> <nodye /> ! <requires type="str">25</requires> <defense>2</defense> <durability><random min="30" max="40" /></durability> --- 86,91 ---- <decay /> <nodye /> ! <tag name="req_str" value="25" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="30" max="40" /></durability> *************** *** 99,103 **** <decay /> <nodye /> ! <requires type="str">25</requires> <defense>2</defense> <durability><random min="30" max="40" /></durability> --- 104,109 ---- <decay /> <nodye /> ! <tag name="req_str" value="25" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="30" max="40" /></durability> *************** *** 115,119 **** <decay /> <nodye /> ! <requires type="str">20</requires> <defense>2</defense> <durability><random min="30" max="40" /></durability> --- 121,126 ---- <decay /> <nodye /> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="30" max="40" /></durability> *************** *** 131,135 **** <decay /> <nodye /> ! <requires type="str">20</requires> <defense>2</defense> <durability><random min="30" max="40" /></durability> --- 138,143 ---- <decay /> <nodye /> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="30" max="40" /></durability> *************** *** 147,151 **** <decay /> <nodye /> ! <requires type="str">20</requires> <defense>2</defense> <durability><random min="30" max="40" /></durability> --- 155,160 ---- <decay /> <nodye /> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="30" max="40" /></durability> *************** *** 163,167 **** <decay /> <nodye /> ! <requires type="str">20</requires> <defense>2</defense> <durability><random min="30" max="40" /></durability> --- 172,177 ---- <decay /> <nodye /> ! <tag name="req_str" value="20" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="30" max="40" /></durability> Index: studded.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/armory/studded.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** studded.xml 23 Aug 2003 22:05:00 -0000 1.2 --- studded.xml 27 Aug 2003 20:57:52 -0000 1.3 *************** *** 18,22 **** <decay /> <nodye /> ! <requires type="str">25</requires> <defense>2</defense> <durability><random min="35" max="45" /></durability> --- 18,23 ---- <decay /> <nodye /> ! <tag name="req_str" value="25" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="35" max="45" /></durability> *************** *** 34,38 **** <decay /> <nodye /> ! <requires type="str">25</requires> <defense>2</defense> <durability><random min="35" max="45" /></durability> --- 35,40 ---- <decay /> <nodye /> ! <tag name="req_str" value="25" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="35" max="45" /></durability> *************** *** 50,54 **** <decay /> <nodye /> ! <requires type="str">25</requires> <defense>2</defense> <durability><random min="35" max="45" /></durability> --- 52,57 ---- <decay /> <nodye /> ! <tag name="req_str" value="25" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="35" max="45" /></durability> *************** *** 66,70 **** <decay /> <nodye /> ! <requires type="str">30</requires> <defense>2</defense> <durability><random min="35" max="45" /></durability> --- 69,74 ---- <decay /> <nodye /> ! <tag name="req_str" value="30" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="35" max="45" /></durability> *************** *** 82,86 **** <decay /> <nodye /> ! <requires type="str">35</requires> <defense>2</defense> <durability><random min="35" max="45" /></durability> --- 86,91 ---- <decay /> <nodye /> ! <tag name="req_str" value="35" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="35" max="45" /></durability> *************** *** 100,104 **** <decay /> <nodye /> ! <requires type="str">35</requires> <defense>2</defense> <durability><random min="35" max="45" /></durability> --- 105,110 ---- <decay /> <nodye /> ! <tag name="req_str" value="35" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="35" max="45" /></durability> *************** *** 116,120 **** <decay /> <nodye /> ! <requires type="str">35</requires> <defense>2</defense> <durability><random min="35" max="45" /></durability> --- 122,127 ---- <decay /> <nodye /> ! <tag name="req_str" value="35" type="int" /> ! <events>equipment</events> <defense>2</defense> <durability><random min="35" max="45" /></durability> |
|
From: <dar...@us...> - 2003-08-27 20:55:10
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1:/tmp/cvs-serv1829/scripts Added Files: equipment.py Log Message: moved some properties from cItem to python --- NEW FILE: equipment.py --- # Check for Strength Requirements def onWearItem( player, wearer, item, layer ): if item.hastag( 'req_str' ) and wearer.strength < int( item.gettag( 'req_str' ) ): if player != wearer: player.message( 'This person seems too weak to wear that.' ) return 1 else: player.message( 'You are too weak to wear that.' ) return 1 if item.hastag( 'req_dex' ) and wearer.dexterity < int( item.gettag( 'req_dex' ) ): if player != wearer: player.message( 'This person seems too clumsy to wear that.' ) return 1 else: player.message( 'You are too clumsy to wear that.' ) return 1 if item.hastag( 'req_int' ) and wearer.intelligence < int( item.gettag( 'req_int' ) ): if player != wearer: player.message( 'This person seems too dumb to wear that.' ) return 1 else: player.message( 'You are too dumb to wear that.' ) return 1 return 0 def onEquip( char, item, layer ): # Boni? changed = 0 if item.hastag( 'boni_str' ): char.strength = char.strength + int( item.gettag( 'boni_str' ) ) changed = 1 if item.hastag( 'boni_dex' ): char.dexterity = char.dexterity + int( item.gettag( 'boni_dex' ) ) changed = 1 if item.hastag( 'boni_int' ): char.intelligence = char.intelligence + int( item.gettag( 'boni_int' ) ) changed = 1 if changed and char.socket: char.socket.resendstatus() def onUnequip( char, item, layer ): changed = 0 if item.hastag( 'boni_str' ): char.strength = char.strength - int( item.gettag( 'boni_str' ) ) changed = 1 if item.hastag( 'boni_dex' ): char.dexterity = char.dexterity - int( item.gettag( 'boni_dex' ) ) changed = 1 if item.hastag( 'boni_int' ): char.intelligence = char.intelligence - int( item.gettag( 'boni_int' ) ) changed = 1 if changed and char.socket: char.socket.resendstatus() |
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv30896/src
Modified Files:
Trade.cpp ai_vendors.cpp basechar.cpp basechar.h boats.cpp
boats.h books.h chars.cpp corpse.h customtags.cpp customtags.h
dbl_single_click.cpp dragdrop.cpp house.h items.cpp items.h
multis.h npc.cpp npc.h persistentobject.h player.cpp player.h
pythonscript.cpp pythonscript.h resources.cpp resources.h
targetrequests.cpp uobject.cpp uobject.h wolfpack.cpp
world.cpp
Log Message:
moved some properties from cItem to python
Index: Trade.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/Trade.cpp,v
retrieving revision 1.84
retrieving revision 1.85
diff -C2 -d -r1.84 -r1.85
*** Trade.cpp 20 Aug 2003 17:10:48 -0000 1.84
--- Trade.cpp 27 Aug 2003 20:35:09 -0000 1.85
***************
*** 222,237 ****
}
- // this is a q&d fix for 'sell price higher than buy price' bug (Duke, 30.3.2001)
- static bool items_match(P_ITEM pi1, P_ITEM pi2)
- {
- if (pi1 && pi2 && pi1->id()==pi2->id() &&
- pi1->type()==pi2->type() &&
- !(pi1->id()==0x14F0 && (pi1->morex()!=pi2->morex())) && // house deeds only differ by morex
- !(IsShield(pi1->id()) && pi1->name2() == pi2->name2()) && // magic shields only differ by name2
- !(IsMetalArmour(pi1->id()) && pi1->color() != pi2->color()) ) // color checking for armour
- return true;
- return false;
- }
-
void Trade::sellAction( cUOSocket *socket, cUORxSell *packet )
{
--- 222,225 ----
***************
*** 311,315 ****
continue;
! if( (*it)->id() == pItem->id() && (*it)->color() == pItem->color() && (*it)->amount() >= pItem->amount() )
{
found = true;
--- 299,306 ----
continue;
! if( (*it)->id() == pItem->id() &&
! (*it)->color() == pItem->color() &&
! (*it)->amount() >= pItem->amount() &&
! (*it)->eventList() == pItem->eventList() )
{
found = true;
Index: ai_vendors.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/ai_vendors.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** ai_vendors.cpp 20 Aug 2003 17:10:48 -0000 1.10
--- ai_vendors.cpp 27 Aug 2003 20:35:09 -0000 1.11
***************
*** 242,246 ****
pGem->setId( 0x1ea7 );
pGem->setName( tr("petitem: %1").arg(pPet->name()) );
- pGem->setName2( player->name() );
pGem->setVisible( 2 ); // gm visible
pPack->addItem( pGem );
--- 242,245 ----
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -d -r1.36 -r1.37
*** basechar.cpp 27 Aug 2003 01:39:58 -0000 1.36
--- basechar.cpp 27 Aug 2003 20:35:09 -0000 1.37
***************
*** 143,147 ****
fields.push_back( "characters.poison,characters.poisoned" );
fields.push_back( "characters.murderertime,characters.criminaltime,characters.nutriment" );
! fields.push_back( "characters.stealthsteps,characters.gender,characters.propertyflags" );
fields.push_back( "characters.attacker,characters.combattarget,characters.murderer" );
fields.push_back( "characters.guarding" );
--- 143,147 ----
fields.push_back( "characters.poison,characters.poisoned" );
fields.push_back( "characters.murderertime,characters.criminaltime,characters.nutriment" );
! fields.push_back( "characters.gender,characters.propertyflags" );
fields.push_back( "characters.attacker,characters.combattarget,characters.murderer" );
fields.push_back( "characters.guarding" );
***************
*** 194,198 ****
criminalTime_ = atoi( result[offset++] ) + uiCurrentTime;
nutriment_ = atoi( result[offset++] );
- stealthedSteps_ = atoi( result[offset++] );
gender_ = atoi( result[offset++] );
propertyFlags_ = atoi( result[offset++] );
--- 194,197 ----
***************
*** 638,641 ****
--- 637,641 ----
this->addItem( static_cast<cBaseChar::enLayer>(layer), pi );
+
cUOTxCharEquipment packet;
packet.setWearer( this->serial() );
***************
*** 1483,1493 ****
if ( atLayer( layer ) != 0 )
{
! clConsole.send( tr("WARNING: Trying to put an item on layer %1 which is already occupied\n").arg(layer) );
! pi->setContainer(0);
return;
}
if( !noRemove )
! pi->removeFromCont();
content_.insert( (ushort)(layer), pi );
--- 1483,1498 ----
if ( atLayer( layer ) != 0 )
{
! clConsole.log( LOG_WARNING, QString( "Trying to put an item on layer %1 which is already occupied\n" ).arg( layer ) );
! pi->setContainer( 0 );
return;
}
if( !noRemove )
! {
! // Dragging doesnt count as Equipping
! if( layer != Dragging )
! pi->onEquip( this, layer );
! pi->removeFromCont();
! }
content_.insert( (ushort)(layer), pi );
***************
*** 1504,1507 ****
--- 1509,1516 ----
if ( pi )
{
+ // Dragging doesnt count as Equipping
+ if( layer != Dragging )
+ pi->onUnequip( this, layer );
+
pi->setContainer(0);
pi->setLayer( 0 );
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** basechar.h 27 Aug 2003 01:39:58 -0000 1.25
--- basechar.h 27 Aug 2003 20:35:09 -0000 1.26
***************
*** 59,65 ****
class cBaseChar : public cUObject
{
- Q_OBJECT
-
public:
// con-/destructors
cBaseChar();
--- 59,68 ----
class cBaseChar : public cUObject
{
public:
+ const char *objectID() const
+ {
+ return "cBaseChar";
+ }
+
// con-/destructors
cBaseChar();
Index: boats.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/boats.cpp,v
retrieving revision 1.108
retrieving revision 1.109
diff -C2 -d -r1.108 -r1.109
*** boats.cpp 23 Aug 2003 01:03:30 -0000 1.108
--- boats.cpp 27 Aug 2003 20:35:09 -0000 1.109
***************
*** 48,52 ****
#include "wpconsole.h"
#include "player.h"
!
#undef DBGFILE
--- 48,52 ----
#include "wpconsole.h"
#include "player.h"
! #include "inlines.h"
#undef DBGFILE
Index: boats.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/boats.h,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** boats.h 6 Jul 2003 13:48:01 -0000 1.26
--- boats.h 27 Aug 2003 20:35:09 -0000 1.27
***************
*** 68,76 ****
class cBoat : public cMulti
{
- Q_OBJECT
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
cBoat();
--- 68,80 ----
class cBoat : public cMulti
{
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
+ const char *objectID() const
+ {
+ return "cBoat";
+ }
+
cBoat();
Index: books.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/books.h,v
retrieving revision 1.28
retrieving revision 1.29
diff -C2 -d -r1.28 -r1.29
*** books.h 26 Aug 2003 15:01:05 -0000 1.28
--- books.h 27 Aug 2003 20:35:10 -0000 1.29
***************
*** 45,53 ****
class cBook : public cItem
{
- Q_OBJECT
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
cBook();
--- 45,57 ----
class cBook : public cItem
{
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
+ const char *objectID() const
+ {
+ return "cBook";
+ }
+
cBook();
Index: chars.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/chars.cpp,v
retrieving revision 1.328
retrieving revision 1.329
diff -C2 -d -r1.328 -r1.329
*** chars.cpp 20 Aug 2003 17:10:48 -0000 1.328
--- chars.cpp 27 Aug 2003 20:35:10 -0000 1.329
***************
*** 55,59 ****
#define DBGFILE "chars.cpp"
! void cCharStuff::DeleteChar (P_CHAR pc_k) // Delete character
{
if( !pc_k )
--- 55,59 ----
#define DBGFILE "chars.cpp"
! void cCharStuff::DeleteChar( P_CHAR pc_k ) // Delete character
{
if( !pc_k )
Index: corpse.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/corpse.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** corpse.h 21 Aug 2003 05:04:35 -0000 1.14
--- corpse.h 27 Aug 2003 20:35:10 -0000 1.15
***************
*** 47,51 ****
class cCorpse: public cItem
{
- Q_OBJECT
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
--- 47,50 ----
***************
*** 90,94 ****
void addEquipment( UINT8 layer, SERIAL serial );
! virtual QString objectID( void ) const { return "cCorpse"; }
virtual void flagUnchanged() { cCorpse::changed_ = false; cItem::flagUnchanged(); }
--- 89,97 ----
void addEquipment( UINT8 layer, SERIAL serial );
! const char *objectID() const
! {
! return "cCorpse";
! }
!
virtual void flagUnchanged() { cCorpse::changed_ = false; cItem::flagUnchanged(); }
Index: customtags.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** customtags.cpp 27 Aug 2003 16:06:12 -0000 1.26
--- customtags.cpp 27 Aug 2003 20:35:10 -0000 1.27
***************
*** 744,747 ****
--- 744,758 ----
}
+ bool cCustomTags::has( const QString &key )
+ {
+ if( tags_ )
+ {
+ if( tags_->find( key ) != tags_->end() )
+ return true;
+ }
+
+ return false;
+ }
+
cVariant cCustomTags::get( const QString& key )
{
Index: customtags.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** customtags.h 27 Aug 2003 13:33:17 -0000 1.19
--- customtags.h 27 Aug 2003 20:35:10 -0000 1.20
***************
*** 153,156 ****
--- 153,157 ----
cVariant get( const QString& key );
+ bool has( const QString& key );
void set( const QString& key, const cVariant& value );
void remove( const QString& key );
Index: dbl_single_click.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbl_single_click.cpp,v
retrieving revision 1.214
retrieving revision 1.215
diff -C2 -d -r1.214 -r1.215
*** dbl_single_click.cpp 23 Aug 2003 15:20:29 -0000 1.214
--- dbl_single_click.cpp 27 Aug 2003 20:35:10 -0000 1.215
***************
*** 210,214 ****
pc_currchar->action( 0x20 );
! pc_currchar->emote( tr( "*%1 loots the body of %2*" ).arg( pc_currchar->name() ).arg( pi->name2() ), 0x26 );
}
--- 210,214 ----
pc_currchar->action( 0x20 );
! pc_currchar->emote( tr( "*%1 loots the body of %2*" ).arg( pc_currchar->name() ).arg( pi->tags().get( "name" ).toString() ), 0x26 );
}
Index: dragdrop.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v
retrieving revision 1.191
retrieving revision 1.192
diff -C2 -d -r1.191 -r1.192
*** dragdrop.cpp 20 Aug 2003 17:10:48 -0000 1.191
--- dragdrop.cpp 27 Aug 2003 20:35:10 -0000 1.192
***************
*** 339,343 ****
--- 339,350 ----
{
socket->clilocMessage( 0x7A4D5, "", 0x3b2 ); // You can't do that when you're dead.
+ socket->bounceItem( pItem, BR_NO_REASON );
+ return;
+ }
+ // No Special Layer Equipping
+ if( ( packet->layer() > cBaseChar::InnerLegs || packet->layer() <= cBaseChar::TradeWindow ) && !pChar->isGM() )
+ {
+ socket->sysMessage( tr( "You can't equip on that layer." ) );
socket->bounceItem( pItem, BR_NO_REASON );
return;
***************
*** 352,355 ****
--- 359,375 ----
}
+ // Only GM's can equip other People
+ if( pWearer != pChar && !pChar->isGM() )
+ {
+ P_NPC pNpc = dynamic_cast< P_NPC >( pWearer );
+
+ // But we are allowed to equip our own humans
+ if( !pNpc || ( pNpc->owner() != pChar && pWearer->isHuman() ) )
+ socket->sysMessage( tr( "You can't equip other players." ) );
+
+ socket->bounceItem( pItem, BR_NO_REASON );
+ return;
+ }
+
// Get our tile-information
tile_st pTile = TileCache::instance()->getTile( pItem->id() );
***************
*** 360,363 ****
--- 380,390 ----
{
socket->sysMessage( tr( "This item cannot be equipped." ) );
+ socket->bounceItem( pItem, BR_NO_REASON );
+ return;
+ }
+
+ // Check the Script for it
+ if( pItem->onWearItem( pChar, pWearer, packet->layer() ) )
+ {
socket->bounceItem( pItem, BR_NO_REASON );
return;
Index: house.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/house.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** house.h 6 Jul 2003 13:48:01 -0000 1.29
--- house.h 27 Aug 2003 20:35:10 -0000 1.30
***************
*** 62,70 ****
class cHouse : public cMulti
{
- Q_OBJECT
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
unsigned int last_used;
--- 62,73 ----
class cHouse : public cMulti
{
private:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
+ const char *objectID() const
+ {
+ return "cHouse";
+ }
unsigned int last_used;
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.336
retrieving revision 1.337
diff -C2 -d -r1.336 -r1.337
*** items.cpp 27 Aug 2003 01:39:58 -0000 1.336
--- items.cpp 27 Aug 2003 20:35:10 -0000 1.337
***************
*** 85,89 ****
flagChanged();
this->name_ = src.name_;
- this->name2_ = src.name2_;
this->creator_ = src.creator_;
this->incognito = src.incognito;
--- 85,88 ----
***************
*** 460,465 ****
addField("serial", serial());
addField("id", id());
- addStrField("name", name_); // warning: items do not use cUObject name! (nuts, remove it)
- addStrField("name2", name2_);
addStrField("creator", creator_);
addField("sk_name", madewith_);
--- 459,462 ----
***************
*** 603,609 ****
this->setSerial( World::instance()->findItemSerial() );
this->container_ = 0;
- this->name_ = "#";
- this->name2_ = this->name_;
this->incognito=false;//AntiChrist - incognito
this->madewith_=0; // Added by Magius(CHE)
--- 600,607 ----
this->setSerial( World::instance()->findItemSerial() );
+ // We need to implement NULL checking here.
+ this->creator_ = QString::null;
+
this->container_ = 0;
this->incognito=false;//AntiChrist - incognito
this->madewith_=0; // Added by Magius(CHE)
***************
*** 1056,1059 ****
--- 1054,1108 ----
}
+ bool cItem::onEquip( P_CHAR pChar, unsigned char layer )
+ {
+ if( scriptChain )
+ {
+ unsigned int i = 0;
+ while( scriptChain[i] )
+ {
+ if( scriptChain[ i ]->onEquip( pChar, this, layer ) )
+ return true;
+
+ ++i;
+ }
+ }
+
+ return false;
+ }
+
+ bool cItem::onUnequip( P_CHAR pChar, unsigned char layer )
+ {
+ if( scriptChain )
+ {
+ unsigned int i = 0;
+ while( scriptChain[i] )
+ {
+ if( scriptChain[ i ]->onUnequip( pChar, this, layer ) )
+ return true;
+
+ ++i;
+ }
+ }
+
+ return false;
+ }
+
+ bool cItem::onWearItem( P_PLAYER pPlayer, P_CHAR pChar, unsigned char layer )
+ {
+ if( scriptChain )
+ {
+ unsigned int i = 0;
+ while( scriptChain[i] )
+ {
+ if( scriptChain[ i ]->onWearItem( pPlayer, pChar, this, layer ) )
+ return true;
+
+ ++i;
+ }
+ }
+
+ return false;
+ }
+
bool cItem::onUse( P_CHAR pChar )
{
***************
*** 1156,1163 ****
}
- // <identified>my magic item</identified>
- else if( TagName == "identified" )
- this->setName2( Value.latin1() );
-
// <attack min="1" max="2"/>
else if( TagName == "attack" )
--- 1205,1208 ----
***************
*** 1383,1387 ****
{
// Bad: # = iron #
! if( name_ == "#" )
{
name_ = getName( true );
--- 1428,1432 ----
{
// Bad: # = iron #
! if( name_.isNull() )
{
name_ = getName( true );
***************
*** 1406,1413 ****
}
- // <identified>%1 of Hardening</identified>
- else if( TagName == "identified" )
- name2_ = Value.arg( name2_ );
-
// <attack min="-1" max="+2"/>
else if( TagName == "attack" )
--- 1451,1454 ----
***************
*** 1608,1612 ****
QString itemname( "" );
! if( name_ != "#" )
itemname = getName();
--- 1649,1653 ----
QString itemname( "" );
! if( !name_.isNull() )
itemname = getName();
***************
*** 1634,1638 ****
// Show charges for wands only if they are identified
! if( type() == 15 && name_ == name2_ )
itemname.append( tr( " [%1 charge%2]" ).arg( morez_ ).arg( ( morez_ > 1 ) ? "s" : "" ) );
else if( type() == 404 || type() == 181 )
--- 1675,1679 ----
// Show charges for wands only if they are identified
! if( type() == 15 && !tags().has( "identified" ) )
itemname.append( tr( " [%1 charge%2]" ).arg( morez_ ).arg( ( morez_ > 1 ) ? "s" : "" ) );
else if( type() == 404 || type() == 181 )
***************
*** 1640,1644 ****
// Try a localized Message
! if( name_ == "#" )
socket->clilocMessageAffix( 0xF9060 + id_, "", itemname, 0x3B2, 3, this );
else
--- 1681,1685 ----
// Try a localized Message
! if( name_.isNull() )
socket->clilocMessageAffix( 0xF9060 + id_, "", itemname, 0x3B2, 3, this );
else
***************
*** 2078,2083 ****
if( pi->maxhp() == 0)
pi->setMaxhp( pi->hp() );
- if( pi->name() == "#" )
- pi->setName( QString::null );
}
--- 2119,2122 ----
***************
*** 2105,2110 ****
id_ = atoi( result[offset++] );
- name_ = result[offset++];
- name2_ = result[offset++];
creator_ = result[offset++];
madewith_ = atoi( result[offset++] );
--- 2144,2147 ----
***************
*** 2177,2181 ****
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.name,items.name2,items.creator,items.sk_name,items.color,items.cont,items.layer,items.type,items.type2,items.offspell,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.doordir,items.dye,items.decaytime,items.att,items.def,items.hidamage,items.lodamage,items.st,items.time_unused,items.weight,items.hp,items.maxhp,items.rank,items.st2,items.dx,items.dx2,items.intelligence,items.intelligence2,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.good,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
--- 2214,2218 ----
{
cUObject::buildSqlString( fields, tables, conditions );
! fields.push_back( "items.id,items.creator,items.sk_name,items.color,items.cont,items.layer,items.type,items.type2,items.offspell,items.more1,items.more2,items.more3,items.more4,items.morex,items.morey,items.morez,items.amount,items.doordir,items.dye,items.decaytime,items.att,items.def,items.hidamage,items.lodamage,items.st,items.time_unused,items.weight,items.hp,items.maxhp,items.rank,items.st2,items.dx,items.dx2,items.intelligence,items.intelligence2,items.speed,items.poisoned,items.magic,items.owner,items.visible,items.spawn,items.priv,items.sellprice,items.buyprice,items.restock,items.disabled,items.good,items.accuracy" ); // for now! later on we should specify each field
tables.push_back( "items" );
conditions.push_back( "uobjectmap.serial = items.serial" );
***************
*** 2369,2374 ****
}
- else SET_STR_PROPERTY( "name2", name2_ )
- else SET_STR_PROPERTY( "name", name_ )
else SET_INT_PROPERTY( "layer", layer_ )
else SET_INT_PROPERTY( "type", type_ )
--- 2406,2409 ----
***************
*** 2591,2596 ****
else GET_PROPERTY( "color", color_ )
else GET_PROPERTY( "amount", amount_ )
- else GET_PROPERTY( "name2", name2_ )
- else GET_PROPERTY( "name", name_ )
else GET_PROPERTY( "layer", layer_ )
// Flag properties are set elsewhere!!
--- 2626,2629 ----
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.172
retrieving revision 1.173
diff -C2 -d -r1.172 -r1.173
*** items.h 27 Aug 2003 13:33:17 -0000 1.172
--- items.h 27 Aug 2003 20:35:10 -0000 1.173
***************
*** 48,92 ****
class cItem : public cUObject
{
- Q_OBJECT
- Q_PROPERTY ( ushort id READ id WRITE setId )
- Q_PROPERTY ( ushort color READ color WRITE setColor )
- Q_PROPERTY ( ushort amount READ amount WRITE setAmount )
- Q_PROPERTY ( ushort restock READ restock WRITE setRestock )
- Q_PROPERTY ( uchar layer READ layer WRITE setLayer )
- Q_PROPERTY ( int totalweight READ totalweight WRITE setTotalweight )
- Q_PROPERTY ( ushort accuracy READ accuracy WRITE setAccuracy )
- Q_PROPERTY ( int sellprice READ sellprice WRITE setSellprice )
- Q_PROPERTY ( int buyprice READ buyprice WRITE setBuyprice )
- Q_PROPERTY ( uchar more1 READ more1 WRITE setMore1 )
- Q_PROPERTY ( uchar more2 READ more2 WRITE setMore2 )
- Q_PROPERTY ( uchar more3 READ more3 WRITE setMore3 )
- Q_PROPERTY ( uchar more4 READ more4 WRITE setMore4 )
- Q_PROPERTY ( uchar morex READ morex WRITE setMoreX )
- Q_PROPERTY ( uchar morey READ morey WRITE setMoreY )
- Q_PROPERTY ( uchar morez READ morez WRITE setMoreZ )
- Q_PROPERTY ( uchar doordir READ doordir WRITE setDoorDir )
- Q_PROPERTY ( uchar dooropen READ dooropen WRITE setDoorOpen )
- Q_PROPERTY ( uchar dye READ dye WRITE setDye )
- Q_PROPERTY ( uint att READ att WRITE setAtt )
- Q_PROPERTY ( uint def READ def WRITE setDef )
- Q_PROPERTY ( short StrengthReq READ strengthReq WRITE setStrengthReq )
- Q_PROPERTY ( short strengthMod READ strengthMod WRITE setStrengthMod )
- Q_PROPERTY ( short dexterityReq READ dexterityReq WRITE setDexterityReq )
- Q_PROPERTY ( short dexterityMod READ dexterityMod WRITE setDexterityMod )
- Q_PROPERTY ( short intelligenceMod READ intelligenceMod WRITE setIntelligenceMod )
- Q_PROPERTY ( short intelligenceReq READ intelligenceReq WRITE setIntelligenceReq )
- Q_PROPERTY ( uchar magic READ magic WRITE setMagic )
- Q_PROPERTY ( uint decaytime READ decaytime WRITE setDecayTime )
- Q_PROPERTY ( uint disabled READ disabled WRITE setDisabled )
- Q_PROPERTY ( uint poisoned READ poisoned WRITE setPoisoned )
- Q_PROPERTY ( int rank READ rank WRITE setRank )
- Q_PROPERTY ( QString creator READ creator WRITE setCreator )
- Q_PROPERTY ( int ownserial READ ownSerial WRITE SetOwnSerial )
- Q_PROPERTY ( uchar visible READ visible WRITE setVisible )
- Q_PROPERTY ( uchar priv READ priv WRITE setPriv )
- Q_PROPERTY ( int good READ good WRITE setGood )
- Q_PROPERTY ( int rndvaluerate READ rndvaluerate WRITE setRndValueRate )
- Q_PROPERTY ( uchar madewith READ madewith WRITE setMadeWith )
-
private:
bool changed_;
--- 48,51 ----
***************
*** 97,100 ****
--- 56,63 ----
public:
+ const char *objectID() const
+ {
+ return "cItem";
+ }
virtual void talk( const QString &message, ushort color = 0xFFFF, UINT8 type = 0, bool autospam = false, cUOSocket* socket = NULL );
***************
*** 114,118 ****
ushort amount() const { return amount_; } // Amount of items in pile
ushort restock() const { return restock_; } // Amount of items a vendor will respawn this item to.
- QString name2() const { return name2_; } // The identified name of the item
uchar layer() const { return layer_; } // Layer if equipped on paperdoll
bool twohanded() const { return priv_&0x20; } // Is the weapon twohanded ?
--- 77,80 ----
***************
*** 190,194 ****
void setAmount( ushort nValue );
void setRestock( ushort nValue ) { restock_ = nValue; flagChanged();}
- void setName2( const QString& nValue ) { name2_ = nValue; flagChanged(); changed( TOOLTIP );};
void setLayer( uchar nValue ) { layer_ = nValue; flagChanged();};
void setTwohanded( bool nValue ) { nValue ? priv_ &= 0x20 : priv_ |= 0xDF; flagChanged(); changed( TOOLTIP );};
--- 152,155 ----
***************
*** 292,296 ****
UINT16 getWeaponSkill();
! void MoveTo(int newx, int newy, signed char newz);
long reduceAmount( short amount = 1 );
short GetContGumpType();
--- 253,257 ----
UINT16 getWeaponSkill();
! void MoveTo( int newx, int newy, signed char newz );
long reduceAmount( short amount = 1 );
short GetContGumpType();
***************
*** 319,322 ****
--- 280,286 ----
virtual bool onSingleClick( P_PLAYER Viewer );
bool onUse( P_CHAR pChar );
+ bool onWearItem( P_PLAYER pPlayer, P_CHAR pChar, unsigned char layer );
+ bool onEquip( P_CHAR pChar, unsigned char layer );
+ bool onUnequip( P_CHAR pChar, unsigned char layer );
bool onCollide( P_CHAR pChar );
bool onDropOnChar( P_CHAR pChar );
***************
*** 353,357 ****
ushort amount_;
ushort restock_;
- QString name2_;
uchar layer_;
SI16 lodamage_;
--- 317,320 ----
Index: multis.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/multis.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** multis.h 6 Jul 2003 13:48:01 -0000 1.20
--- multis.h 27 Aug 2003 20:35:10 -0000 1.21
***************
*** 49,57 ****
class cMulti : public cItem
{
- Q_OBJECT
protected:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
cMulti();
virtual void toDeed( cUOSocket* socket ) = 0;
--- 49,61 ----
class cMulti : public cItem
{
protected:
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
public:
+ const char *objectID() const
+ {
+ return "cMulti";
+ }
+
cMulti();
virtual void toDeed( cUOSocket* socket ) = 0;
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** npc.cpp 27 Aug 2003 15:29:18 -0000 1.33
--- npc.cpp 27 Aug 2003 20:35:10 -0000 1.34
***************
*** 403,407 ****
changed_ = true;
int ele;
- int nType=0;
if( free )
--- 403,406 ----
***************
*** 536,546 ****
corpse->setBodyId( orgBodyID_ );
- corpse->setMoreY( this->isHuman() ); //is human??
corpse->setCarve( carve() ); //store carve section
! corpse->setName2( name() );
corpse->moveTo( pos() );
-
- corpse->setMore1(nType);
corpse->setDirection( direction() );
--- 535,543 ----
corpse->setBodyId( orgBodyID_ );
corpse->setCarve( carve() ); //store carve section
! corpse->tags().set( "human", cVariant( isHuman() ? 1 : 0 ) );
! corpse->tags().set( "name", cVariant( name() ) );
corpse->moveTo( pos() );
corpse->setDirection( direction() );
Index: npc.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** npc.h 26 Aug 2003 15:01:05 -0000 1.20
--- npc.h 27 Aug 2003 20:35:10 -0000 1.21
***************
*** 46,51 ****
class cNPC : public cBaseChar
{
- Q_OBJECT
public:
// con-/destructors
cNPC();
--- 46,55 ----
class cNPC : public cBaseChar
{
public:
+ const char *objectID() const
+ {
+ return "cUObject";
+ }
+
// con-/destructors
cNPC();
Index: persistentobject.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentobject.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** persistentobject.h 15 Jan 2003 14:47:02 -0000 1.7
--- persistentobject.h 27 Aug 2003 20:35:10 -0000 1.8
***************
*** 35,41 ****
#include <qobject.h>
! class PersistentObject : public QObject
{
- Q_OBJECT
protected:
bool isPersistent;
--- 35,40 ----
#include <qobject.h>
! class PersistentObject
{
protected:
bool isPersistent;
***************
*** 47,53 ****
virtual void load( char **, UINT16& );
virtual void save();
! virtual QString objectID() const
{
! return QString(className());
}
--- 46,53 ----
virtual void load( char **, UINT16& );
virtual void save();
!
! virtual const char *objectID() const
{
! return "PersistentObject";
}
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** player.cpp 27 Aug 2003 15:29:18 -0000 1.27
--- player.cpp 27 Aug 2003 20:35:10 -0000 1.28
***************
*** 49,53 ****
#include "pythonscript.h"
#include "scriptmanager.h"
!
cPlayer::cPlayer()
--- 49,53 ----
#include "pythonscript.h"
#include "scriptmanager.h"
! #include "inlines.h"
cPlayer::cPlayer()
***************
*** 385,389 ****
changed_ = true;
int ele;
- int nType=0;
if( free )
--- 385,388 ----
***************
*** 558,567 ****
corpse->setBodyId( orgBodyID_ );
! corpse->setMoreY( this->isHuman() ); //is human??
! corpse->setName2( name() );
corpse->moveTo( pos() );
- corpse->setMore1(nType);
corpse->setDirection( direction() );
--- 557,565 ----
corpse->setBodyId( orgBodyID_ );
! corpse->tags().set( "human", cVariant( isHuman() ? 1 : 0 ) );
! corpse->tags().set( "name", cVariant( name() ) );
corpse->moveTo( pos() );
corpse->setDirection( direction() );
Index: player.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** player.h 27 Aug 2003 01:39:59 -0000 1.18
--- player.h 27 Aug 2003 20:35:10 -0000 1.19
***************
*** 45,50 ****
class cPlayer : public cBaseChar
{
- Q_OBJECT
public:
// con-/destructors
cPlayer();
--- 45,54 ----
class cPlayer : public cBaseChar
{
public:
+ const char *objectID() const
+ {
+ return "cPlayer";
+ }
+
// con-/destructors
cPlayer();
Index: pythonscript.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pythonscript.cpp 27 Aug 2003 01:39:59 -0000 1.5
--- pythonscript.cpp 27 Aug 2003 20:35:10 -0000 1.6
***************
*** 576,584 ****
{
PyHasMethod( "onWorldSave" )
!
! // Create our args for the python function
! PyObject *tuple = PyTuple_New( 1 );
! //PyTuple_SetItem( tuple, 0, PyGetCharObject( pChar ) );
!
return PyEvalMethod( "onWorldSave", tuple );
}
--- 576,580 ----
{
PyHasMethod( "onWorldSave" )
! PyObject *tuple = PyTuple_New( 0 );
return PyEvalMethod( "onWorldSave", tuple );
}
***************
*** 587,596 ****
{
PyHasMethod( "onWorldLoad" )
// Create our args for the python function
! PyObject *tuple = PyTuple_New( 1 );
! //PyTuple_SetItem( tuple, 0, PyGetCharObject( pChar ) );
! return PyEvalMethod( "onWorldSave", tuple );
}
--- 583,628 ----
{
PyHasMethod( "onWorldLoad" )
+ PyObject *tuple = PyTuple_New( 0 );
+ return PyEvalMethod( "onWorldSave", tuple );
+ }
+
+ bool cPythonScript::onWearItem( P_PLAYER pPlayer, P_CHAR pChar, P_ITEM pItem, unsigned char layer )
+ {
+ PyHasMethod( "onWearItem" )
// Create our args for the python function
! PyObject *tuple = PyTuple_New( 4 );
! PyTuple_SetItem( tuple, 0, PyGetCharObject( pPlayer ) );
! PyTuple_SetItem( tuple, 1, PyGetCharObject( pChar ) );
! PyTuple_SetItem( tuple, 2, PyGetItemObject( pItem ) );
! PyTuple_SetItem( tuple, 3, PyInt_FromLong( layer ) );
! return PyEvalMethod( "onWearItem", tuple );
! }
!
! bool cPythonScript::onEquip( P_CHAR pChar, P_ITEM pItem, unsigned char layer )
! {
! PyHasMethod( "onEquip" )
!
! // Create our args for the python function
! PyObject *tuple = PyTuple_New( 3 );
! PyTuple_SetItem( tuple, 0, PyGetCharObject( pChar ) );
! PyTuple_SetItem( tuple, 1, PyGetItemObject( pItem ) );
! PyTuple_SetItem( tuple, 2, PyInt_FromLong( layer ) );
!
! return PyEvalMethod( "onEquip", tuple );
! }
!
! bool cPythonScript::onUnequip( P_CHAR pChar, P_ITEM pItem, unsigned char layer )
! {
! PyHasMethod( "onUnequip" )
!
! // Create our args for the python function
! PyObject *tuple = PyTuple_New( 3 );
! PyTuple_SetItem( tuple, 0, PyGetCharObject( pChar ) );
! PyTuple_SetItem( tuple, 1, PyGetItemObject( pItem ) );
! PyTuple_SetItem( tuple, 2, PyInt_FromLong( layer ) );
!
! return PyEvalMethod( "onUnequip", tuple );
}
Index: pythonscript.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** pythonscript.h 27 Aug 2003 01:39:59 -0000 1.5
--- pythonscript.h 27 Aug 2003 20:35:10 -0000 1.6
***************
*** 114,117 ****
--- 114,121 ----
bool onSpeech( cUObject *listener, P_CHAR talker, const QString &text, const QValueVector< UINT16 >& keywords );
+ bool onWearItem( P_PLAYER pPlayer, P_CHAR pChar, P_ITEM pItem, unsigned char layer );
+ bool onEquip( P_CHAR pChar, P_ITEM pItem, unsigned char layer );
+ bool onUnequip( P_CHAR pChar, P_ITEM pItem, unsigned char layer );
+
// Drop/Pickup events
bool onDropOnChar( P_CHAR pChar, P_ITEM pItem );
Index: resources.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/resources.cpp,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** resources.cpp 20 Aug 2003 17:10:48 -0000 1.42
--- resources.cpp 27 Aug 2003 20:35:10 -0000 1.43
***************
*** 31,34 ****
--- 31,35 ----
#include "resources.h"
+ #include "inlines.h"
#include "globals.h"
***************
*** 921,925 ****
{
pi->setName( item.name );
- pi->setName2( item.name );
}
--- 922,925 ----
***************
*** 1190,1195 ****
this->setId( 0x1ea7 );
this->amount_ = 1;
! this->setName( tr("resitem: %1").arg(resource) );
! this->setName2( this->name() );
this->setVisible( 2 ); // gm visible
}
--- 1190,1194 ----
this->setId( 0x1ea7 );
this->amount_ = 1;
! this->setName( QString( "resitem: %1" ).arg( resource ) );
this->setVisible( 2 ); // gm visible
}
Index: resources.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/resources.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** resources.h 6 Jul 2003 13:48:02 -0000 1.16
--- resources.h 27 Aug 2003 20:35:10 -0000 1.17
***************
*** 123,127 ****
class cResourceItem : public cItem
{
- Q_OBJECT
public:
cResourceItem( const QString& resource, UINT32 amount, UINT32 vein );
--- 123,126 ----
Index: targetrequests.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/targetrequests.cpp,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** targetrequests.cpp 23 Aug 2003 15:20:29 -0000 1.72
--- targetrequests.cpp 27 Aug 2003 20:35:10 -0000 1.73
***************
*** 268,272 ****
pc_currchar->isCriminal();//Blue and not attacker and not guild
! if (pi->name() != "#")
{
sprintf((char*)temp, tr("You notice %1 trying to steal %2 from you!").arg(pc_currchar->name()).arg(pi->name()) );
--- 268,272 ----
pc_currchar->isCriminal();//Blue and not attacker and not guild
! if( !pi->name().isNull() )
{
sprintf((char*)temp, tr("You notice %1 trying to steal %2 from you!").arg(pc_currchar->name()).arg(pi->name()) );
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.109
retrieving revision 1.110
diff -C2 -d -r1.109 -r1.110
*** uobject.cpp 27 Aug 2003 01:39:59 -0000 1.109
--- uobject.cpp 27 Aug 2003 20:35:10 -0000 1.110
***************
*** 153,157 ****
setTable( "uobjectmap" );
addField( "serial", serial_ );
! addStrField( "type", objectID() );
addCondition( "serial", serial_ );
saveFields;
--- 153,157 ----
setTable( "uobjectmap" );
addField( "serial", serial_ );
! addStrField( "type", QString( objectID() ) );
addCondition( "serial", serial_ );
saveFields;
***************
*** 467,493 ****
// </tag>
else if( TagName == "tag" )
! {
! QString tkey, tvalue;
! for( unsigned int i = 0; i < Tag->childCount(); ++i )
{
! const cElement *childTag = Tag->getChild( i );
!
! QString childValue = childTag->getValue();
! QString childName = childTag->name();
!
! if( childName == "key" )
! tkey = childValue;
!
! else if( childName == "value" )
! tvalue = childValue;
! }
! if( !tkey.isNull() && !tvalue.isNull() )
! {
! if( Tag->getAttribute( "type" ) == "value" )
! this->tags_.set( tkey, cVariant( tvalue.toInt() ) );
else
! this->tags_.set( tkey, cVariant( tvalue ) );
}
}
--- 467,484 ----
// </tag>
else if( TagName == "tag" )
! {
! QString name = Tag->getAttribute( "name" );
! QString value = Tag->getAttribute( "value" );
! if( !name.isNull() && !value.isNull() )
{
! QString type = Tag->getAttribute( "type", "string" );
! if( type == "int" )
! tags_.set( name, cVariant( hex2dec( value ).toInt() ) );
! else if( type == "float" )
! tags_.set( name, cVariant( value.toFloat() ) );
else
! tags_.set( name, cVariant( value ) );
}
}
Index: uobject.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -d -r1.73 -r1.74
*** uobject.h 27 Aug 2003 01:39:59 -0000 1.73
--- uobject.h 27 Aug 2003 20:35:10 -0000 1.74
***************
*** 61,68 ****
class cUObject : public PersistentObject, public cDefinable
{
- Q_OBJECT
- Q_PROPERTY( QString bindmenu READ bindmenu WRITE setBindmenu )
- Q_PROPERTY( QString name READ name WRITE setName )
- // Data Members
private:
uchar changed_:1;
--- 61,64 ----
***************
*** 78,82 ****
uchar dir_:3;
- protected:
// Things for building the SQL string
static void buildSqlString( QStringList &fields, QStringList &tables, QStringList &conditions );
--- 74,77 ----
***************
*** 92,95 ****
--- 87,95 ----
public:
+ const char *objectID() const
+ {
+ return "cUObject";
+ }
+
// EventHandling functions
cPythonScript **getEvents()
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.442
retrieving revision 1.443
diff -C2 -d -r1.442 -r1.443
*** wolfpack.cpp 27 Aug 2003 15:29:18 -0000 1.442
--- wolfpack.cpp 27 Aug 2003 20:35:10 -0000 1.443
***************
*** 355,358 ****
--- 355,359 ----
endmessage(0);
break;
+
case '#':
World::instance()->save();
***************
*** 559,562 ****
--- 560,580 ----
#endif
*/
+ /*clConsole.send( QString::number( sizeof cUObject ) + "\n" );
+ clConsole.send( QString::number( sizeof cItem ) + "\n" );
+
+ clConsole.send( "STARTING UP\n" );
+ Sleep( 5000 );
+
+ for( unsigned int x = 0; x < 100000; ++x )
+ {
+ cItem *pItem = new cItem;
+ pItem->Init();
+ }
+
+ clConsole.send( "STARTING UP\n" );
+ Sleep( 5000 );
+
+ return 0;*/
+
QApplication app( argc, argv, false ); // we need one instance
QTranslator translator( 0 ); // must be valid thru app life.
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** world.cpp 27 Aug 2003 15:29:18 -0000 1.30
--- world.cpp 27 Aug 2003 20:35:10 -0000 1.31
***************
*** 313,316 ****
--- 313,318 ----
if( pCont )
{
+ // NoRemove is important.
+ // It is faster *and* it prevents onEquip from being fired
pCont->addItem( (cBaseChar::enLayer)pi->layer(), pi, false, true );
}
|
|
From: <dar...@us...> - 2003-08-27 20:35:15
|
Update of /cvsroot/wpdev/wolfpack/convert In directory sc8-pr-cvs1:/tmp/cvs-serv30896/src/convert Removed Files: Makefile.freebsd Makefile.linux chars.cpp chars.h convert.dsp convert.pro guilds.cpp guilds.h guildstones.cpp house.cpp house.h items.cpp items.h main.cpp oldloader.cpp progress.h uobject.cpp Log Message: moved some properties from cItem to python --- Makefile.freebsd DELETED --- --- Makefile.linux DELETED --- --- chars.cpp DELETED --- --- chars.h DELETED --- --- convert.dsp DELETED --- --- convert.pro DELETED --- --- guilds.cpp DELETED --- --- guilds.h DELETED --- --- guildstones.cpp DELETED --- --- house.cpp DELETED --- --- house.h DELETED --- --- items.cpp DELETED --- --- items.h DELETED --- --- main.cpp DELETED --- --- oldloader.cpp DELETED --- --- progress.h DELETED --- --- uobject.cpp DELETED --- |
|
From: <dar...@us...> - 2003-08-27 20:35:14
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv30896/src/python
Modified Files:
skills.h
Log Message:
moved some properties from cItem to python
Index: skills.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/skills.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** skills.h 2 Jun 2003 17:16:58 -0000 1.11
--- skills.h 27 Aug 2003 20:35:10 -0000 1.12
***************
*** 82,87 ****
self->pChar->setSkillLock( skill, value );
! if( self->pChar->isA("cPlayer") && static_cast<P_PLAYER>(self->pChar)->socket() )
! static_cast<P_PLAYER>(self->pChar)->socket()->sendSkill( skill );
return 0;
--- 82,89 ----
self->pChar->setSkillLock( skill, value );
! P_PLAYER pPlayer = dynamic_cast< P_PLAYER >( self->pChar );
!
! if( pPlayer && pPlayer->socket() )
! pPlayer->socket()->sendSkill( skill );
return 0;
|
|
From: <dar...@us...> - 2003-08-27 20:35:13
|
Update of /cvsroot/wpdev/wolfpack/network
In directory sc8-pr-cvs1:/tmp/cvs-serv30896/src/network
Modified Files:
uosocket.cpp
Log Message:
moved some properties from cItem to python
Index: uosocket.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/network/uosocket.cpp,v
retrieving revision 1.276
retrieving revision 1.277
diff -C2 -d -r1.276 -r1.277
*** uosocket.cpp 20 Aug 2003 17:10:48 -0000 1.276
--- uosocket.cpp 27 Aug 2003 20:35:10 -0000 1.277
***************
*** 1055,1059 ****
if( !pItem->onShowTooltip( this->player(), &tooltips ) ) // just for test if object haven't tooltip
{
! if( pItem->name() == "#" || pItem->name().isNull() )
tooltips.addLine( 0xF9060 + pItem->id(), "" );
else
--- 1055,1059 ----
if( !pItem->onShowTooltip( this->player(), &tooltips ) ) // just for test if object haven't tooltip
{
! if( pItem->name().isNull() )
tooltips.addLine( 0xF9060 + pItem->id(), "" );
else
***************
*** 1076,1082 ****
}
}
-
-
}
// Show a context menu
/*!
--- 1076,1081 ----
}
}
}
+
// Show a context menu
/*!
|
|
From: <dar...@us...> - 2003-08-27 20:02:25
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1:/tmp/cvs-serv23931/definitions Modified Files: scripts.xml Log Message: moved some properties from cItem to python Index: scripts.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/scripts.xml,v retrieving revision 1.52 retrieving revision 1.53 diff -C2 -d -r1.52 -r1.53 *** scripts.xml 23 Aug 2003 15:21:36 -0000 1.52 --- scripts.xml 27 Aug 2003 20:02:21 -0000 1.53 *************** *** 29,32 **** --- 29,33 ---- <script>environment</script> <script>door</script> + <script>armor</script> <!-- Commands --> |
|
From: <dar...@us...> - 2003-08-27 16:06:15
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv13226/src
Modified Files:
books.cpp corpse.cpp customtags.cpp multis.cpp
persistentbroker.h
Log Message:
Improved SQL Loading and Saving speed.
Index: books.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/books.cpp,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** books.cpp 26 Aug 2003 15:36:44 -0000 1.43
--- books.cpp 27 Aug 2003 16:06:12 -0000 1.44
***************
*** 142,146 ****
for ( QStringList::iterator it = content_.begin(); it != content_.end(); ++it )
{
! persistentBroker->executeQuery( QString( "INSERT INTO bookpages SET serial = '%1', page = '%2', text = '%3'" ).arg( serial() ).arg( i ).arg( persistentBroker->quoteString( *it ) ) );
++i;
}
--- 142,146 ----
for ( QStringList::iterator it = content_.begin(); it != content_.end(); ++it )
{
! persistentBroker->executeQuery( QString( "INSERT INTO bookpages VALUES (%1,%2,'%3')" ).arg( serial() ).arg( i ).arg( persistentBroker->quoteString( *it ) ) );
++i;
}
***************
*** 160,253 ****
return cItem::del();
}
-
- /*void cBook::Serialize( ISerialization &archive )
- {
- if( archive.isReading() )
- {
- }
- else
- {
- archive.write( "book.title", title_ );
- archive.write( "book.author", author_ );
- UINT32 contsize = content_.size();
- archive.write( "book.contsize", contsize );
- UI32 i;
- for( i = 0; i < content_.size(); i++ )
- {
- archive.write( (char*)QString("book.content.page%1").arg(i).latin1(), content_[i] );
- }
- archive.write( "book.readonly", readonly_ );
- archive.write( "book.predefined", predefined_ );
- archive.write( "book.section", section_ );
- archive.write( "book.pages", pages_ );
- }
- cItem::Serialize( archive );
- }*/
-
- /*void cBook::save( const QString& s )
- {
- startSaveSqlStatement("Books");
- savePersistentIntValue("serial", serial); // never forget we have serials on each table
- savePersistentStrValue("title", title_ );
- savePersistentStrValue("author", author_ );
- for ( QMap<int, QString>::iterator it = content_.begin(); it != content_.end(); ++it )
- {
- startSaveSqlStatement("BookPages");
- savePersistentIntValue("serial", serial );
- savePersistentIntValue("page", it.key() );
- savePersistentStrValue("text", it.data() );
- endSaveSqlStatement(QString("serial='%1' AND page='%2'").arg(serial).arg(it.key()));
- }
- savePersistentIntValue("readonly", readonly_ );
- savePersistentIntValue("predefined", predefined_ );
- savePersistentStrValue("section", section_ );
- savePersistentIntValue("pages", pages_ );
- endSaveSqlStatement(QString("serial='%1'").arg(serial));
- cItem::save(s);
- }*/
-
- /*void cBook::load( const QString& s )
- {
- startLoadSqlStatement("Books", "serial", s)
- {
- loadPersistentStrValue("title", title_ );
- loadPersistentStrValue("author", author_ );
- QSqlCursor bookPages("BookPages");
- bookPages.select(QString("serial='%1'").arg(serial));
- while( bookPages.next() )
- {
- content_[bookPages.value("page").toInt()] = bookPages.value("text").toString();
- }
- loadPersistentIntValue( "readonly", readonly_ );
- loadPersistentIntValue( "predefined", predefined_ );
- loadPersistentStrValue( "section", section_ );
- loadPersistentIntValue( "pages", pages_ );
- }
- endLoadSqlStatement(s);
- cItem::load(s);
- }*/
-
- /*bool cBook::del( const QString& s )
- {
- QSqlCursor cursor("Books");
- cursor.select(QString("serial='%1'").arg(serial));
- while ( cursor.next() )
- {
- cursor.primeDelete();
- if ( cursor.del() > 1 )
- {
- qWarning("More than one record was deleted in table Books when only 1 was expected, delete criteria was:");
- qWarning(cursor.filter());
- }
- }
- cursor.setName("BookPages");
- cursor.select(QString("serial='%1'").arg(serial));
- while ( cursor.next() )
- {
- cursor.primeDelete();
- cursor.del();
- }
- return cItem::del( s );
- }*/
void cBook::processNode( const cElement *Tag )
--- 160,163 ----
Index: corpse.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/corpse.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** corpse.cpp 14 Jul 2003 16:58:49 -0000 1.32
--- corpse.cpp 27 Aug 2003 16:06:12 -0000 1.33
***************
*** 111,118 ****
// Equipment can change as well
if( isPersistent )
persistentBroker->executeQuery( QString( "DELETE FROM corpses_equipment WHERE serial = '%1'" ).arg( serial() ) );
for( map< UINT8, SERIAL >::iterator it = equipment_.begin(); it != equipment_.end(); ++it )
! persistentBroker->executeQuery( QString( "INSERT INTO corpses_equipment SET serial = '%1', layer = '%2', item = '%3'" ).arg( serial() ).arg( it->first ).arg( it->second ) );
cItem::save();
--- 111,120 ----
// Equipment can change as well
if( isPersistent )
+ {
persistentBroker->executeQuery( QString( "DELETE FROM corpses_equipment WHERE serial = '%1'" ).arg( serial() ) );
+ }
for( map< UINT8, SERIAL >::iterator it = equipment_.begin(); it != equipment_.end(); ++it )
! persistentBroker->executeQuery( QString( "INSERT INTO corpses_equipment VALUES(%1,%2,%3)" ).arg( serial() ).arg( it->first ).arg( it->second ) );
cItem::save();
Index: customtags.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** customtags.cpp 27 Aug 2003 13:33:17 -0000 1.25
--- customtags.cpp 27 Aug 2003 16:06:12 -0000 1.26
***************
*** 705,713 ****
// Save the Variant type and value
- QString type = it.data().typeName();
- QString value = it.data().toString();
QString name = it.key();
! persistentBroker->executeQuery( QString( "INSERT INTO tags SET serial = '%1', type = '%2', value = '%3', name = '%4'" ).arg( key ).arg( type ).arg( persistentBroker->quoteString( value ) ).arg( persistentBroker->quoteString( name ) ) );
}
--- 705,713 ----
// Save the Variant type and value
QString name = it.key();
+ QString type = it.data().typeName();
+ QString value = it.data().toString();
! persistentBroker->executeQuery( QString( "INSERT INTO tags VALUES(%1,'%2','%3','%4')" ).arg( key ).arg( persistentBroker->quoteString( name ) ).arg( type ).arg( persistentBroker->quoteString( value ) ) );
}
Index: multis.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/multis.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** multis.cpp 20 Aug 2003 17:10:48 -0000 1.32
--- multis.cpp 27 Aug 2003 16:06:12 -0000 1.33
***************
*** 132,139 ****
INT32 i;
for ( i = 0; i < bans_.size(); ++i )
! persistentBroker->executeQuery( QString( "INSERT INTO multis_bans SET serial = '%1', ban = '%2'" ).arg( serial() ).arg( bans_[i] ) );
for ( i = 0; i < friends_.size(); ++i )
! persistentBroker->executeQuery( QString( "INSERT INTO multis_friends SET serial = '%1', friend = '%2'" ).arg( serial() ).arg( friends_[i] ) );
cItem::save();
--- 132,139 ----
INT32 i;
for ( i = 0; i < bans_.size(); ++i )
! persistentBroker->executeQuery( QString( "INSERT INTO multis_bans VALUES(%1,%2)" ).arg( serial() ).arg( bans_[i] ) );
for ( i = 0; i < friends_.size(); ++i )
! persistentBroker->executeQuery( QString( "INSERT INTO multis_friends VALUES(%1,%2)" ).arg( serial() ).arg( friends_[i] ) );
cItem::save();
Index: persistentbroker.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** persistentbroker.h 27 Aug 2003 15:29:18 -0000 1.19
--- persistentbroker.h 27 Aug 2003 16:06:12 -0000 1.20
***************
*** 84,147 ****
};
- #define savePersistentIntValue(field, value) \
- SqlStatement += QString("%1='%2',").arg(field).arg(value)
-
- #define savePersistentStrValue(field, value) \
- if ( !value.isNull() ) \
- SqlStatement += QString("%1='%2',").arg(field).arg(persistentBroker->quoteString(value))
-
- #define startSaveSqlStatement(table) \
- QString SqlStatement; \
- if ( this->isPersistent ) \
- SqlStatement = QString("UPDATE %1 SET ").arg(table); \
- else \
- SqlStatement = QString("INSERT INTO %1 SET ").arg(table);
-
- #define endSaveSqlStatement(condition) \
- SqlStatement = SqlStatement.left( SqlStatement.length() - 1 ); \
- if ( this->isPersistent ) \
- persistentBroker->executeQuery( SqlStatement + QString("WHERE %1;").arg(condition)); \
- else \
- persistentBroker->executeQuery( SqlStatement + ";" );
-
- #define startLoadSqlStatement(table, keyfield, keyvalue) \
- static QSqlCursor cursor(table); \
- cursor.setMode( QSqlCursor::ReadOnly ); \
- cursor.select( QString("%1='%2'").arg(keyfield).arg(keyvalue) ); \
- if ( cursor.first() )
-
- #define endLoadSqlStatement(keyvalue) \
- else \
- qWarning(QString("Error trying to load persistent object %1, key %2").arg(typeid(this).name()).arg(keyvalue));
-
- #define loadPersistentStrValue(fieldName, property) \
- property = cursor.field(fieldName)->value().toString();
-
- #if defined(_DEBUG)
- #define loadPersistentIntValue(fieldName, property) \
- {\
- bool ok = false; \
- property = cursor.field(fieldName)->value().toInt(&ok); \
- if ( !ok ) \
- qWarning(QString("Error trying to read Integer value from field %1").arg(fieldName));\
- }
- #else
- #define loadPersistentIntValue(fieldName, property) \
- property = cursor.field(fieldName)->value().toInt()
- #endif
-
- #if defined(_DEBUG)
- #define loadPersistentUIntValue(fieldName, property) \
- { \
- bool ok = false; \
- property = cursor.field(fieldName)->value().toUInt(&ok); \
- if ( !ok ) \
- qWarning(QString("Error trying to read UInt value from field %1").arg(fieldName));\
- }
- #else
- #define loadPersistentUIntValue(fieldName, property) \
- property = cursor.field(fieldName)->value().toUInt()
- #endif
-
#define initSave QStringList conditions, fields, values; QString table;
#define clearFields conditions.clear(); fields.clear(); values.clear();
--- 84,87 ----
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv475/src
Modified Files:
npc.cpp persistentbroker.cpp persistentbroker.h player.cpp
wolf.dsp wolfpack.cpp world.cpp
Log Message:
Improved SQL Loading and Saving speed.
Index: npc.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/npc.cpp,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -d -r1.32 -r1.33
*** npc.cpp 26 Aug 2003 15:01:05 -0000 1.32
--- npc.cpp 27 Aug 2003 15:29:18 -0000 1.33
***************
*** 173,176 ****
--- 173,180 ----
addStrField( "ai", ai_->name() );
}
+ else
+ {
+ addStrField( "ai", QString::null );
+ }
addField( "wandertype", (UINT8)wanderType() );
addField( "wanderx1", wanderX1() );
Index: persistentbroker.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.cpp,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** persistentbroker.cpp 26 Aug 2003 15:36:44 -0000 1.15
--- persistentbroker.cpp 27 Aug 2003 15:29:18 -0000 1.16
***************
*** 92,96 ****
--- 92,101 ----
// Disable fsynch for sqlite
if( sqlite )
+ {
connection->exec( "PRAGMA synchronous = OFF;" );
+ connection->exec( "PRAGMA default_synchronous = OFF;" );
+ connection->exec( "PRAGMA full_column_names = OFF;" );
+ connection->exec( "PRAGMA show_datatypes = OFF;" );
+ }
return true;
***************
*** 106,111 ****
{
// Start Transaction
! if( sqlite )
! connection->exec( "BEGIN TRANSACTION;" );
try
--- 111,116 ----
{
// Start Transaction
! /*if( sqlite )
! connection->exec( "BEGIN TRANSACTION;" );*/
try
***************
*** 116,127 ****
{
// Rollback
! if( sqlite )
! connection->exec( "ROLLBACK TRANSACTION;" );
throw;
}
// Commit
! if( sqlite )
! connection->exec( "COMMIT TRANSACTION;" );
return true;
--- 121,132 ----
{
// Rollback
! /*if( sqlite )
! connection->exec( "ROLLBACK TRANSACTION;" );*/
throw;
}
// Commit
! /*if( sqlite )
! connection->exec( "COMMIT TRANSACTION;" );*/
return true;
Index: persistentbroker.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/persistentbroker.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** persistentbroker.h 26 Aug 2003 15:36:44 -0000 1.18
--- persistentbroker.h 27 Aug 2003 15:29:18 -0000 1.19
***************
*** 156,160 ****
else \
{ \
! fields.push_back( name ); \
values.push_back( QString::number( value ) ); \
}
--- 156,160 ----
else \
{ \
! /* fields.push_back( name ); */ \
values.push_back( QString::number( value ) ); \
}
***************
*** 165,169 ****
else \
{ \
! fields.push_back( name ); \
values.push_back( "'" + ( value.isNull() ? QString( "" ) : persistentBroker->quoteString( value ) ) + "'" ); \
}
--- 165,169 ----
else \
{ \
! /* fields.push_back( name ); */ \
values.push_back( "'" + ( value.isNull() ? QString( "" ) : persistentBroker->quoteString( value ) ) + "'" ); \
}
***************
*** 178,182 ****
else \
{ \
! persistentBroker->executeQuery( QString( "INSERT INTO %1 (%2) VALUES(%3)" ).arg( table ).arg( fields.join( "," ) ).arg( values.join( "," ) ) ); \
}
--- 178,182 ----
else \
{ \
! persistentBroker->executeQuery( QString( "INSERT INTO %1 VALUES(%3)" ).arg( table )/*.arg( fields.join( "," ) )*/.arg( values.join( "," ) ) ); \
}
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -d -r1.26 -r1.27
*** player.cpp 27 Aug 2003 01:39:59 -0000 1.26
--- player.cpp 27 Aug 2003 15:29:18 -0000 1.27
***************
*** 129,134 ****
--- 129,142 ----
addField( "serial", serial() );
+
if( account_ )
+ {
addStrField( "account", account_->login() );
+ }
+ else
+ {
+ addStrField( "account", QString::null );
+ }
+
addField( "additionalflags", additionalFlags_ );
addField( "visualrange", visualRange_ );
Index: wolf.dsp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolf.dsp,v
retrieving revision 1.206
retrieving revision 1.207
diff -C2 -d -r1.206 -r1.207
*** wolf.dsp 26 Aug 2003 15:05:38 -0000 1.206
--- wolf.dsp 27 Aug 2003 15:29:18 -0000 1.207
***************
*** 43,47 ****
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MD /GR /GX /O1 /Ob0 /I "lib/Python/PC" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "ZTHREAD_SHARED" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
--- 43,47 ----
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
! # ADD CPP /nologo /MD /GR /GX /O2 /Ob0 /I "lib/Python/PC" /I "lib/Python/include" /I "lib\ZThread\include" /I "$(QTDIR)\include" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "ZTHREAD_SHARED" /D "QT_DLL" /D "QT_THREAD_SUPPORT" /Fr /FD /c
# SUBTRACT CPP /YX
# ADD BASE RSC /l 0x409 /d "NDEBUG"
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.441
retrieving revision 1.442
diff -C2 -d -r1.441 -r1.442
*** wolfpack.cpp 27 Aug 2003 13:33:17 -0000 1.441
--- wolfpack.cpp 27 Aug 2003 15:29:18 -0000 1.442
***************
*** 559,573 ****
#endif
*/
- clConsole.send( "PAUSE" );
- Sleep( 10000 );
-
- for( unsigned int x = 0; x < 100000; ++x )
- {
- cItem *pItem = new cItem;
- }
-
- clConsole.send( "PAUSE" );
- Sleep( 10000 );
-
QApplication app( argc, argv, false ); // we need one instance
QTranslator translator( 0 ); // must be valid thru app life.
--- 559,562 ----
***************
*** 816,820 ****
serverState = RUNNING;
!
QWaitCondition niceLevel;
// This is our main loop
--- 805,809 ----
serverState = RUNNING;
!
QWaitCondition niceLevel;
// This is our main loop
Index: world.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/world.cpp,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -d -r1.29 -r1.30
*** world.cpp 26 Aug 2003 15:36:44 -0000 1.29
--- world.cpp 27 Aug 2003 15:29:18 -0000 1.30
***************
*** 65,69 ****
// UNCOMMENT THIS IF YOU WANT TO USE A HASHMAP
! //#define WP_USE_HASH_MAP
// Important compile switch
--- 65,69 ----
// UNCOMMENT THIS IF YOU WANT TO USE A HASHMAP
! #define WP_USE_HASH_MAP
// Important compile switch
***************
*** 467,470 ****
--- 467,472 ----
p->purgePendingObjects();
+ persistentBroker->executeQuery( "BEGIN;" );
+
try
{
***************
*** 479,482 ****
--- 481,486 ----
catch( QString &e )
{
+ persistentBroker->executeQuery( "ROLLBACK;" );
+
clConsole.ChangeColor( WPC_RED );
clConsole.send( " Failed" );
***************
*** 486,489 ****
--- 490,495 ----
return;
}
+
+ persistentBroker->executeQuery( "COMMIT;" );
ISerialization *archive = cPluginFactory::serializationArchiver( "xml" );
|
|
From: <dar...@us...> - 2003-08-27 13:33:23
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv9890/src
Modified Files:
customtags.cpp customtags.h items.h wolfpack.cpp
Log Message:
Reduced the CodeSize of both, cItem and cUObject
Index: customtags.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** customtags.cpp 26 Aug 2003 15:36:44 -0000 1.24
--- customtags.cpp 27 Aug 2003 13:33:17 -0000 1.25
***************
*** 657,661 ****
cCustomTags::cCustomTags( const cCustomTags& d )
{
! tags_ = d.tags_;
changed = true;
}
--- 657,665 ----
cCustomTags::cCustomTags( const cCustomTags& d )
{
! if( d.tags_ )
! tags_ = d.tags_;
! else
! tags_ = new QMap< QString, cVariant >( *d.tags_ );
!
changed = true;
}
***************
*** 664,668 ****
{
changed = true;
! tags_ = tags.tags_;
return *this;
}
--- 668,676 ----
{
changed = true;
! if( tags.tags_ )
! tags_ = new QMap< QString, cVariant >( *tags.tags_ );
! else
! tags_ = 0;
!
return *this;
}
***************
*** 680,687 ****
persistentBroker->executeQuery( QString( "DELETE FROM tags WHERE serial = '%1'" ).arg( key ) );
! QMap< QString, cVariant >::const_iterator it( tags_.begin() );
! if ( tags_.count() > 6 )
! persistentBroker->lockTable("tags");
! for( ; it != tags_.end(); ++it )
{
// Erase invalid tags.
--- 688,700 ----
persistentBroker->executeQuery( QString( "DELETE FROM tags WHERE serial = '%1'" ).arg( key ) );
! if( !tags_ )
! {
! changed = false;
! return;
! }
!
! QMap< QString, cVariant >::const_iterator it( tags_->begin() );
!
! for( ; it != tags_->end(); ++it )
{
// Erase invalid tags.
***************
*** 698,703 ****
persistentBroker->executeQuery( QString( "INSERT INTO tags SET serial = '%1', type = '%2', value = '%3', name = '%4'" ).arg( key ).arg( type ).arg( persistentBroker->quoteString( value ) ).arg( persistentBroker->quoteString( name ) ) );
}
- if ( tags_.count() > 6 )
- persistentBroker->unlockTable("tags");
changed = false;
--- 711,714 ----
***************
*** 706,710 ****
void cCustomTags::load( SERIAL key )
{
! tags_.clear();
cDBResult result = persistentBroker->query( QString( "SELECT serial,name,type,value FROM tags WHERE serial = '%1'" ).arg( key ) );
--- 717,722 ----
void cCustomTags::load( SERIAL key )
{
! if( tags_ )
! tags_->clear();
cDBResult result = persistentBroker->query( QString( "SELECT serial,name,type,value FROM tags WHERE serial = '%1'" ).arg( key ) );
***************
*** 716,725 ****
QString value = result.getString( 3 );
if( type == "String" )
! tags_.insert( name, cVariant( value ) );
else if( type == "Int" )
! tags_.insert( name, cVariant( value.toInt() ) );
else if( type == "Double" )
! tags_.insert( name, cVariant( value.toDouble() ) );
}
--- 728,740 ----
QString value = result.getString( 3 );
+ if( !tags_ )
+ tags_ = new QMap< QString, cVariant >;
+
if( type == "String" )
! tags_->insert( name, cVariant( value ) );
else if( type == "Int" )
! tags_->insert( name, cVariant( value.toInt() ) );
else if( type == "Double" )
! tags_->insert( name, cVariant( value.toDouble() ) );
}
***************
*** 730,750 ****
cVariant cCustomTags::get( const QString& key )
! {
! QMap< QString, cVariant >::iterator it = tags_.find( key );
! if( it != tags_.end() )
! return it.data();
! else
! return cVariant();
}
void cCustomTags::set( const QString& key, const cVariant& value )
{
! QMap< QString, cVariant >::iterator iter = tags_.find( key );
! if( iter != tags_.end() )
{
if( !value.isValid() )
{
! tags_.erase( iter );
changed = true;
}
--- 745,771 ----
cVariant cCustomTags::get( const QString& key )
! {
! if( tags_ )
! {
! QMap< QString, cVariant >::iterator it = tags_->find( key );
! if( it != tags_->end() )
! return it.data();
! }
!
! return cVariant();
}
void cCustomTags::set( const QString& key, const cVariant& value )
{
! if( !tags_ )
! tags_ = new QMap< QString, cVariant >;
!
! QMap< QString, cVariant >::iterator iter = tags_->find( key );
! if( iter != tags_->end() )
{
if( !value.isValid() )
{
! tags_->erase( iter );
changed = true;
}
***************
*** 757,761 ****
else
{
! tags_.insert( key, value );
changed = true;
}
--- 778,782 ----
else
{
! tags_->insert( key, value );
changed = true;
}
***************
*** 764,773 ****
void cCustomTags::remove( const QString& key )
{
! QMap< QString, cVariant >::iterator iter( tags_.find( key ) );
!
! if( iter != tags_.end() )
{
! tags_.erase( iter );
! changed = true;
}
}
--- 785,800 ----
void cCustomTags::remove( const QString& key )
{
! if( tags_ )
{
! QMap< QString, cVariant >::iterator iter( tags_->find( key ) );
!
! if( iter != tags_->end() )
! {
! tags_->erase( iter );
! changed = true;
! }
!
! if( tags_->count() == 0 )
! delete tags_;
}
}
***************
*** 775,784 ****
QStringList cCustomTags::getKeys( void )
{
! return tags_.keys();
}
QValueList< cVariant > cCustomTags::getValues( void )
{
! return tags_.values();
}
--- 802,826 ----
QStringList cCustomTags::getKeys( void )
{
! if( tags_ )
! {
! return tags_->keys();
! }
!
! return QStringList();
}
QValueList< cVariant > cCustomTags::getValues( void )
{
! if( tags_ )
! {
! return tags_->values();
! }
!
! return QValueList< cVariant >();
}
+ cCustomTags::~cCustomTags()
+ {
+ if( tags_ )
+ delete tags_;
+ }
Index: customtags.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** customtags.h 27 Aug 2003 01:39:58 -0000 1.18
--- customtags.h 27 Aug 2003 13:33:17 -0000 1.19
***************
*** 144,149 ****
{
public:
! cCustomTags(): changed( false ) {}
cCustomTags( const cCustomTags& );
void del( SERIAL key );
--- 144,150 ----
{
public:
! cCustomTags(): changed( false ), tags_( 0 ) {}
cCustomTags( const cCustomTags& );
+ virtual ~cCustomTags();
void del( SERIAL key );
***************
*** 155,159 ****
void remove( const QString& key );
! UI32 size( void ) { return this->tags_.size(); }
QStringList getKeys( void );
--- 156,160 ----
void remove( const QString& key );
! UI32 size( void ) { return tags_ ? this->tags_->size() : 0; }
QStringList getKeys( void );
***************
*** 175,179 ****
private:
! QMap< QString, cVariant > tags_;
bool changed;
};
--- 176,180 ----
private:
! QMap< QString, cVariant > *tags_;
bool changed;
};
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.171
retrieving revision 1.172
diff -C2 -d -r1.171 -r1.172
*** items.h 27 Aug 2003 01:39:59 -0000 1.171
--- items.h 27 Aug 2003 13:33:17 -0000 1.172
***************
*** 174,186 ****
//----------------------[ ADVANCED PROPERTIES GETTERS ]------------------
- short regen( ushort id ) const { return regen_[ id ]; } // Regeneration value
- short bonus( ushort id ) const { return statsbonus_[ id ]; } // Stats bonuses
- short damage( ushort id ) const { return damage_[ id ]; } // Damage modifiers %
- short enh( ushort id ) const { return enhancement_[ id ]; } // Misc enhancements %
- short hit( ushort id ) const { return hit_[ id ]; } // Attack and defence modifiers %
- short req( ushort id ) const { return requirements_[ id ]; } // Reagent, Mana and other requirements %
- short resist( ushort id ) const { return resist_[ id ]; } // Resisting damage %
- short reflect( ushort id ) const { return reflect_[ id ]; } // Reflecting damage %
-
short charge_count() const { return charge_count_; }
short charge_spell() const { return charge_spell_; }
--- 174,177 ----
***************
*** 267,280 ****
//----------------------[ ADVANCED PROPERTIES SETTERS ]------------------
-
- void setRegen( ushort id, short data ){ regen_.replace( id, data ); } // Regeneration value
- void setBonus( ushort id, short data ){ statsbonus_.replace( id, data ); } // Stats bonuses
- void setDamage( ushort id, short data ){ damage_.replace( id, data ); } // Damage modifiers %
- void setEnh( ushort id, short data ){ enhancement_.replace( id, data ); } // Misc enhancements %
- void setHit( ushort id, short data ){ hit_.replace( id, data ); } // Attack and defence modifiers %
- void setReq( ushort id, short data ){ requirements_.replace( id, data ); } // Reagent, Mana and other requirements %
- void setResist( ushort id, short data ){ resist_.replace( id, data ); } // Resisting damage %
- void setReflect( ushort id, short data ){ reflect_.replace( id, data ); } // Reflecting damage %
-
void setChargeCount( short data ) { charge_count_ = data; }
void setChargeSpell( short data ) { charge_spell_ = data; }
--- 258,261 ----
***************
*** 450,491 ****
ushort uses_base_; //Uses base
ushort uses_current_; //Uses current
-
- // Regenerations
- // Mana, Stamina, Hit points
- QMap< ushort, short > regen_;
-
- // Stats bonuses
- // Dexterity, Intelligence, Strength, Hit points, Mana, Stamina
- QMap< ushort, short > statsbonus_;
-
- // Damage increase %
- // Increase, Physical, Cold, Fire, Poison, Energy, Spell
- QMap< ushort, short > damage_;
-
- // Enhancements %
- // Defence chance, Gold increase, Swing speed increase
- // Enhance potions, Self repair, Faster casting, Faster cast recovery
- QMap< ushort, short > enhancement_;
-
- // Hit modifiers %
- // Chance increase, Cold, Dispel, Energy,
- // Fire, Fireball, Harm, Life leech,
- // Lighting, Lower attack, Lower defence, Magic arrow,
- // Mana leech, Physical area, Poison area, Stamina leech
- QMap< ushort, short > hit_;
-
- // Lower requirements for resources and stats consumption %
- // Low mana cost, Low reagent cost, Low requirements (global)
- QMap< ushort, short > requirements_;
-
- // Resisting %
- // Cold resist, Energy resist, Fire resist
- // Physical resist, Poison resist
- QMap< ushort, short > resist_;
-
- // Reflect %
- // Reflect physical
- QMap< ushort, short > reflect_;
-
};
--- 431,434 ----
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.440
retrieving revision 1.441
diff -C2 -d -r1.440 -r1.441
*** wolfpack.cpp 27 Aug 2003 01:39:59 -0000 1.440
--- wolfpack.cpp 27 Aug 2003 13:33:17 -0000 1.441
***************
*** 559,562 ****
--- 559,573 ----
#endif
*/
+ clConsole.send( "PAUSE" );
+ Sleep( 10000 );
+
+ for( unsigned int x = 0; x < 100000; ++x )
+ {
+ cItem *pItem = new cItem;
+ }
+
+ clConsole.send( "PAUSE" );
+ Sleep( 10000 );
+
QApplication app( argc, argv, false ); // we need one instance
QTranslator translator( 0 ); // must be valid thru app life.
|
|
From: <dar...@us...> - 2003-08-27 13:33:23
|
Update of /cvsroot/wpdev/wolfpack/python
In directory sc8-pr-cvs1:/tmp/cvs-serv9890/src/python
Modified Files:
item.cpp
Log Message:
Reduced the CodeSize of both, cItem and cUObject
Index: item.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/python/item.cpp,v
retrieving revision 1.71
retrieving revision 1.72
diff -C2 -d -r1.71 -r1.72
*** item.cpp 23 Aug 2003 15:20:29 -0000 1.71
--- item.cpp 27 Aug 2003 13:33:18 -0000 1.72
***************
*** 620,705 ****
}
- static PyObject* wpItem_getadv( wpItem* self, PyObject* args )
- {
- if( !self->pItem || self->pItem->free )
- return PyFalse;
-
- if( !checkArgInt( 0 ) || !checkArgInt( 1 ))
- {
- PyErr_BadArgument();
- return 0;
- }
- ushort list = getArgInt( 0 ); //Which list ?
- //REGEN | BONUS | DAMAGE | ENH | HIT | REQ | RESIST | REFLECT
-
- ushort id = getArgInt( 1 ); //Which property ?
-
- //...
- switch( list )
- {
- case REGEN:
- return PyInt_FromLong( self->pItem->regen( id ) ); break;
- case BONUS:
- return PyInt_FromLong( self->pItem->bonus( id ) ); break;
- case DAMAGE:
- return PyInt_FromLong( self->pItem->damage( id ) ); break;
- case ENH:
- return PyInt_FromLong( self->pItem->enh( id ) ); break;
- case HIT:
- return PyInt_FromLong( self->pItem->hit( id ) ); break;
- case REQ:
- return PyInt_FromLong( self->pItem->req( id ) ); break;
- case RESIST:
- return PyInt_FromLong( self->pItem->resist( id ) ); break;
- case REFLECT:
- return PyInt_FromLong( self->pItem->reflect( id ) ); break;
- default:
- return PyFalse;
- }
- }
-
- static PyObject* wpItem_setadv( wpItem* self, PyObject* args )
- {
- if( !self->pItem || self->pItem->free )
- return PyFalse;
-
- if( !checkArgInt( 0 ) || !checkArgInt( 1 ) || !checkArgInt( 2 ))
- {
- PyErr_BadArgument();
- return 0;
- }
- ushort list = getArgInt( 0 ); //Which list ?
- //REGEN | BONUS | DAMAGE | ENH | HIT | REQ | RESIST | REFLECT
-
- ushort id = getArgInt( 1 ); //Which property ?
- //...
-
- ushort data = getArgInt( 2 ); //Value to write
-
- switch( list )
- {
- case REGEN:
- self->pItem->setRegen( id, data ); break;
- case BONUS:
- self->pItem->setBonus( id, data ); break;
- case DAMAGE:
- self->pItem->setDamage( id, data ); break;
- case ENH:
- self->pItem->setEnh( id, data ); break;
- case HIT:
- self->pItem->setHit( id, data ); break;
- case REQ:
- self->pItem->setReq( id, data ); break;
- case RESIST:
- self->pItem->setResist( id, data ); break;
- case REFLECT:
- self->pItem->setReflect( id, data ); break;
- default:
- return PyFalse;
- }
-
- return PyTrue;
- }
-
// If we are in a multi, return the multi object for it
// otherwise pynone
--- 620,623 ----
***************
*** 731,736 ****
{ "getoutmostitem", (getattrofunc)wpItem_getoutmostitem, METH_VARARGS, "Get the outmost item." },
{ "getname", (getattrofunc)wpItem_getname, METH_VARARGS, "Get item name." },
- { "getadv", (getattrofunc)wpItem_getadv, METH_VARARGS,"Get advanced modifiers." },
- { "setadv", (getattrofunc)wpItem_setadv, METH_VARARGS,"Set advanced modifiers." },
{ "multi", (getattrofunc)wpItem_multi, METH_VARARGS, NULL },
--- 649,652 ----
|
|
From: <dar...@us...> - 2003-08-27 01:40:06
|
Update of /cvsroot/wpdev/wolfpack
In directory sc8-pr-cvs1:/tmp/cvs-serv13784/src
Modified Files:
basechar.cpp basechar.h customtags.h dbdriver.h items.cpp
items.h player.cpp player.h pythonscript.cpp pythonscript.h
scriptmanager.h speech.cpp uobject.cpp uobject.h wolfpack.cpp
Log Message:
Restructured cUObject quite a bit.
Reduced the size a lot.
Index: basechar.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -d -r1.35 -r1.36
*** basechar.cpp 26 Aug 2003 15:01:05 -0000 1.35
--- basechar.cpp 27 Aug 2003 01:39:58 -0000 1.36
***************
*** 1032,1038 ****
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onSingleClick( (P_PLAYER)this, (P_CHAR)Viewer ) )
! return true;
// Try to process the hooks then
--- 1032,1046 ----
{
// If we got ANY events process them in order
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onSingleClick( (P_PLAYER)this, (P_CHAR)Viewer ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1052,1058 ****
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onWalk( (P_CHAR)this, Direction, Sequence ) )
! return true;
return false;
--- 1060,1073 ----
{
// If we got ANY events process them in order
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onWalk( (P_CHAR)this, Direction, Sequence ) )
! return true;
! ++i;
! }
! }
return false;
***************
*** 1062,1068 ****
bool cBaseChar::onTalk( char speechType, UI16 speechColor, UI16 speechFont, const QString &Text, const QString &Lang )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onTalk( (P_CHAR)this, speechType, speechColor, speechFont, Text, Lang ) )
! return true;
return false;
--- 1077,1090 ----
bool cBaseChar::onTalk( char speechType, UI16 speechColor, UI16 speechFont, const QString &Text, const QString &Lang )
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onTalk( (P_CHAR)this, speechType, speechColor, speechFont, Text, Lang ) )
! return true;
! ++i;
! }
! }
return false;
***************
*** 1073,1079 ****
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onWarModeToggle( this, War ) )
! return true;
return false;
--- 1095,1109 ----
{
// If we got ANY events process them in order
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onWarModeToggle( this, War ) )
! return true;
!
! ++i;
! }
! }
return false;
***************
*** 1083,1090 ****
bool cBaseChar::onShowPaperdoll( P_CHAR pOrigin )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
{
! if( scriptChain[ i ]->onShowPaperdoll( this, pOrigin ) )
! return true;
}
--- 1113,1126 ----
bool cBaseChar::onShowPaperdoll( P_CHAR pOrigin )
{
! if( scriptChain )
{
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onShowPaperdoll( this, pOrigin ) )
! return true;
!
! ++i;
! }
}
***************
*** 1094,1100 ****
bool cBaseChar::onShowSkillGump()
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onShowSkillGump( this ) )
! return true;
// Try to process the hooks then
--- 1130,1144 ----
bool cBaseChar::onShowSkillGump()
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onShowSkillGump( this ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1114,1120 ****
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onSkillUse( this, Skill ) )
! return true;
// Try to process the hooks then
--- 1158,1172 ----
{
// If we got ANY events process them in order
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onSkillUse( this, Skill ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1130,1149 ****
}
- bool cBaseChar::onCollideChar( P_CHAR Obstacle )
- {
- // If we got ANY events process them in order
- for( UI08 i = 0; i < scriptChain.size(); i++ )
- if( scriptChain[ i ]->onCollideChar( this, Obstacle ) )
- return true;
-
- return false;
- }
-
bool cBaseChar::onDropOnChar( P_ITEM pItem )
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onDropOnChar( this, pItem ) )
! return true;
return false;
--- 1182,1199 ----
}
bool cBaseChar::onDropOnChar( P_ITEM pItem )
{
// If we got ANY events process them in order
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onDropOnChar( this, pItem ) )
! return true;
!
! ++i;
! }
! }
return false;
***************
*** 1152,1160 ****
QString cBaseChar::onShowPaperdollName( P_CHAR pOrigin )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
{
! QString result = scriptChain[ i ]->onShowPaperdollName( this, pOrigin );
! if( !result.isNull() )
! return result;
}
--- 1202,1217 ----
QString cBaseChar::onShowPaperdollName( P_CHAR pOrigin )
{
! if( scriptChain )
{
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! QString result = scriptChain[ i ]->onShowPaperdollName( this, pOrigin );
!
! if( !result.isNull() )
! return result;
!
! ++i;
! }
}
***************
*** 1165,1171 ****
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onDeath( this ) )
! return true;
return false;
--- 1222,1236 ----
{
// If we got ANY events process them in order
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onDeath( this ) )
! return true;
!
! ++i;
! }
! }
return false;
***************
*** 1174,1180 ****
bool cBaseChar::onShowTooltip( P_PLAYER sender, cUOTxTooltipList* tooltip )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onShowToolTip( sender, this, tooltip ) )
! return true;
// Try to process the hooks then
--- 1239,1253 ----
bool cBaseChar::onShowTooltip( P_PLAYER sender, cUOTxTooltipList* tooltip )
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onShowToolTip( sender, this, tooltip ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1804,1810 ****
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onSkillGain( this, Skill, min, max, success ) )
! return true;
// Try to process the hooks then
--- 1877,1891 ----
{
// If we got ANY events process them in order
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onSkillGain( this, Skill, min, max, success ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1823,1829 ****
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onStatGain( this, stat, amount ) )
! return true;
// Try to process the hooks then
--- 1904,1918 ----
{
// If we got ANY events process them in order
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onStatGain( this, stat, amount ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1846,1851 ****
//
! for( UINT8 i = 0; i < scriptChain.size(); ++i )
! amount = scriptChain[ i ]->onDamage( this, type, amount, source );
QValueVector< cPythonScript* > hooks;
--- 1935,1947 ----
//
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! amount = scriptChain[ i ]->onDamage( this, type, amount, source );
! ++i;
! }
! }
QValueVector< cPythonScript* > hooks;
Index: basechar.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/basechar.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -d -r1.24 -r1.25
*** basechar.h 26 Aug 2003 15:01:05 -0000 1.24
--- basechar.h 27 Aug 2003 01:39:58 -0000 1.25
***************
*** 153,157 ****
virtual bool onShowSkillGump(); //Show Skillgump
virtual bool onSkillUse( UI08 Skill ); // The character uses %Skill
- virtual bool onCollideChar( P_CHAR Obstacle ); // This is called for the walking character first, then for the character walked on
bool onDeath();
bool onDropOnChar( P_ITEM pItem );
--- 153,156 ----
Index: customtags.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/customtags.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** customtags.h 20 Jul 2003 00:04:51 -0000 1.17
--- customtags.h 27 Aug 2003 01:39:58 -0000 1.18
***************
*** 141,145 ****
}
! class cCustomTags : public PersistentObject
{
public:
--- 141,145 ----
}
! class cCustomTags
{
public:
Index: dbdriver.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/dbdriver.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** dbdriver.h 26 Aug 2003 15:01:05 -0000 1.10
--- dbdriver.h 27 Aug 2003 01:39:58 -0000 1.11
***************
*** 61,64 ****
--- 61,66 ----
virtual ~cDBDriver();
+ virtual const char *name() const { return "mysql"; }
+
virtual bool open( int id = CONN_MAIN );
virtual void close();
***************
*** 84,87 ****
--- 86,91 ----
{
public:
+ const char *name() const { return "sqlite"; }
+
cSQLiteDriver() {}
virtual ~cSQLiteDriver() {}
Index: items.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.cpp,v
retrieving revision 1.335
retrieving revision 1.336
diff -C2 -d -r1.335 -r1.336
*** items.cpp 26 Aug 2003 15:01:05 -0000 1.335
--- items.cpp 27 Aug 2003 01:39:58 -0000 1.336
***************
*** 981,987 ****
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onSingleClick( this, Viewer ) )
! return true;
return false;
--- 981,995 ----
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onSingleClick( this, Viewer ) )
! return true;
!
! ++i;
! }
! }
return false;
***************
*** 990,1005 ****
bool cItem::onDropOnItem( P_ITEM pItem )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
{
! // we are the item being dragged
! if( layer_ == 0x1E )
{
! if( scriptChain[ i ]->onDropOnItem( pItem, this ) )
return true;
}
! else
{
! if( scriptChain[ i ]->onDropOnItem( this, pItem ) )
return true;
}
}
--- 998,1053 ----
bool cItem::onDropOnItem( P_ITEM pItem )
{
! if( scriptChain )
{
! unsigned int i = 0;
! while( scriptChain[i] )
{
! // we are the item being dragged
! if( layer_ == 0x1E )
! {
! if( scriptChain[ i ]->onDropOnItem( pItem, this ) )
! return true;
! }
! else
! {
! if( scriptChain[ i ]->onDropOnItem( this, pItem ) )
! return true;
! }
!
! ++i;
! }
! }
!
! return false;
! }
!
! bool cItem::onDropOnGround( const Coord_cl &pos )
! {
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onDropOnGround( this, pos ) )
return true;
+
+ ++i;
}
! }
!
! return false;
! }
!
! bool cItem::onPickup( P_CHAR pChar )
! {
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
{
! if( scriptChain[ i ]->onPickup( pChar, this ) )
return true;
+
+ ++i;
}
}
***************
*** 1008,1026 ****
}
! bool cItem::onDropOnGround( const Coord_cl &pos )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onDropOnGround( this, pos ) )
! return true;
return false;
}
! bool cItem::onPickup( P_CHAR pChar )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onPickup( pChar, this ) )
! return true;
return false;
--- 1056,1090 ----
}
! bool cItem::onUse( P_CHAR pChar )
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onUse( pChar, this ) )
! return true;
!
! ++i;
! }
! }
return false;
}
!
! bool cItem::onCollide( P_CHAR pChar )
{
+ if( scriptChain )
+ {
+ unsigned int i = 0;
+ while( scriptChain[i] )
+ {
+ if( scriptChain[ i ]->onCollide( pChar, this ) )
+ return true;
! ++i;
! }
! }
return false;
***************
*** 1030,1036 ****
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onDropOnChar( pChar, this ) )
! return true;
return false;
--- 1094,1108 ----
{
// If we got ANY events process them in order
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onDropOnChar( pChar, this ) )
! return true;
!
! ++i;
! }
! }
return false;
***************
*** 1040,1046 ****
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onShowToolTip( sender, this, tooltip ) )
! return true;
// Try to process the hooks then
--- 1112,1126 ----
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onShowToolTip( sender, this, tooltip ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
Index: items.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/items.h,v
retrieving revision 1.170
retrieving revision 1.171
diff -C2 -d -r1.170 -r1.171
*** items.h 26 Aug 2003 15:01:05 -0000 1.170
--- items.h 27 Aug 2003 01:39:59 -0000 1.171
***************
*** 337,340 ****
--- 337,342 ----
// Public event wrappers added by darkstorm
virtual bool onSingleClick( P_PLAYER Viewer );
+ bool onUse( P_CHAR pChar );
+ bool onCollide( P_CHAR pChar );
bool onDropOnChar( P_CHAR pChar );
bool onDropOnItem( P_ITEM pItem );
Index: player.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.cpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** player.cpp 26 Aug 2003 15:01:05 -0000 1.25
--- player.cpp 27 Aug 2003 01:39:59 -0000 1.26
***************
*** 1312,1318 ****
bool cPlayer::onPickup( P_ITEM pItem )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onPickup( this, pItem ) )
! return true;
// Try to process the hooks then
--- 1312,1326 ----
bool cPlayer::onPickup( P_ITEM pItem )
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onPickup( this, pItem ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1330,1336 ****
bool cPlayer::onLogin( void )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onLogin( this ) )
! return true;
// Try to process the hooks then
--- 1338,1352 ----
bool cPlayer::onLogin( void )
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onLogin( this ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1347,1353 ****
bool cPlayer::onCastSpell( unsigned int spell )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onCastSpell( this, spell ) )
! return true;
// Try to process the hooks then
--- 1363,1377 ----
bool cPlayer::onCastSpell( unsigned int spell )
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onCastSpell( this, spell ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1364,1370 ****
bool cPlayer::onLogout( void )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onLogout( this ) )
! return true;
// Try to process the hooks then
--- 1388,1402 ----
bool cPlayer::onLogout( void )
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onLogout( this ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1383,1389 ****
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onHelp( this ) )
! return true;
// Try to process the hooks then
--- 1415,1429 ----
{
// If we got ANY events process them in order
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onHelp( this ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1403,1409 ****
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onChat( this ) )
! return true;
// Try to process the hooks then
--- 1443,1457 ----
{
// If we got ANY events process them in order
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onChat( this ) )
! return true;
!
! ++i;
! }
! }
// Try to process the hooks then
***************
*** 1421,1427 ****
bool cPlayer::onShowContext( cUObject *object )
{
! for( UI08 i = 0; i < scriptChain.size(); i++ )
! if( scriptChain[ i ]->onShowContextMenu( this, object ) )
! return true;
return false;
--- 1469,1500 ----
bool cPlayer::onShowContext( cUObject *object )
{
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onShowContextMenu( this, object ) )
! return true;
!
! ++i;
! }
! }
!
! return false;
! }
!
! bool cPlayer::onUse( P_ITEM pItem )
! {
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! if( scriptChain[ i ]->onUse( this, pItem ) )
! return true;
!
! ++i;
! }
! }
return false;
Index: player.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/player.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** player.h 26 Aug 2003 15:01:05 -0000 1.17
--- player.h 27 Aug 2003 01:39:59 -0000 1.18
***************
*** 104,109 ****
virtual bool onShowContext( cUObject *object ); // Shows a context menu for a specific item
virtual bool onCastSpell( unsigned int spell );
bool onPickup( P_ITEM pItem );
-
// getters
--- 104,109 ----
virtual bool onShowContext( cUObject *object ); // Shows a context menu for a specific item
virtual bool onCastSpell( unsigned int spell );
+ bool onUse( P_ITEM pItem );
bool onPickup( P_ITEM pItem );
// getters
Index: pythonscript.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** pythonscript.cpp 26 Aug 2003 03:55:13 -0000 1.4
--- pythonscript.cpp 27 Aug 2003 01:39:59 -0000 1.5
***************
*** 228,234 ****
}
! bool cPythonScript::onCollideItem( P_CHAR Character, P_ITEM Obstacle )
{
! PyHasMethod( "onCollideItem" )
PyObject *tuple = PyTuple_New( 2 ); // Create our args for the python function
--- 228,234 ----
}
! bool cPythonScript::onCollide( P_CHAR Character, P_ITEM Obstacle )
{
! PyHasMethod( "onCollide" )
PyObject *tuple = PyTuple_New( 2 ); // Create our args for the python function
***************
*** 236,251 ****
PyTuple_SetItem( tuple, 1, PyGetItemObject( Obstacle ) );
! return PyEvalMethod( "onCollideItem", tuple );
! }
!
! bool cPythonScript::onCollideChar( P_CHAR Character, P_CHAR Obstacle )
! {
! PyHasMethod( "onCollideChar" )
!
! PyObject *tuple = PyTuple_New( 2 ); // Create our args for the python function
! PyTuple_SetItem( tuple, 0, PyGetCharObject( Character ) );
! PyTuple_SetItem( tuple, 1, PyGetCharObject( Obstacle ) );
!
! return PyEvalMethod( "onCollideChar", tuple );
}
--- 236,240 ----
PyTuple_SetItem( tuple, 1, PyGetItemObject( Obstacle ) );
! return PyEvalMethod( "onCollide", tuple );
}
***************
*** 582,585 ****
--- 571,596 ----
return PyEvalMethod( "onShowSkillGump", tuple );
+ }
+
+ bool cPythonScript::onWorldSave( cDBDriver *connection )
+ {
+ PyHasMethod( "onWorldSave" )
+
+ // Create our args for the python function
+ PyObject *tuple = PyTuple_New( 1 );
+ //PyTuple_SetItem( tuple, 0, PyGetCharObject( pChar ) );
+
+ return PyEvalMethod( "onWorldSave", tuple );
+ }
+
+ bool cPythonScript::onWorldLoad( cDBDriver *connection )
+ {
+ PyHasMethod( "onWorldLoad" )
+
+ // Create our args for the python function
+ PyObject *tuple = PyTuple_New( 1 );
+ //PyTuple_SetItem( tuple, 0, PyGetCharObject( pChar ) );
+
+ return PyEvalMethod( "onWorldSave", tuple );
}
Index: pythonscript.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/pythonscript.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** pythonscript.h 26 Aug 2003 03:55:13 -0000 1.4
--- pythonscript.h 27 Aug 2003 01:39:59 -0000 1.5
***************
*** 87,92 ****
bool onSingleClick( P_CHAR Character, P_CHAR Viewer );
! bool onCollideItem( P_CHAR Character, P_ITEM Obstacle );
! bool onCollideChar( P_CHAR Character, P_CHAR Obstacle );
bool onWalk( P_CHAR Character, UINT8 Direction, UINT8 Sequence );
bool onCreate( cUObject *object, const QString &definition );
--- 87,91 ----
bool onSingleClick( P_CHAR Character, P_CHAR Viewer );
! bool onCollide( P_CHAR Character, P_ITEM Obstacle );
bool onWalk( P_CHAR Character, UINT8 Direction, UINT8 Sequence );
bool onCreate( cUObject *object, const QString &definition );
***************
*** 124,127 ****
--- 123,131 ----
unsigned int onDamage( P_CHAR pChar, unsigned char type, unsigned int amount, cUObject *source );
+
+ // WorldSave
+ class cDBDriver;
+ bool onWorldSave( cDBDriver* );
+ bool onWorldLoad( cDBDriver* );
// Magic System (This should be reduced eventually. It's a bit much)
Index: scriptmanager.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/scriptmanager.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** scriptmanager.h 20 Jul 2003 00:04:51 -0000 1.2
--- scriptmanager.h 27 Aug 2003 01:39:59 -0000 1.3
***************
*** 45,80 ****
#define OBJECT_CHAR 3
! #define EVENT_USE 0x00000001
! #define EVENT_SINGLECLICK 0x00000002
! #define EVENT_COLLIDE 0x00000004
! #define EVENT_UNUSED1 0x00000004
! #define EVENT_WALK 0x00000010
! #define EVENT_CREATE 0x00000020
! #define EVENT_LOGIN 0x00000040
! #define EVENT_LOGOUT 0x00000080
! #define EVENT_TALK 0x00000100
! #define EVENT_WARMODETOGGLE 0x00000200
! #define EVENT_HELP 0x00000400
! #define EVENT_CHAT 0x00000800
! #define EVENT_SKILLUSE 0x00001000
! #define EVENT_SELECTCONTEXTMENU 0x00002000
! #define EVENT_REQUESTCONTEXTMENU 0x00004000
! #define EVENT_DROPONCHAR 0x00008000
! #define EVENT_DROPONITEM 0x00010000
! #define EVENT_DROPONGROUND 0x00020000
! #define EVENT_PICKUP 0x00040000
! #define EVENT_SPEECH 0x00080000
! #define EVENT_BEGINCAST 0x00100000
! #define EVENT_ENDCAST 0x00200000
! #define EVENT_SPELLCHECKTARGET 0x00400000
! #define EVENT_SPELLSUCCESS 0x00800000
! #define EVENT_SPELLFAILURE 0x01000000
! #define EVENT_SHOWTOOLTIP 0x02000000
! #define EVENT_SKILLGAIN 0x04000000
! #define EVENT_DAMAGE 0x08000000
! #define EVENT_SHOWPAPERDOLL 0x10000000
! #define EVENT_SHOWSKILLGUMP 0x20000000
! #define EVENT_STATGAIN 0x40000000
! #define EVENT_CASTSPELL 0x80000000
class cScriptManager
--- 45,81 ----
#define OBJECT_CHAR 3
! #define EVENT_USE 1
! #define EVENT_SINGLECLICK 2
! #define EVENT_COLLIDE 3
! #define EVENT_WORLDSAVE 4
! #define EVENT_WORLDLOAD 5
! #define EVENT_WALK 6
! #define EVENT_CREATE 7
! #define EVENT_LOGIN 8
! #define EVENT_LOGOUT 9
! #define EVENT_TALK 10
! #define EVENT_WARMODETOGGLE 11
! #define EVENT_HELP 12
! #define EVENT_CHAT 13
! #define EVENT_SKILLUSE 14
! #define EVENT_SELECTCONTEXTMENU 15
! #define EVENT_REQUESTCONTEXTMENU 16
! #define EVENT_DROPONCHAR 17
! #define EVENT_DROPONITEM 18
! #define EVENT_DROPONGROUND 19
! #define EVENT_PICKUP 20
! #define EVENT_SPEECH 21
! #define EVENT_BEGINCAST 22
! #define EVENT_ENDCAST 23
! #define EVENT_SPELLCHECKTARGET 24
! #define EVENT_SPELLSUCCESS 25
! #define EVENT_SPELLFAILURE 26
! #define EVENT_SHOWTOOLTIP 27
! #define EVENT_SKILLGAIN 28
! #define EVENT_DAMAGE 29
! #define EVENT_SHOWPAPERDOLL 30
! #define EVENT_SHOWSKILLGUMP 31
! #define EVENT_STATGAIN 32
! #define EVENT_CASTSPELL 33
class cScriptManager
Index: speech.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/speech.cpp,v
retrieving revision 1.153
retrieving revision 1.154
diff -C2 -d -r1.153 -r1.154
*** speech.cpp 23 Aug 2003 01:03:31 -0000 1.153
--- speech.cpp 27 Aug 2003 01:39:59 -0000 1.154
***************
*** 662,675 ****
// speech events and then check if it can handle everything
// or just certain things
! std::vector< cPythonScript* > events = pNpc->getEvents();
! for( std::vector< cPythonScript* >::const_iterator iter = events.begin(); iter != events.end(); ++iter )
{
! cPythonScript *script = *iter;
! if( !script->handleSpeech() )
! continue;
! if( script->catchAllSpeech() || script->canHandleSpeech( comm, keywords ) )
! if( script->onSpeech( pNpc, pPlayer, comm, keywords ) )
! return true;
}
--- 662,682 ----
// speech events and then check if it can handle everything
// or just certain things
! cPythonScript **events = pNpc->getEvents();
!
! if( events )
{
! unsigned int i = 0;
! while( events[i] )
! {
! if( events[i]->handleSpeech() )
! {
! if( events[i]->catchAllSpeech() || events[i]->canHandleSpeech( comm, keywords ) )
! if( events[i]->onSpeech( pNpc, pPlayer, comm, keywords ) )
! return true;
! }
!
! ++i;
! }
}
Index: uobject.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.cpp,v
retrieving revision 1.108
retrieving revision 1.109
diff -C2 -d -r1.108 -r1.109
*** uobject.cpp 23 Aug 2003 01:03:31 -0000 1.108
--- uobject.cpp 27 Aug 2003 01:39:59 -0000 1.109
***************
*** 65,69 ****
changed_(true),
tooltip_( 0xFFFFFFFF ),
! eventList_( QString::null )
{
}
--- 65,71 ----
changed_(true),
tooltip_( 0xFFFFFFFF ),
! eventList_( QString::null ),
! name_( QString::null ),
! scriptChain( 0 )
{
}
***************
*** 220,264 ****
void cUObject::clearEvents()
{
! scriptChain.clear();
! eventList_ = QString::null;
! changed_ = true;
! }
!
! // Method for setting a list of cPythonScripts
! void cUObject::setEvents( std::vector< cPythonScript* > List )
! {
! scriptChain.clear();
! eventList_ = QString::null;
!
! // "Reset" the events
! if( List.size() == 0 )
! return;
!
! // Walk the List and add the events
! for( UI08 i = 0; i < List.size(); i++ )
! if( List[ i ] != NULL )
! {
! scriptChain.push_back( List[ i ] );
!
! if( eventList_ == QString::null )
! eventList_ = List[ i ]->name();
! else
! eventList_.append( "," + List[ i ]->name() );
! }
! changed_ = true;
! }
! // Gets a vector of all assigned events
! const std::vector< cPythonScript* > &cUObject::getEvents( void )
! {
! return scriptChain;
}
// Checks if the object has a specific event
! bool cUObject::hasEvent( const QString& Name ) const
{
! QStringList eventList = QStringList::split( ",", eventList_ );
! return eventList.find( Name ) != eventList.end();
}
--- 222,251 ----
void cUObject::clearEvents()
{
! if( scriptChain )
! {
! delete [] scriptChain;
! scriptChain = 0;
! eventList_ = QString::null;
! changed_ = true;
! }
}
// Checks if the object has a specific event
! bool cUObject::hasEvent( const QString& name ) const
{
! if( scriptChain )
! {
! unsigned int i = 0;
!
! while( scriptChain[i] )
! {
! if( scriptChain[i]->name() == name )
! return true;
! i++;
! }
! }
! return false;
}
***************
*** 268,272 ****
return;
! scriptChain.push_back( Event );
if( eventList_ == QString::null )
--- 255,282 ----
return;
! // Reallocate the ScriptChain
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! i++;
! }
!
! // i is the count of real elements in the old array
! cPythonScript **newScriptChain = new cPythonScript* [ i + 2 ];
! memcpy( newScriptChain, scriptChain, i * sizeof( cPythonScript* ) );
! newScriptChain[ i ] = Event;
! newScriptChain[ i + 1 ] = 0;
!
! delete [] scriptChain;
! scriptChain = newScriptChain;
! }
! else
! {
! scriptChain = new cPythonScript*[2];
! scriptChain[0] = Event;
! scriptChain[1] = 0;
! }
if( eventList_ == QString::null )
***************
*** 278,297 ****
}
! void cUObject::removeEvent( const QString& Name )
{
! std::vector< cPythonScript* >::iterator myIterator;
! for( myIterator = scriptChain.begin(); myIterator != scriptChain.end(); ++myIterator )
{
! if( (*myIterator)->name() == Name )
{
! scriptChain.erase( myIterator );
! break;
}
}
// I hope this works
QStringList eventList = QStringList::split( ",", eventList_ );
! eventList.remove( Name );
eventList_ = eventList.join( "," );
--- 288,326 ----
}
! void cUObject::removeEvent( const QString& name )
{
! if( !hasEvent( name ) )
! return;
! if( scriptChain )
{
! unsigned int i = 0;
! unsigned int pos;
!
! while( scriptChain[i] )
{
! // Found it
! if( scriptChain[i]->name() == name )
! pos = i;
!
! i++;
}
+
+ // i = Count of New Array
+ cPythonScript **newScriptChain = new cPythonScript*[ i ];
+
+ // Copy over the first part
+ memcpy( newScriptChain, scriptChain, pos * sizeof( cPythonScript* ) );
+
+ // Dont miss the final 0 for the last part
+ memcpy( newScriptChain + ( pos * sizeof( cPythonScript* ) ), scriptChain + ( ( pos + 1 ) * sizeof( cPythonScript* ) ), ( i - pos ) * sizeof( cPythonScript* ) );
+
+ delete [] scriptChain;
+ scriptChain = newScriptChain;
}
// I hope this works
QStringList eventList = QStringList::split( ",", eventList_ );
! eventList.remove( name );
eventList_ = eventList.join( "," );
***************
*** 307,372 ****
*
****************************/
-
- bool cUObject::onUse( cUObject *Target )
- {
- // If we got ANY events process them in order
- for( UI08 i = 0; i < scriptChain.size(); i++ )
- {
- // If we're the Character pass us as the second param
- // if not as the first
- bool Handeled = false;
-
- if( !this->isChar() )
- Handeled = scriptChain[ i ]->onUse( (P_PLAYER)Target, (P_ITEM)this );
- else
- Handeled = scriptChain[ i ]->onUse( (P_PLAYER)this, (P_ITEM)Target );
-
- if( Handeled )
- return true;
- }
-
- // Try to process the hooks then
- QValueVector< cPythonScript* > hooks;
- QValueVector< cPythonScript* >::const_iterator it;
-
- hooks = ScriptManager->getGlobalHooks( OBJECT_OBJECT, EVENT_USE );
- for( it = hooks.begin(); it != hooks.end(); ++it )
- {
- if( !this->isChar() )
- (*it)->onUse( (P_PLAYER)Target, (P_ITEM)this );
- else
- (*it)->onUse( (P_PLAYER)this, (P_ITEM)Target );
- }
-
- if( isChar() )
- {
- hooks = ScriptManager->getGlobalHooks( OBJECT_CHAR, EVENT_USE );
- for( it = hooks.begin(); it != hooks.end(); ++it )
- (*it)->onUse( (P_PLAYER)this, (P_ITEM)Target );
- }
-
- if( isItem() )
- {
- hooks = ScriptManager->getGlobalHooks( OBJECT_ITEM, EVENT_USE );
- for( it = hooks.begin(); it != hooks.end(); ++it )
- (*it)->onUse( (P_PLAYER)Target, (P_ITEM)this );
- }
-
- return false;
- }
-
bool cUObject::onCreate( const QString &definition )
{
// If we got ANY events process them in order
! for( UI08 i = 0; i < scriptChain.size(); i++ )
{
! // If we're the Character pass us as the second param
! // if not as the first
! bool Handeled = false;
!
! Handeled = scriptChain[ i ]->onCreate( this, definition );
!
! if( Handeled )
! return true;
}
--- 336,358 ----
*
****************************/
bool cUObject::onCreate( const QString &definition )
{
// If we got ANY events process them in order
! if( scriptChain )
{
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! // If we're the Character pass us as the second param
! // if not as the first
! bool Handeled = false;
!
! Handeled = scriptChain[ i ]->onCreate( this, definition );
!
! if( Handeled )
! return true;
!
! i++;
! }
}
***************
*** 396,472 ****
}
- bool cUObject::onCollide( cUObject* Obstacle )
- {
- // If we got ANY events process them in order
- for( UI08 i = 0; i < scriptChain.size(); i++ )
- {
- // Items cannot collide with items
- if( !isChar() ) // Item, so obstacle has to be character
- scriptChain[ i ]->onCollideItem( (P_CHAR)Obstacle, (P_ITEM)this );
- else
- if( Obstacle->isItem() )
- if( scriptChain[ i ]->onCollideItem( (P_CHAR)this, (P_ITEM)Obstacle ) )
- return true;
-
- else // Character, Character
- if( scriptChain[ i ]->onCollideChar( (P_CHAR)this, (P_CHAR)Obstacle ) )
- return true;
- }
-
- // Try to process the hooks then
- QValueVector< cPythonScript* > hooks;
- QValueVector< cPythonScript* >::const_iterator it;
-
- hooks = ScriptManager->getGlobalHooks( OBJECT_OBJECT, EVENT_COLLIDE );
- for( it = hooks.begin(); it != hooks.end(); ++it )
- {
- // Items cannot collide with items
- if( !isChar() ) // Item, so obstacle has to be character
- (*it)->onCollideItem( (P_CHAR)Obstacle, (P_ITEM)this );
- else
- {
- if( Obstacle->isItem() )
- (*it)->onCollideItem( (P_CHAR)this, (P_ITEM)Obstacle );
- else
- (*it)->onCollideChar( (P_CHAR)this, (P_CHAR)Obstacle );
- }
- }
-
- if( isChar() )
- {
- hooks = ScriptManager->getGlobalHooks( OBJECT_CHAR, EVENT_COLLIDE );
- for( it = hooks.begin(); it != hooks.end(); ++it )
- {
- if( Obstacle->isItem() )
- (*it)->onCollideItem( (P_CHAR)this, (P_ITEM)Obstacle );
- else
- (*it)->onCollideChar( (P_CHAR)this, (P_CHAR)Obstacle );
- }
- }
-
- if( isItem() )
- {
- hooks = ScriptManager->getGlobalHooks( OBJECT_ITEM, EVENT_COLLIDE );
- for( it = hooks.begin(); it != hooks.end(); ++it )
- (*it)->onCollideItem( (P_CHAR)Obstacle, (P_ITEM)this );
- }
-
- return false;
- }
-
-
- // Returns the list of events
- QString cUObject::eventList( void ) const
- {
- return eventList_;
- }
-
// If the scripts are reloaded call that for each and every existing object
! void cUObject::recreateEvents( void )
{
! scriptChain.clear();
!
if( eventList_ == QString::null )
return;
// Walk the eventList and recreate
--- 382,394 ----
}
// If the scripts are reloaded call that for each and every existing object
! void cUObject::recreateEvents()
{
! // clearEvents() would flag us as changed, but we didn't
if( eventList_ == QString::null )
return;
+
+ delete [] scriptChain;
+ scriptChain = 0;
// Walk the eventList and recreate
***************
*** 476,486 ****
for( myIter = eventList.begin(); myIter != eventList.end(); ++myIter )
{
! cPythonScript *myScript = ScriptManager->find( *myIter );
// Script not found
! if( myScript == NULL )
! continue;
! scriptChain.push_back( myScript );
}
}
--- 398,434 ----
for( myIter = eventList.begin(); myIter != eventList.end(); ++myIter )
{
! cPythonScript *Event = ScriptManager->find( *myIter );
// Script not found
! if( Event )
! {
! if( hasEvent( Event->name() ) )
! return;
! // Reallocate the ScriptChain
! if( scriptChain )
! {
! unsigned int i = 0;
! while( scriptChain[i] )
! {
! i++;
! }
!
! // i is the count of real elements in the old array
! cPythonScript **newScriptChain = new cPythonScript* [ i + 2 ];
! memcpy( newScriptChain, scriptChain, i * sizeof( cPythonScript* ) );
! newScriptChain[ i ] = Event;
! newScriptChain[ i + 1 ] = 0;
!
! delete [] scriptChain;
! scriptChain = newScriptChain;
! }
! else
! {
! scriptChain = new cPythonScript*[2];
! scriptChain[0] = Event;
! scriptChain[1] = 0;
! }
! }
}
}
Index: uobject.h
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/uobject.h,v
retrieving revision 1.72
retrieving revision 1.73
diff -C2 -d -r1.72 -r1.73
*** uobject.h 26 Aug 2003 15:01:05 -0000 1.72
--- uobject.h 27 Aug 2003 01:39:59 -0000 1.73
***************
*** 92,102 ****
public:
! const std::vector< cPythonScript* > &getEvents( void );
! void setEvents( std::vector< cPythonScript* > List );
! void clearEvents( void );
void addEvent( cPythonScript *Event );
void removeEvent( const QString& Name );
- void removeFromView( bool clean = true );
bool hasEvent( const QString& Name ) const;
// New Load (Query: result, offset: current field offset)
--- 92,112 ----
public:
! // EventHandling functions
! cPythonScript **getEvents()
! {
! return scriptChain;
! }
!
! void clearEvents();
void addEvent( cPythonScript *Event );
void removeEvent( const QString& Name );
bool hasEvent( const QString& Name ) const;
+ void recreateEvents();
+
+ // Returns the list of events
+ const QString &eventList() const
+ {
+ return eventList_;
+ }
// New Load (Query: result, offset: current field offset)
***************
*** 105,111 ****
bool del();
- QString eventList( void ) const; // Returns the list of events
- void recreateEvents( void ); // If the scripts are reloaded call that for each and every existing object
bool inRange( const cUObject *object, UINT32 range ) const;
// Multiple quick-effect methods
--- 115,120 ----
bool del();
bool inRange( const cUObject *object, UINT32 range ) const;
+ void removeFromView( bool clean = true );
// Multiple quick-effect methods
***************
*** 115,123 ****
// Events
- virtual bool onUse( cUObject *Target );
virtual bool onCreate( const QString &definition );
- virtual bool onCollide( cUObject* Obstacle ); // This is called for the walking character first, then for the item walked on
! bool free;
// Methods
--- 124,130 ----
// Events
virtual bool onCreate( const QString &definition );
! bool free;
// Methods
***************
*** 163,169 ****
protected:
!
! std::vector< cPythonScript* > scriptChain;
QString eventList_; // Important for recreating the scriptChain on reloading
void init();
};
--- 170,176 ----
protected:
! cPythonScript **scriptChain; // NULL Terminated Array
QString eventList_; // Important for recreating the scriptChain on reloading
+
void init();
};
Index: wolfpack.cpp
===================================================================
RCS file: /cvsroot/wpdev/wolfpack/wolfpack.cpp,v
retrieving revision 1.439
retrieving revision 1.440
diff -C2 -d -r1.439 -r1.440
*** wolfpack.cpp 26 Aug 2003 15:05:38 -0000 1.439
--- wolfpack.cpp 27 Aug 2003 01:39:59 -0000 1.440
***************
*** 580,583 ****
--- 580,586 ----
serverState = STARTUP;
// Print a seperator somehow
+ /*clConsole.send( QString::number( sizeof( cUObject ) ) );
+ return 0;*/
+
clConsole.send( QString( "\n%1 %2 %3 \n\n" ).arg( wp_version.productstring.c_str() ).arg( wp_version.betareleasestring.c_str() ).arg( wp_version.verstring.c_str() ) );
|