wpdev-commits Mailing List for Wolfpack Emu (Page 7)
Brought to you by:
rip,
thiagocorrea
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(121) |
Sep
(256) |
Oct
(59) |
Nov
(73) |
Dec
(120) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(259) |
Feb
(381) |
Mar
(501) |
Apr
(355) |
May
(427) |
Jun
(270) |
Jul
(394) |
Aug
(412) |
Sep
(724) |
Oct
(578) |
Nov
(65) |
Dec
|
From: Sebastian H. <dar...@us...> - 2004-10-25 00:43:29
|
Update of /cvsroot/wpdev/xmlscripts/definitions/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14447/system Modified Files: skills.xml Log Message: Adjusted skill gain a little (less gain for crafting skills) Index: skills.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/system/skills.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** skills.xml 9 Sep 2004 03:19:39 -0000 1.3 --- skills.xml 25 Oct 2004 00:43:11 -0000 1.4 *************** *** 19,23 **** <dexchance>0.5</dexchance> <intchance>0.5</intchance> ! <gainchance>1</gainchance> <defname>ALCHEMY</defname> <name>Alchemy</name> --- 19,23 ---- <dexchance>0.5</dexchance> <intchance>0.5</intchance> ! <gainchance>0.75</gainchance> <defname>ALCHEMY</defname> <name>Alchemy</name> *************** *** 30,34 **** <dexchance>0.15</dexchance> <intchance>0.7</intchance> ! <gainchance>1</gainchance> <defname>ANATOMY</defname> <name>Anatomy</name> --- 30,34 ---- <dexchance>0.15</dexchance> <intchance>0.7</intchance> ! <gainchance>1.0</gainchance> <defname>ANATOMY</defname> <name>Anatomy</name> *************** *** 93,100 **** <!-- Blacksmithing --> <skill id="7"> ! <strchance>1.0</strchance> <dexchance>0</dexchance> <intchance>0</intchance> ! <gainchance>1</gainchance> <defname>BLACKSMITHING</defname> <name>Blacksmithing</name> --- 93,100 ---- <!-- Blacksmithing --> <skill id="7"> ! <strchance>1</strchance> <dexchance>0</dexchance> <intchance>0</intchance> ! <gainchance>0.5</gainchance> <defname>BLACKSMITHING</defname> <name>Blacksmithing</name> *************** *** 140,143 **** --- 140,144 ---- <dexchance>0.5</dexchance> <intchance>0</intchance> + <gainchance>0.75</gainchance> <defname>CARPENTRY</defname> <name>Carpentry</name> *************** *** 391,395 **** <dexchance>1.62</dexchance> <intchance>0.5</intchance> ! <gainchance>1</gainchance> <defname>TAILORING</defname> <name>Tailoring</name> --- 392,396 ---- <dexchance>1.62</dexchance> <intchance>0.5</intchance> ! <gainchance>0.5</gainchance> <defname>TAILORING</defname> <name>Tailoring</name> *************** *** 402,406 **** <dexchance>0.2</dexchance> <intchance>0.4</intchance> ! <gainchance>1</gainchance> <defname>ANIMALTAMING</defname> <name>Animal Taming</name> --- 403,407 ---- <dexchance>0.2</dexchance> <intchance>0.4</intchance> ! <gainchance>2</gainchance> <defname>ANIMALTAMING</defname> <name>Animal Taming</name> *************** *** 424,428 **** <dexchance>0.2</dexchance> <intchance>0.3</intchance> ! <gainchance>1</gainchance> <defname>TINKERING</defname> <name>Tinkering</name> --- 425,429 ---- <dexchance>0.2</dexchance> <intchance>0.3</intchance> ! <gainchance>0.5</gainchance> <defname>TINKERING</defname> <name>Tinkering</name> *************** *** 501,505 **** <dexchance>0</dexchance> <intchance>0</intchance> ! <gainchance>1</gainchance> <defname>LUMBERJACKING</defname> <name>Lumberjacking</name> --- 502,506 ---- <dexchance>0</dexchance> <intchance>0</intchance> ! <gainchance>0.5</gainchance> <defname>LUMBERJACKING</defname> <name>Lumberjacking</name> *************** *** 512,516 **** <dexchance>0</dexchance> <intchance>0</intchance> ! <gainchance>1</gainchance> <defname>MINING</defname> <name>Mining</name> --- 513,517 ---- <dexchance>0</dexchance> <intchance>0</intchance> ! <gainchance>0.5</gainchance> <defname>MINING</defname> <name>Mining</name> *************** *** 523,527 **** <dexchance>0</dexchance> <intchance>0</intchance> ! <gainchance>1</gainchance> <defname>MEDITATION</defname> <name>Meditation</name> --- 524,528 ---- <dexchance>0</dexchance> <intchance>0</intchance> ! <gainchance>0.5</gainchance> <defname>MEDITATION</defname> <name>Meditation</name> *************** *** 567,571 **** <dexchance>0</dexchance> <intchance>0</intchance> ! <gainchance>1</gainchance> <defname>FOCUS</defname> <name>Focus</name> --- 568,572 ---- <dexchance>0</dexchance> <intchance>0</intchance> ! <gainchance>0.5</gainchance> <defname>FOCUS</defname> <name>Focus</name> |
From: Sebastian H. <dar...@us...> - 2004-10-24 23:12:27
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21828/skills Modified Files: poisoning.py Log Message: poisoning fix Index: poisoning.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/poisoning.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** poisoning.py 13 Oct 2004 19:47:48 -0000 1.8 --- poisoning.py 24 Oct 2004 23:12:18 -0000 1.9 *************** *** 16,19 **** --- 16,23 ---- POISONING_DELAY = 1000 + # Min/Max-Skills for the various poison levels + MINSKILLS = [0, 300, 600, 950] + MAXSKILLS = [600, 700, 1000, 1000] + # Button for AnimalTaming pressed on skill gump def poisoning( char, skill ): *************** *** 42,45 **** --- 46,52 ---- char.socket.attachtarget( "skills.poisoning.selecttarget", [ potion.serial ] ) return 1 + + # Check for the following weapons: Butchers Knife, Cleaver, Dagger, Double Bladed Staff, Pike, Kryss + ALLOWED = [ 0x13f6, 0x13f7, 0xec2, 0xec3, 0xf51, 0xf52, 0x26bf, 0x26c9, 0x26be, 0x26c8, 0x1400, 0x1401 ] def selecttarget( char, args, target ): *************** *** 53,73 **** return - # target item must exists in backpack - #if not target.item.getoutmostitem() == char.backpack: - # char.socket.clilocmessage( 500295 ) - # return - - # check target type : food / blades if not target.item: char.socket.clilocmessage( 502145 ) return ! if not ( target.item.hasscript( 'food' ) or target.item.hasscript( 'blades' ) ): ! char.socket.clilocmessage( 502145 ) return ! ! # already poisoned ! #if target.hastag( 'poisoning' ): ! # return ! # sound / effect char.soundeffect( 0x4F ) --- 60,72 ---- return if not target.item: char.socket.clilocmessage( 502145 ) return ! ! global ALLOWED ! if not target.item.id in ALLOWED: ! char.socket.clilocmessage(1060204) return ! # sound / effect char.soundeffect( 0x4F ) *************** *** 84,89 **** skill = char.skill[ POISONING ] ! # poison strength : lesser(1), normal, greater, deadly(4) ! strength = int( potion.gettag( 'potiontype' ) ) - 13 # consume the potion / add a blank bottle --- 83,88 ---- skill = char.skill[ POISONING ] ! # poison strength : lesser(0), normal, greater, deadly(3) ! strength = int( potion.gettag( 'potiontype' ) ) - 14 # consume the potion / add a blank bottle *************** *** 91,116 **** bottle = wolfpack.additem( 'f0e' ) if not tobackpack( bottle, char ): ! bottle.moveto( char.pos.x, char.pos.y, char.pos.z, char.pos.map ) ! bottle.update() ! # FIXME : success / fail chance ! if skill < ( strength + 0.8 ) * 200: ! # failed to poison item char.socket.clilocmessage( 1010518 ) return 1 ! # check skill advance ! char.checkskill( POISONING, 0, 1000 ) ! ! # FIXME : less / strong chance ! if random.randint( 0, 20 ) > ( skill - strength * 200 ): ! strength = strength - 1 ! if strength < 1: ! # failed to poison ! char.socket.clilocmessage( 502148 ) ! return 1 ! char.socket.clilocmessage( 1010518 ) ! else: ! char.socket.clilocmessage( 1010517 ) # decrease karma / fame --- 90,100 ---- bottle = wolfpack.additem( 'f0e' ) if not tobackpack( bottle, char ): ! bottle.update() ! if not char.checkskill( POISONING, MINSKILLS[strength], MAXSKILLS[strength] ): char.socket.clilocmessage( 1010518 ) return 1 ! char.socket.clilocmessage(1010517) # decrease karma / fame *************** *** 123,127 **** # number of uses before the poison wears off if item.hasscript( 'blades' ): ! item.settag( 'poisoning_uses', 20 - strength * 2 ) return 1 --- 107,111 ---- # number of uses before the poison wears off if item.hasscript( 'blades' ): ! item.settag( 'poisoning_uses', 18 - strength * 2 ) return 1 |
From: Sebastian H. <dar...@us...> - 2004-10-24 21:15:42
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/monsters In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21842/npcs/monsters Modified Files: base.xml Log Message: Fixed an invalid direction tag for animals Index: base.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/monsters/base.xml,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** base.xml 10 Oct 2004 19:28:30 -0000 1.18 --- base.xml 24 Oct 2004 21:15:33 -0000 1.19 *************** *** 30,36 **** <mintaming>1100</mintaming> <wandertype>1</wandertype> ! <direction> ! <random min="0" max="7"/> ! </direction> <mintaming>2000</mintaming> <basescripts>speech.pets</basescripts> --- 30,34 ---- <mintaming>1100</mintaming> <wandertype>1</wandertype> ! <direction><random min="0" max="7"/></direction> <mintaming>2000</mintaming> <basescripts>speech.pets</basescripts> |
From: Sebastian H. <dar...@us...> - 2004-10-24 21:15:41
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/armory/hats In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21842/items/armory/hats Modified Files: tribal_masks.xml Log Message: Fixed an invalid direction tag for animals Index: tribal_masks.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/armory/hats/tribal_masks.xml,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** tribal_masks.xml 27 Sep 2004 00:31:02 -0000 1.7 --- tribal_masks.xml 24 Oct 2004 21:15:32 -0000 1.8 *************** *** 50,53 **** --- 50,54 ---- <intproperty name="res_energy" value="5" /> <allowmeditation /> + <durability><random min="20" max="25" /></durability> </item> |
From: Sebastian H. <dar...@us...> - 2004-10-24 21:15:41
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/animals In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21842/npcs/animals Modified Files: base.xml Log Message: Fixed an invalid direction tag for animals Index: base.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/animals/base.xml,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** base.xml 1 Oct 2004 22:38:27 -0000 1.16 --- base.xml 24 Oct 2004 21:15:33 -0000 1.17 *************** *** 13,17 **** <name>unknown animal</name> <wandertype>1</wandertype> ! <direction><random min="0" max="18" /></direction> <anatomy>0</anatomy> <mindamage>1</mindamage> --- 13,17 ---- <name>unknown animal</name> <wandertype>1</wandertype> ! <direction><random min="0" max="7" /></direction> <anatomy>0</anatomy> <mindamage>1</mindamage> |
From: Sebastian H. <dar...@us...> - 2004-10-23 19:58:42
|
Update of /cvsroot/wpdev/xmlscripts/definitions/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2550/system Modified Files: startitems.xml Log Message: Startitems Index: startitems.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/system/startitems.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** startitems.xml 19 Jul 2004 18:28:27 -0000 1.4 --- startitems.xml 23 Oct 2004 19:58:32 -0000 1.5 *************** *** 62,66 **** <startitems id="blacksmithing"> <!--Half Apron --><equipment id="153b" /> ! <!--Ingots --><item id="1bf2"><amount>50</amount></item> <!--Random Mining Tool--><item list="MININGTOOLS" /> <!--Random Blacksmith Tool--><item list="BLACKSMITHTOOLS"/> --- 62,66 ---- <startitems id="blacksmithing"> <!--Half Apron --><equipment id="153b" /> ! <!--Ingots --><item id="iron_ingot"><amount>50</amount></item> <!--Random Mining Tool--><item list="MININGTOOLS" /> <!--Random Blacksmith Tool--><item list="BLACKSMITHTOOLS"/> |
From: Richard M. <dr...@us...> - 2004-10-23 18:07:17
|
Update of /cvsroot/wpdev/xmlscripts/documentation/webroot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10820/documentation/webroot Modified Files: ChangeLog.wolfpack Log Message: Update Index: ChangeLog.wolfpack =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/documentation/webroot/ChangeLog.wolfpack,v retrieving revision 1.170 retrieving revision 1.171 diff -C2 -d -r1.170 -r1.171 *** ChangeLog.wolfpack 21 Oct 2004 00:21:33 -0000 1.170 --- ChangeLog.wolfpack 23 Oct 2004 18:07:08 -0000 1.171 *************** *** 13,16 **** --- 13,17 ---- - Fixed fishing pole not wearing out. - Fixed gainfactor for skills always beeing 1.0 + - Fixed a skill check bug with lumberjacking. * Misc. Changes: * Known Issues, Bugs, and Missing Features: |
From: Richard M. <dr...@us...> - 2004-10-23 18:06:33
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10571/scripts/skills Modified Files: lumberjacking.py Log Message: Fix for a skill check bug Pharao pointed out in IRC. Index: lumberjacking.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/lumberjacking.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** lumberjacking.py 13 Oct 2004 19:41:03 -0000 1.22 --- lumberjacking.py 23 Oct 2004 18:06:23 -0000 1.23 *************** *** 19,23 **** COLORID = 2 RESOURCENAME = 3 ! # resname, reqSkill, maxSkill, color woodtable = \ { --- 19,23 ---- COLORID = 2 RESOURCENAME = 3 ! # resname: [ reqSkill, maxSkill, color ] woodtable = \ { *************** *** 164,170 **** if not wolfpack.utilities.tobackpack( item, char ): item.update() ! # Resend weight ! char.socket.resendstatus() # Let him hack --- 164,170 ---- if not wolfpack.utilities.tobackpack( item, char ): item.update() ! # Resend weight ! char.socket.resendstatus() # Let him hack *************** *** 197,201 **** reqskill = woodtable[ resname ][ REQSKILL ] ! chance = int( ( char.skill[ LUMBERJACKING ] - woodtable[ resname ][ MINSKILL ] ) / 10 ) if char.skill[ LUMBERJACKING ] < reqskill: --- 197,201 ---- reqskill = woodtable[ resname ][ REQSKILL ] ! chance = max(0, char.skill[LUMBERJACKING] - woodtable[ resname ][ MINSKILL ]) / 1000.0 if char.skill[ LUMBERJACKING ] < reqskill: *************** *** 204,209 **** else: # Skill Check against LUMBERJACKING ! if not char.checkskill( LUMBERJACKING, reqskill, 1200 ): ! char.socket.clilocmessage( 500495 ) # You hack at the tree for a while but fail to produce... success = 0 return False --- 204,209 ---- else: # Skill Check against LUMBERJACKING ! if not skills.checkskill(char, LUMBERJACKING, chance): ! socket.clilocmessage(500495) success = 0 return False *************** *** 238,242 **** if not wolfpack.utilities.tobackpack( resourceitem, char ): resourceitem.update() ! # Resend weight char.socket.resendstatus() --- 238,242 ---- if not wolfpack.utilities.tobackpack( resourceitem, char ): resourceitem.update() ! # Resend weight char.socket.resendstatus() |
From: Incanus <inc...@us...> - 2004-10-22 23:38:26
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3921/scripts/wolfpack Modified Files: utilities.py Log Message: Added a missing id to the istree function Index: utilities.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/utilities.py,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** utilities.py 26 Sep 2004 23:32:07 -0000 1.68 --- utilities.py 20 Oct 2004 18:24:09 -0000 1.69 *************** *** 403,406 **** --- 403,407 ---- range( 3299, 3300 ) + \ range( 3302, 3303 ) + \ + range( 3320, 3321 ) + \ range( 3323, 3324 ) + \ range( 3326, 3327 ) + \ |
From: Sebastian H. <dar...@us...> - 2004-10-22 23:19:08
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15263/system Modified Files: regionchange.py Log Message: sound support Index: regionchange.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/regionchange.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** regionchange.py 20 Sep 2004 14:31:56 -0000 1.4 --- regionchange.py 22 Oct 2004 23:18:59 -0000 1.5 *************** *** 8,11 **** --- 8,40 ---- import wolfpack import string + import random + + def playmusic(socket, command, arguments): + packet = wolfpack.packet(0x6d, 3) + packet.setshort(1, int(arguments)) + packet.send(socket) + + def onLoad(): + wolfpack.registercommand('playmusic', playmusic) + + def changeMusic(char, oldregion, newregion): + oldMusic = oldregion.midilist + newMusic = newregion.midilist + + + if oldMusic != newMusic: + + try: + if len(newMusic) != 0: + id = int(random.choice(newMusic.split(','))) # Choose randomly + else: + id = 0 + + packet = wolfpack.packet(0x6d, 3) + packet.setshort(1, id) + packet.send(char.socket) + except: + raise + pass def onChangeRegion( char, oldregion, newregion ): *************** *** 14,17 **** --- 43,48 ---- if not socket: return False + + changeMusic(char, oldregion, newregion) """ |
From: Sebastian H. <dar...@us...> - 2004-10-22 23:19:08
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15263/commands Modified Files: import.py Log Message: sound support Index: import.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/import.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** import.py 2 Oct 2004 22:30:57 -0000 1.14 --- import.py 22 Oct 2004 23:18:59 -0000 1.15 *************** *** 212,222 **** color = 0 ! item = wolfpack.newitem(1) ! item.decay = 0 ! item.movable = 2 ! item.id = itemid ! item.color = color ! item.moveto( x, y, z, map ) ! item.update() count += 1 --- 212,225 ---- color = 0 ! item = wolfpack.additem('%x' % itemid) ! ! if item: ! item.decay = 0 ! item.movable = 3 ! item.color = color ! item.moveto( x, y, z, map ) ! item.update() ! else: ! warnings += "Found an invalid item id '%x' at %u,%u,%d,%u<br>" % (itemid, x, y, z, map) count += 1 |
From: Sebastian H. <dar...@us...> - 2004-10-22 18:40:42
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17196 Modified Files: commands.cpp Log Message: Changed gm talk color Index: commands.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/commands.cpp,v retrieving revision 1.268 retrieving revision 1.269 diff -C2 -d -r1.268 -r1.269 *** commands.cpp 9 Oct 2004 14:28:59 -0000 1.268 --- commands.cpp 22 Oct 2004 18:40:32 -0000 1.269 *************** *** 661,665 **** { if ( mSock->player() && mSock->player()->isGM() ) ! mSock->sysMessage( message, 0x539 ); } } --- 661,665 ---- { if ( mSock->player() && mSock->player()->isGM() ) ! mSock->sysMessage( message, 32 ); } } |
From: Correa <thi...@us...> - 2004-10-22 12:30:02
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28935 Modified Files: configure.py Log Message: typo :( Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** configure.py 19 Oct 2004 18:59:03 -0000 1.39 --- configure.py 22 Oct 2004 12:29:46 -0000 1.40 *************** *** 23,29 **** try: ! osHasPathDotSep = sys.path.sep except: ! sys.path.sep = '/' # These are the variables we are trying to figure out --- 23,29 ---- try: ! osHasPathDotSep = os.path.sep except: ! os.path.sep = '/' # These are the variables we are trying to figure out *************** *** 307,311 **** if options.disable_translation: ! DEFINES += "QT_NO_TRANSLATION " # Create config.pri --- 307,311 ---- if options.disable_translation: ! DEFINES += "QT_NO_TRANSLATION " # Create config.pri |
From: Sebastian H. <dar...@us...> - 2004-10-21 21:58:14
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12351/python Modified Files: global.cpp Log Message: fix for smithing Index: global.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v retrieving revision 1.167 retrieving revision 1.168 diff -C2 -d -r1.167 -r1.168 *** global.cpp 21 Oct 2004 12:11:19 -0000 1.167 --- global.cpp 21 Oct 2004 21:58:05 -0000 1.168 *************** *** 635,646 **** } if (x < 0) x = 0; ! if (x >= Maps::instance()->mapTileWidth(map)) ! x = Maps::instance()->mapTileWidth(map) - 1; if (y < 0) y = 0; ! if (y >= Maps::instance()->mapTileHeight(map)) ! y = Maps::instance()->mapTileHeight(map) - 1; StaticsIterator iter = Maps::instance()->staticsIterator( Coord_cl( x, y, 0, map ), exact ); --- 635,649 ---- } + int maxX = Maps::instance()->mapTileWidth(map) * 8; + int maxY = Maps::instance()->mapTileHeight(map) * 8; + if (x < 0) x = 0; ! if (x >= maxX) ! x = maxX - 1; if (y < 0) y = 0; ! if (y >= maxY) ! y = maxY - 1; StaticsIterator iter = Maps::instance()->staticsIterator( Coord_cl( x, y, 0, map ), exact ); |
From: Sebastian H. <dar...@us...> - 2004-10-21 21:40:39
|
Update of /cvsroot/wpdev/xmlscripts/definitions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8732 Modified Files: scripts.xml Log Message: runebook fix Index: scripts.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/scripts.xml,v retrieving revision 1.171 retrieving revision 1.172 diff -C2 -d -r1.171 -r1.172 *** scripts.xml 17 Oct 2004 17:45:22 -0000 1.171 --- scripts.xml 21 Oct 2004 21:40:29 -0000 1.172 *************** *** 181,184 **** --- 181,185 ---- <!-- System Scripts --> <script>system.dbupdate</script> + <script>system.input</script> <script>system.slayer</script> <script>system.hardwareinfo</script> |
From: Sebastian H. <dar...@us...> - 2004-10-21 21:40:34
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8689/system Added Files: input.py Log Message: Runebook Updates --- NEW FILE: input.py --- """ This file is used to request the next speech input from the client to be sent back in a special packet. This can be used for very simple renaming of runes, runebooks, etc. The user can also cancel the input by using his Escape key. If the user successfully enters a text, the onTextInput event will be called for the originating item. If the user cancels the request, onTextInputCancel will be called. """ import wolfpack # # Send an input line request to the client # def request(player, item, id): packet = wolfpack.packet(0x9a, 16) packet.setshort(1, 16) packet.setint(3, item.serial) packet.setint(7, id) packet.setint(11, 0) # Request/Reply packet.setbyte(15, 0) packet.send(player.socket) def callEvent(item, event, args): scripts = item.scripts + item.basescripts.split(',') # Build the scriptlist for script in scripts: if not wolfpack.hasnamedevent(script, event): continue result = wolfpack.callnamedevent(script, event, args) if result: return True return False # # Procses an input line response # def responseHandler(socket, packet): if packet.size < 16: return True item = wolfpack.finditem(packet.getint(3)) if not item: socket.sysmessage(tr('Unexpected input response.')) return True # Item went out of scope if packet.getint(11) != 1: args = (socket.player, item, packet.getint(7)) callEvent(item, 'onTextInputCancel', args) return True # Cancelled # Last byte has to be nullbyte if packet.getbyte(packet.size - 1) != 0: socket.log(LOG_ERROR, "Received invalid input response packet. String is not null terminated.") return True text = packet.getascii(15, packet.size - 15) # Build argument string for onTextInput event args = (socket.player, item, packet.getint(7), text) callEvent(item, 'onTextInput', args) return True # Register the packet hook for the response def onLoad(): wolfpack.registerpackethook(0x9a, responseHandler) |
From: Sebastian H. <dar...@us...> - 2004-10-21 21:40:33
|
Update of /cvsroot/wpdev/xmlscripts/scripts/commands In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8689/commands Modified Files: __init__.py Log Message: Runebook Updates Index: __init__.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/__init__.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** __init__.py 21 Sep 2004 06:44:38 -0000 1.21 --- __init__.py 21 Oct 2004 21:40:24 -0000 1.22 *************** *** 218,225 **** def test(socket, command, arguments): ! gump = cGump() ! gump.addGump(0, 0, 0x67) ! gump.addText(0, 0, "à¨Here is your bank box,".decode('utf-8'), 2) ! gump.send(socket) def newlostarget(char, arguments, target): --- 218,222 ---- def test(socket, command, arguments): ! pass def newlostarget(char, arguments, target): |
From: Richard M. <dr...@us...> - 2004-10-21 19:42:39
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16560 Modified Files: objectdef.h Log Message: Excess tabs = ugly to read Index: objectdef.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/objectdef.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** objectdef.h 24 Sep 2004 04:47:37 -0000 1.1 --- objectdef.h 21 Oct 2004 19:42:24 -0000 1.2 *************** *** 36,40 **** /*! Since we are not using QObject due to memory footprint, moc won't create some nice functions ! either, we need some macro magic to get them ( or disabling some ) without doing too much mess */ --- 36,40 ---- /*! Since we are not using QObject due to memory footprint, moc won't create some nice functions ! either, we need some macro magic to get them ( or disabling some ) without doing too much mess */ *************** *** 49,79 **** # ifndef QT_NO_TEXTCODEC // full set of tr functions ! # define WP_TR_FUNCTIONS(classname) \ ! static QString tr( const char* s, const char* c = 0 ) \ ! { \ ! if ( qApp ) \ ! return qApp->translate( #classname, s, c, QApplication::DefaultCodec ); \ ! else \ ! return QString::fromLatin1( s ); \ ! } \ ! \ ! static QString trUtf8( const char* s, const char* c = 0 ) \ ! { \ ! if ( qApp ) \ ! return qApp->translate( #classname, s, c, QApplication::UnicodeUTF8 ); \ ! else \ ! return QString::fromUtf8( s ); \ ! } # else // no QTextCodec, no utf8 # define WP_TR_FUNCTIONS \ ! static QString tr( const char* s, const char* c = 0 ) \ ! { \ ! if ( qApp ) \ ! return qApp->translate( #classname, s, c, QApplication::DefaultCodec ); \ ! else \ ! return QString::fromLatin1( s ); \ ! } # endif --- 49,79 ---- # ifndef QT_NO_TEXTCODEC // full set of tr functions ! # define WP_TR_FUNCTIONS(classname) \ ! static QString tr( const char* s, const char* c = 0 ) \ ! { \ ! if ( qApp ) \ ! return qApp->translate( #classname, s, c, QApplication::DefaultCodec ); \ ! else \ ! return QString::fromLatin1( s ); \ ! } \ ! \ ! static QString trUtf8( const char* s, const char* c = 0 ) \ ! { \ ! if ( qApp ) \ ! return qApp->translate( #classname, s, c, QApplication::UnicodeUTF8 ); \ ! else \ ! return QString::fromUtf8( s ); \ ! } # else // no QTextCodec, no utf8 # define WP_TR_FUNCTIONS \ ! static QString tr( const char* s, const char* c = 0 ) \ ! { \ ! if ( qApp ) \ ! return qApp->translate( #classname, s, c, QApplication::DefaultCodec ); \ ! else \ ! return QString::fromLatin1( s ); \ ! } # endif *************** *** 83,90 **** #endif ! #define OBJECTDEF(classname) \ ! public: \ ! /*virtual const char *className() const { return #classname; }*/ \ ! WP_TR_FUNCTIONS(classname) \ private: --- 83,90 ---- #endif ! #define OBJECTDEF(classname) \ ! public: \ ! /*virtual const char *className() const { return #classname; }*/ \ ! WP_TR_FUNCTIONS(classname) \ private: |
From: Sebastian H. <dar...@us...> - 2004-10-21 19:32:15
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14721/magic Modified Files: runebook.py Log Message: runebook fix Index: runebook.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/runebook.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** runebook.py 21 Oct 2004 18:01:47 -0000 1.15 --- runebook.py 21 Oct 2004 19:32:06 -0000 1.16 *************** *** 369,372 **** --- 369,375 ---- char.socket.clilocmessage(502421) + item.deltag('entry%u' % runenum) + item.deltag('entry%uname' % runenum) + closeGump(char, item) sendGump(char, item) |
From: Sebastian H. <dar...@us...> - 2004-10-21 18:02:13
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29139/magic Modified Files: runebook.py Log Message: Runebook fixes Index: runebook.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/runebook.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** runebook.py 21 Oct 2004 17:59:07 -0000 1.14 --- runebook.py 21 Oct 2004 18:01:47 -0000 1.15 *************** *** 347,353 **** char.say( "Kal Ort Por", 5 ) char.addtimer( 2000, "magic.runebook.recall0", [ item.serial, target ] ) ! else: ! # Fall back to the Recall Spell ! char.addtimer( 0, "magic.runebook.recall1", [item.serial, target] ) # Drop Rune --- 347,354 ---- char.say( "Kal Ort Por", 5 ) char.addtimer( 2000, "magic.runebook.recall0", [ item.serial, target ] ) ! elif hasSpell(char, 32): ! char.addtimer( 0, "magic.runebook.recall1", [item.serial, target] ) # Fall back to the Recall Spell ! else: ! char.socket.clilocmessage(502412) # No charges left # Drop Rune *************** *** 401,404 **** --- 402,406 ---- if charges <= 0: + char.socket.clilocmessage(502412) return # No charges left |
From: Sebastian H. <dar...@us...> - 2004-10-21 17:59:20
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28414/magic Modified Files: circle4.py circle7.py rune.py runebook.py Log Message: Runebook fixes Index: rune.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/rune.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** rune.py 6 Oct 2004 01:24:04 -0000 1.7 --- rune.py 21 Oct 2004 17:59:07 -0000 1.8 *************** *** 114,116 **** # Identify the item as a rune def onCreate( item, definition ): ! item.settag( 'marked', 0 ) --- 114,118 ---- # Identify the item as a rune def onCreate( item, definition ): ! if not item.hastag('marked'): ! item.settag( 'marked', 0 ) ! Index: runebook.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/runebook.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** runebook.py 20 Oct 2004 16:27:25 -0000 1.13 --- runebook.py 21 Oct 2004 17:59:07 -0000 1.14 *************** *** 15,168 **** import magic.scroll from magic.utilities import fizzle, MODE_BOOK, hasSpell ! import whrandom import wolfpack.utilities ! def onUse( char, item ): ! # char does not have it and distance > 2 ! if( char.distanceto( item ) > 2 and item.getoutmostchar() != char ): ! # "Target cannot be seen." ! char.socket.clilocmessage( 502400 ) ! return 1 ! # check use delay ! if item.hastag( "dclickdelay" ): ! # "This book needs time to recharge." ! char.socket.clilocmessage( 502403 ) ! return 1 ! sendGump( char, item ) ! # set use delay 2 sec ! item.settag( "dclickdelay", 1 ) ! wolfpack.addtimer( 2000, "magic.runebook.rmdelay", [ item.serial ] ) ! return True ! def onDropOnItem( book, item ): ! if book.layer != 0 or isrunebook(item): ! return False # Don't handle if book is being dragged ! ! char = item.container ! if isrunebook( book ): ! if isrune(item) and item.hastag('marked'): ! # initialize rune serials to -1 if there's no rune ! # should not occur - will be removed later ! for i in range( 0, 16 ): ! if not book.hastag( "rune %i" % i ): ! book.settag( "rune %i" % i, -1 ) ! ! # rune serials ! runes = [ -1 ] * 16 ! for i in range( 0, 16 ): ! runes[ i ] = int( book.gettag( "rune %i" % i ) ) ! i = 0 ! while( runes[ i ] > -1 and i < 16 ): ! i = i + 1 ! # runebook is full ! if( i > 15 ): ! # can we access the char.socket ? ! # "This runebook is full." ! if char.socket: ! char.socket.clilocmessage( 502401 ) ! char.getbackpack().additem(item) ! item.pos = book.pos ! item.pos.z += 1 ! item.update() ! return True ! book.settag( "rune %i" % i, int( item.serial ) ) ! ! # insert rune - is runebook a container ? ! wolfpack.utilities.tocontainer( item, book ) ! item.update() ! char.soundeffect(0x42) ! return True ! # Recall Scrolls for recharging ! elif item.hasscript('magic.scroll'): ! try: ! spellid = magic.scroll.calcSpellId(item) ! # Recall Scroll ! if spellid + 1 == 32: ! charges = item.amount ! maxcharges = book.gettag('maxcharges') - book.gettag('charges') ! ! if maxcharges > 0: ! charges = min(charges, maxcharges) ! book.settag('charges', book.gettag('charges') + charges) ! ! if charges >= item.amount: ! item.delete() ! return True ! else: ! item.amount -= charges ! item.update() ! item.resendtooltip() ! ! char.soundeffect(0x249) ! else: ! char.socket.clilocmessage(502410) except: ! pass ! ! char.getbackpack().additem(item) ! item.pos = book.pos ! item.pos.z += 1 ! item.update() ! return True ! def onCreate( item, defstr ): ! if not item: ! return 0 ! item.settag( "charges", 0 ) ! item.settag( "default", 0 ) ! # max charge calc will be added later ! if not item.hastag( 'maxcharges' ): ! item.settag( "maxcharges", 5 ) ! # initialize rune serials to -1 ! for i in range( 0, 16 ): ! item.settag( "rune %i" % i, -1 ) ! item.settag( "runebook", 1 ) ! return 1 ! def isrunebook( item ): ! if item.hastag( "runebook" ): ! return 1 ! return 0 ! def droprune( char, book, runenumber ): ! if book.hastag( "rune %i" % runenumber ): ! rune = wolfpack.finditem( book.gettag( "rune %i" % runenumber ) ) ! if rune: ! wolfpack.utilities.tobackpack( rune, char ) ! rune.update() ! book.settag( "rune %i" % runenumber, -1 ) ! book.update() ! char.socket.clilocmessage(502421) ! return True ! #elif rune and rune.container != book.serial: ! # book.settag( "rune %i" % runenumber, -1 ) ! # book.update() ! # return True return False ! def rmdelay( self, args ): ! if( len( args ) < 1 ): ! return 1 ! book = wolfpack.finditem( args[ 0 ] ) ! if not book: ! return 1 ! if not book.hastag( "dclickdelay" ): ! return 1 ! book.deltag( "dclickdelay" ) ! return 1 ! def sendGump( char, item ): ! char.socket.closegump( 0x87654322 ) ! char.soundeffect( 0x55 ) ! runebook = cGump( 0, 0, 0, 100, 120 ) runebook.startPage( 0 ) --- 15,219 ---- import magic.scroll from magic.utilities import fizzle, MODE_BOOK, hasSpell ! import random import wolfpack.utilities ! # ! # Is Runebook? ! # ! def isRunebook(runebook): ! return runebook.hasscript('magic.runebook') and runebook.id == 0x22c5 ! ! # ! # Is Rune? ! # ! def isRune(rune): ! return rune.hasscript('magic.rune') and (rune.id >= 0x1f14 and rune.id <= 0x1f17) ! # ! # Is the item a recall scroll? ! # ! def isRecallScroll(scroll): ! return scroll.hasscript('magic.scroll') and scroll.id == 0x1f4c ! # ! # Show a custom tooltip for runebooks ! # ! def onShowTooltip(player, runebook, tooltip): ! tooltip.reset() ! tooltip.add(1028901, '') ! if runebook.hastag('description'): ! description = unicode(runebook.gettag('description')) ! if len(description) > 0: ! tooltip.add(1042971, description) ! # ! # Convert this runebook by moving all the old runes out of it ! # ! def convertRunebook(runebook): ! if runebook.container.isitem(): ! wolfpack.utilities.cont2cont(runebook, runebook.container) ! # ! # Show the runebook as long as we are in range ! # ! def onUse(player, runebook): ! convertRunebook(runebook) # Legacy conversion ! if player.canreach(runebook, 1): ! closeGump(player, runebook) ! sendGump(player, runebook) ! return True ! ! # ! # Get the books charges ! # ! def getCharges(runebook): ! (charges, maxcharges) = (0, 6) # Default ! if runebook.hastag('maxcharges'): ! try: ! maxcharges = int(runebook.gettag('maxcharges')) ! except: ! maxcharges = 6 ! if runebook.hastag('charges'): ! try: ! charges = min(maxcharges, int(runebook.gettag('charges'))) ! except: ! charges = 0 ! return (charges, maxcharges) ! ! # ! # Get a single entry or None if that entry does not exist ! # ! def getEntry(runebook, index): ! if index < 0 or index > 15: ! return None ! tagname = 'entry%u' % index ! ! if not runebook.hastag(tagname): ! return None ! try: ! (x, y, z, map) = runebook.gettag(tagname).split(',') ! pos = wolfpack.coord(int(x), int(y), int(z), int(map)) ! except: ! return None ! ! return pos ! ! # ! # Retrieve the entries for this book ! # Index, Name, Location (coord) ! # ! def getEntries(runebook): ! entries = [] ! ! for i in range(0, 16): ! tagname = 'entry%u' % i ! if runebook.hastag(tagname): ! try: ! (x, y, z, map) = runebook.gettag(tagname).split(',') ! pos = wolfpack.coord(int(x), int(y), int(z), int(map)) ! ! if runebook.hastag(tagname + 'name'): ! name = runebook.gettag(tagname + 'name') ! else: ! name = tr('(indescript)') ! entries.append([i, name, pos]) except: ! raise ! runebook.deltag(tagname) ! runebook.deltag(tagname + 'name') ! return entries ! # ! # Get the first free index or -1 if the book is full ! # ! def getFreeIndex(runebook): ! for i in range(0, 16): ! if not runebook.hastag('entry%u' % i): ! return i ! return -1 # No free entry was found ! # ! # An item is being dropped on this runebook ! # ! def onDropOnItem(runebook, item): ! if not isRunebook(runebook): ! return False # Only handle for dropping something on the runebook ! ! if not item.container or not item.container.ischar(): ! return False # Some internal error or script before us ! ! player = item.container ! ! if isRune(item): ! location = None ! if item.hastag('marked') and item.hastag('location'): ! try: ! (x, y, z, map) = item.gettag('location').split(',') ! location = wolfpack.coord(int(x), int(y), int(z), int(map)) ! except: ! pass ! if location: ! index = getFreeIndex(runebook) ! ! if index != -1: ! tagname = 'entry%u' % index ! name = item.name.strip() ! if len(name) != 0: ! runebook.settag(tagname + 'name', name) ! else: ! runebook.deltag(tagname + 'name') # Make sure there is no old name ! runebook.settag(tagname, str(location)) ! player.soundeffect(0x42) ! item.delete() ! return True ! ! else: ! player.socket.clilocmessage(502401) ! else: ! player.socket.clilocmessage(502409) ! ! elif isRecallScroll(item): ! # Recharge if possible ! (charges, maxcharges) = getCharges(runebook) ! if charges < maxcharges: ! consume = min(item.amount, maxcharges - charges) ! runebook.settag('charges', charges + consume) ! player.soundeffect(0x249) ! ! if consume == item.amount: ! item.delete() ! return True # The item has been removed ! else: ! item.amount -= consume ! item.update() ! item.resendtooltip() ! else: ! player.socket.clilocmessage(502410) ! return False ! # Bounce Code ! if char.socket: ! char.socket.clilocmessage( 502401 ) ! char.getbackpack().additem(item) ! item.pos = book.pos ! item.pos.z += 1 ! item.update() ! return True ! def closeGump(char, item): ! char.socket.closegump(0x87654322) ! char.socket.deltag('runebook_open') ! def sendGump(char, item): ! char.socket.settag('runebook_open', 1) ! char.soundeffect(0x55) ! runebook = cGump(0, 0, 0, 100, 120) runebook.startPage( 0 ) *************** *** 189,198 **** # charge / max charge ! if not item.hastag( "charges" ): ! item.settag( "charges", 0 ) ! charges = item.gettag( "charges" ) ! if not item.hastag( "maxcharges" ): ! item.settag( "maxcharges", 5 ) ! maxcharges = item.gettag( "maxcharges" ) runebook.addText( 160, 40, "Charges: %i" % charges ) runebook.addText( 300, 40, "Max Charges: %i" % maxcharges ) --- 240,244 ---- # charge / max charge ! (charges, maxcharges) = getCharges(item) runebook.addText( 160, 40, "Charges: %i" % charges ) runebook.addText( 300, 40, "Max Charges: %i" % maxcharges ) *************** *** 207,228 **** runebook.addPageButton( 393, 14, 2206, 2206, 2 ) ! # get rune serials and names ! runes = [ -1 ] * 16 ! for i in range( 0, 16 ): ! if not item.hastag( "rune %i" % i ): ! item.settag( "rune %i" % i, int( runes[ i ] ) ) ! else: ! runes[ i ] = int( item.gettag( "rune %i" % i ) ) ! runenum = 0 ! while( runenum < 16 and runes[ runenum ] > -1 ): ! runenum = runenum + 1 ! runenames = [ "Empty" ] * 16 ! for i in range( 0, runenum ): ! rune = wolfpack.finditem( int( runes[ i ] ) ) ! if rune and isrune( rune ): ! runenames[ i ] = rune.name # blue button and rune name ! for i in range( 0, 16 ): if( i < 8 ): x = 130 --- 253,261 ---- runebook.addPageButton( 393, 14, 2206, 2206, 2 ) ! entries = getEntries(item) # Get runebook entries # blue button and rune name ! i = 0 ! for entry in entries: if( i < 8 ): x = 130 *************** *** 230,247 **** x = 290 y = 60 + ( i % 8 ) * 15 # blue button return code = rune number + 1 # tramel color : 115, feluca color : ??? ! namecolor = 115 ! runebook.addButton( x, y + 5, 2103, 2104, i + 1 ) ! if i < runenum: ! runebook.addText( x + 15, y, "%s" % runenames[ i ], namecolor ) ! else: ! # no color - black ! runebook.addText( x + 15, y, "Empty" ) ! if item.hastag( "default" ): ! default = item.gettag( "default" ) else: ! item.settag( "default", 0 ) default = 0 --- 263,279 ---- x = 290 y = 60 + ( i % 8 ) * 15 + # blue button return code = rune number + 1 # tramel color : 115, feluca color : ??? ! namecolor = 10 ! runebook.addButton( x, y + 5, 2103, 2104, 1 + entry[0] ) ! runebook.addText( x + 15, y, entry[1], namecolor ) ! i += 1 ! ! if item.hastag("default"): ! default = item.gettag("default") else: ! item.settag("default", 0 ) default = 0 *************** *** 249,257 **** for i in range( 2, 10 ): runebook.startPage( i ) # next page - top right corner if( i < 9 ): runebook.addPageButton( 393, 14, 2206, 2206, i + 1 ) # previous page - top left corner ! runebook.addPageButton( 125, 14, 2205, 2205, i - 1 ) # for each sub-page --- 281,291 ---- for i in range( 2, 10 ): runebook.startPage( i ) + # next page - top right corner if( i < 9 ): runebook.addPageButton( 393, 14, 2206, 2206, i + 1 ) + # previous page - top left corner ! runebook.addPageButton( 124, 14, 2205, 2205, i - 1 ) # for each sub-page *************** *** 259,287 **** # rune number k = ( i - 2 ) * 2 + j # blue button return code = 1 + rune number ! runebook.addButton( 130 + j * 160, 65, 2103, 2104, 1 + k ) # recall button return code = 301 + rune number ! runebook.addButton( 135 + j * 160, 140, 2271, 2271, 301 + k ) # gate button return code = 401 + rune number ! runebook.addButton( 205 + j * 160, 140, 2291, 2291, 401 + k ) ! # there's a recall rune ! # tramel color : 115, feluca : ??? ! namecolor = 115 ! if( k < runenum ): ! runebook.addText( 145 + j * 160, 60, runenames[ k ], namecolor ) ! # set default button return code = 101 + rune number ! if( k == default ): ! runebook.addButton( 160 + j * 135, 20, 2360, 2360, 101 + k ) ! else: ! runebook.addButton( 160 + j * 135, 20, 2360, 2361, 101 + k ) ! runebook.addText( 175 + j * 135, 15, "Set default" ) ! # drop button return code = 201 + rune number ! runebook.addButton( 135 + j * 160, 115, 2437, 2438, 201 + k ) ! runebook.addText( 150 + j * 160, 115, "Drop rune" ) ! # empty - no color : black ! else: ! runebook.addText( 145 + j * 160, 60, runenames[ k ] ) ! runebook.setArgs( [ item ] ) runebook.setType( 0x87654322 ) runebook.setCallback( "magic.runebook.callback" ) --- 293,316 ---- # rune number k = ( i - 2 ) * 2 + j + + if k >= len(entries): + runebook.addText( 145 + j * 160, 60, tr('Empty') ) + continue + # blue button return code = 1 + rune number ! runebook.addButton( 130 + j * 160, 65, 2103, 2104, 1 + entries[k][0] ) # recall button return code = 301 + rune number ! runebook.addButton( 135 + j * 160, 140, 2271, 2271, 301 + entries[k][0] ) # gate button return code = 401 + rune number ! runebook.addButton( 205 + j * 160, 140, 2291, 2291, 401 + entries[k][0] ) ! namecolor = 10 ! runebook.addText( 145 + j * 160, 60, entries[k][1], namecolor ) ! ! # Drop button return code = 201 + rune number ! runebook.addButton( 135 + j * 160, 115, 2437, 2438, 201 + entries[k][0] ) ! runebook.addText( 150 + j * 160, 115, tr("Drop rune") ) ! ! runebook.setArgs( [ item.serial ] ) runebook.setType( 0x87654322 ) runebook.setCallback( "magic.runebook.callback" ) *************** *** 292,408 **** # callback function - process gump callback def callback( char, args, target ): ! # close the book ! char.socket.closegump( 0x87654322 ) ! ! # error checkings - will be removed later ! if( len( args ) < 1 ): ! char.socket.sysmessage( "script error 1. contact GM." ) ! return False ! item = args[0] ! if not item: ! char.socket.sysmessage( "script error 2. contact GM." ) ! return False ! ! # distance check ! if( char.distanceto( item ) > 2 and item.getoutmostchar() != char ): ! char.socket.clilocmessage( 502400 ) ! return False ! button = int( target.button ) ! # rename book ! if( button == 1000 ): ! # "Please enter a title for the runebook:" ! char.socket.clilocmessage( 502414 ) ! # how do we request input and catch the response ? ! char.socket.sysmessage( "not implemented yet - will be added." ) ! return True ! runes = [ -1 ] * 16 ! for i in range( 0, 16 ): ! # should not occur - will be removed later ! if not item.hastag( "rune %i" % i ): ! item.settag( "rune %i" % i, -1 ) ! else: ! runes[ i ] = item.gettag( "rune %i" % i ) ! # selected rune number runenum = ( button - 1 ) % 100 ! if( runenum < 0 or runenum > 15 ): ! # "Request cancelled." ! char.socket.clilocmessage( 502415 ) ! return True ! ! # there's no rune ! if( runes[ runenum ] < 0 ): ! # "This place in the book is empty." ! char.socket.clilocmessage( 502411 ) return True ! # recall button - using charges : 1 - 16 if( button > 0 and button < 17 ): ! charges = item.gettag( "charges" ) ! if( charges < 1 ): ! # "There are no charges left on that item." ! #char.socket.clilocmessage( 502412 ) ! wolfpack.addtimer( 0, "magic.runebook.recall1", [ char.serial, runes[ runenum ] ] ) ! return False ! else: ! # recall to the rune char.say( "Kal Ort Por", 5 ) ! wolfpack.addtimer( 2000, "magic.runebook.recall0", [ char.serial, runes[ runenum ], item.serial, charges ] ) ! return True ! # set default button : 101 - 116 ! elif( button > 100 and button < 117 ): ! item.settag( "default", int( runenum ) ) ! return True ! # drop button : 201 - 216 elif( button > 200 and button < 217 ): ! # will be added ! droprune( char, item, runenum ) ! return True # recall button - spell : 301 - 316 elif( button > 300 and button < 317 ): ! # char action / power word ! wolfpack.addtimer( 0, "magic.runebook.recall1", [ char.serial, runes[ runenum ] ] ) ! return True # gate button : 401 - 416 elif( button > 400 and button < 417 ): ! wolfpack.addtimer( 0, "magic.runebook.gate", [ char.serial, runes[ runenum ] ] ) ! return True ! # button number error - should not occur ! else: ! char.socket.sysmessage( "script error 4. contact GM" ) ! return False ! ! return True # recall using charges ! def recall0( self, args ): ! if( len( args ) < 2 ): ! return False ! char = wolfpack.findchar( args[ 0 ] ) ! rune = wolfpack.finditem( args[ 1 ] ) ! runebook = wolfpack.finditem( args[ 2 ] ) ! charges = args[ 3 ] ! if not char: ! return False ! if not rune: ! char.socket.sysmessage( "runebook script error." ) ! return False ! if not char.gm: if char.iscriminal(): if char.socket: char.socket.clilocmessage(1005561) ! return False if char.attacktarget: if char.socket: char.socket.clilocmessage(1005564) ! return False ! location = rune.gettag('location') ! location = location.split(",") ! location = wolfpack.coord(int(location[0]), int(location[1]), int(location[2]), int(location[3])) region = None --- 321,407 ---- # callback function - process gump callback def callback( char, args, target ): ! item = wolfpack.finditem(args[0]) ! closeGump(char, item) ! if target.button == 0: ! return ! ! if not char.canreach(item, 1): ! return ! button = target.button ! # Get selected rune number runenum = ( button - 1 ) % 100 ! ! target = getEntry(item, runenum) ! ! if not target: ! char.socket.clilocmessage(502411) # No such rune return True ! # Use a charge or use the recall spell if( button > 0 and button < 17 ): ! (charges, maxcharges) = getCharges(item) ! if charges > 0: char.say( "Kal Ort Por", 5 ) ! char.addtimer( 2000, "magic.runebook.recall0", [ item.serial, target ] ) ! else: ! # Fall back to the Recall Spell ! char.addtimer( 0, "magic.runebook.recall1", [item.serial, target] ) ! ! # Drop Rune elif( button > 200 and button < 217 ): ! name = '' ! if item.hastag('entry%uname' % runenum): ! name = unicode(item.gettag('entry%uname' % runenum)) ! ! RUNEIDS = ['1f14', '1f15', '1f16', '1f17'] ! rune = wolfpack.additem(random.choice(RUNEIDS)) ! rune.settag('marked', 1) ! rune.settag('location', str(target)) ! rune.name = name ! ! if not wolfpack.utilities.tobackpack(rune, char): ! rune.update() ! ! char.socket.clilocmessage(502421) ! ! closeGump(char, item) ! sendGump(char, item) ! # recall button - spell : 301 - 316 elif( button > 300 and button < 317 ): ! char.addtimer( 0, "magic.runebook.recall1", [item.serial, target] ) ! # gate button : 401 - 416 elif( button > 400 and button < 417 ): ! char.addtimer( 0, "magic.runebook.gate", [item.serial, target] ) # recall using charges ! def recall0( char, args ): ! runebook = wolfpack.finditem(args[0]) ! location = args[1] ! ! if not runebook or not char: ! return ! if not char.gm: if char.iscriminal(): if char.socket: char.socket.clilocmessage(1005561) ! return if char.attacktarget: if char.socket: char.socket.clilocmessage(1005564) ! return ! ! (charges, maxcharges) = getCharges(runebook) ! ! if charges <= 0: ! return # No charges left ! runebook.settag('charges', charges - 1) # Reduce runebook charges region = None *************** *** 425,459 **** char.socket.resendworld() char.soundeffect(0x1fc) - # Remove Runebook Charges - charges = charges - 1 - runebook.settag( "charges", int( charges ) ) return True ! # recall spell to the selected rune ! def recall1( self, args ): ! char = wolfpack.findchar( args[ 0 ] ) ! rune = wolfpack.finditem( args[ 1 ] ) ! ! if not char: ! return False ! ! if not rune: ! char.socket.sysmessage( "Missing recall rune." ) ! return False ! ! magic.castSpell( char, 32, MODE_BOOK, args = [], target = rune ) ! return True ! ! def gate( self, args ): ! char = wolfpack.findchar( args[ 0 ] ) ! rune = wolfpack.finditem( args[ 1 ] ) ! ! if not char: ! return False ! ! if not rune: ! char.socket.sysmessage( "Missing recall rune." ) ! return False ! magic.castSpell( char, 52, MODE_BOOK, args = [], target = rune ) ! return True --- 424,442 ---- char.socket.resendworld() char.soundeffect(0x1fc) return True ! # Use the Recall spell to recall to the selected rune ! def recall1( char, args ): ! runebook = wolfpack.finditem(args[0]) ! target = args[1] ! ! if char and runebook: ! magic.castSpell( char, 32, MODE_BOOK, args = [target], target = runebook ) ! # Use the Gate spell to open a gate to the selected rune ! def gate( char, args ): ! runebook = wolfpack.finditem(args[0]) ! target = args[1] ! ! if char and runebook: ! magic.castSpell( char, 52, MODE_BOOK, args = [target], target = runebook ) Index: circle7.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle7.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** circle7.py 27 Sep 2004 22:33:22 -0000 1.17 --- circle7.py 21 Oct 2004 17:59:07 -0000 1.18 *************** *** 139,153 **** char.turnto(target) ! # We can only recall from recall runes ! if not target.hasscript( 'magic.rune' ): ! char.message(502357) ! return ! if not self.consumerequirements(char, mode, args, target, item): ! return ! if not target.hastag('marked') or target.gettag('marked') != 1: ! char.message(502354) ! fizzle(char) return --- 139,164 ---- char.turnto(target) ! # Runebook recall support ! runebook = magic.runebook.isRunebook(target) and len(args) == 1 ! # We can only recall from recall runes or via the runebook ! if not runebook: ! if not target.hasscript('magic.rune'): ! char.message(502357) ! return ! ! if not target.hastag('marked') or target.gettag('marked') != 1: ! char.message(502354) ! return ! location = target.gettag('location') ! location = location.split(",") ! location = wolfpack.coord(int(location[0]), int(location[1]), int(location[2]), int(location[3])) ! char.log(LOG_MESSAGE, 'Tries to gate to %s using rune.\n' % str(location)) ! else: ! location = args[0] ! char.log(LOG_MESSAGE, 'Tries to gate to %s using runebook.\n' % str(location)) ! ! if not self.consumerequirements(char, mode, args, target, item): return *************** *** 159,166 **** return - location = target.gettag('location') - location = location.split(",") - location = wolfpack.coord(int(location[0]), int(location[1]), int(location[2]), int(location[3])) - region = wolfpack.region(location.x, location.y, location.map) --- 170,173 ---- *************** *** 185,189 **** gate.settag('dispellable_field', 1) gate.addscript( 'magic.gate' ) ! gate.settag('target', target.gettag('location')) gate.update() gate.soundeffect(0x20e) --- 192,196 ---- gate.settag('dispellable_field', 1) gate.addscript( 'magic.gate' ) ! gate.settag('target', str(location)) gate.update() gate.soundeffect(0x20e) Index: circle4.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle4.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** circle4.py 27 Sep 2004 22:33:22 -0000 1.16 --- circle4.py 21 Oct 2004 17:59:07 -0000 1.17 *************** *** 126,140 **** char.turnto(target) ! # We can only recall from recall runes ! if not target.hasscript( 'magic.rune' ): ! char.message(502357) ! return ! if not self.consumerequirements(char, mode, args, target, item): ! return ! if not target.hastag('marked') or target.gettag('marked') != 1: ! char.message(502354) ! fizzle(char) return --- 126,151 ---- char.turnto(target) ! # Runebook recall support ! runebook = magic.runebook.isRunebook(target) and len(args) == 1 ! # We can only recall from recall runes or via the runebook ! if not runebook: ! if not target.hasscript('magic.rune'): ! char.message(502357) ! return ! ! if not target.hastag('marked') or target.gettag('marked') != 1: ! char.message(502354) ! return ! location = target.gettag('location') ! location = location.split(",") ! location = wolfpack.coord(int(location[0]), int(location[1]), int(location[2]), int(location[3])) ! char.log(LOG_MESSAGE, 'Tries to recall to %s using rune.\n' % str(location)) ! else: ! location = args[0] ! char.log(LOG_MESSAGE, 'Tries to recall to %s using runebook.\n' % str(location)) ! ! if not self.consumerequirements(char, mode, args, target, item): return *************** *** 147,154 **** return - location = target.gettag('location') - location = location.split(",") - location = wolfpack.coord(int(location[0]), int(location[1]), int(location[2]), int(location[3])) - region = None region = wolfpack.region(location.x, location.y, location.map) --- 158,161 ---- |
From: Sebastian H. <dar...@us...> - 2004-10-21 16:27:21
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10159 Modified Files: platform.h Log Message: Preparations for DLL ai addons Index: platform.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/platform.h,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** platform.h 21 Oct 2004 12:11:18 -0000 1.19 --- platform.h 21 Oct 2004 16:27:07 -0000 1.20 *************** *** 95,98 **** --- 95,100 ---- typedef double RF64; + #if defined(Q_CC_MSVC) + #if defined WPIMPORT #define WPEXPORT __declspec(dllimport) *************** *** 101,103 **** --- 103,112 ---- #endif + #else + + #undef WPEXPORT + #define WPEXPORT + + #endif + #endif // __PLATFORM_H__ |
From: Sebastian H. <dar...@us...> - 2004-10-21 15:56:05
|
Update of /cvsroot/wpdev/xmlscripts/definitions/multis In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3016/multis Modified Files: houses.xml Log Message: fixes Index: houses.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/multis/houses.xml,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** houses.xml 17 Oct 2004 01:19:33 -0000 1.9 --- houses.xml 21 Oct 2004 15:55:55 -0000 1.10 *************** *** 8,11 **** --- 8,19 ---- --> <definitions> + <!-- House Deed --> + <item id="house_deed"> + <weight>1.0</weight> + <basescripts>housing.deed</basescripts> + <id>0x14F0</id> + <newbie /> + </item> + <!-- Context Menu for securables --> <contextmenu id="security_menu"> *************** *** 46,49 **** --- 54,58 ---- <nodecay /> <scripts>housing.house</scripts> <!-- Because of onAttach this is not a basescript --> + <placement xoffset="0" yoffset="0" zoffset="0" /> </multi> |
From: Sebastian H. <dar...@us...> - 2004-10-21 15:56:05
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/professions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3016/items/professions Modified Files: mage.xml Log Message: fixes Index: mage.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/professions/mage.xml,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** mage.xml 18 Oct 2004 00:11:22 -0000 1.21 --- mage.xml 21 Oct 2004 15:55:54 -0000 1.22 *************** *** 38,49 **** <item id="22c5"> <id>0x22c5</id> <onehanded /> <decay /> <newbie /> - <buyprice>2500</buyprice> - <sellprice>250</sellprice> <category>Professions\Mage\Runebook </category> ! <basescripts>magic.runebook</basescripts> ! <weight>0.0</weight> </item> --- 38,51 ---- <item id="22c5"> <id>0x22c5</id> + <color>0x461</color> <onehanded /> <decay /> <newbie /> <category>Professions\Mage\Runebook </category> ! <basescripts>housing.security,magic.runebook</basescripts> ! <weight>3.0</weight> ! <bindmenu>security_menu</bindmenu> ! <tag name="max_charges" value="6" type="int" /> ! <tag name="security_level" value="1" type="int" /> <!-- default: coowner --> </item> |
From: Sebastian H. <dar...@us...> - 2004-10-21 12:11:35
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10137 Modified Files: ChangeLog basics.cpp coord.h dragdrop.cpp exceptions.h multi.cpp multi.h platform.h server.cpp server.h skills.cpp territories.cpp territories.h wolfpack.sln Added Files: mersennetwister.h Log Message: housing updates Index: wolfpack.sln =================================================================== RCS file: /cvsroot/wpdev/wolfpack/wolfpack.sln,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wolfpack.sln 22 Jul 2004 19:39:11 -0000 1.2 --- wolfpack.sln 21 Oct 2004 12:11:19 -0000 1.3 *************** *** 4,7 **** --- 4,11 ---- EndProjectSection EndProject + Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "plugin", "plugin\plugin.vcproj", "{709E9DEC-CDB2-4383-8B2D-10631EA06774}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection + EndProject Global GlobalSection(SolutionConfiguration) = preSolution *************** *** 17,20 **** --- 21,30 ---- {766437DE-37EB-400E-BF08-4AB9B529C83D}.Web-Release.ActiveCfg = Web-Release|Win32 {766437DE-37EB-400E-BF08-4AB9B529C83D}.Web-Release.Build.0 = Web-Release|Win32 + {709E9DEC-CDB2-4383-8B2D-10631EA06774}.Debug.ActiveCfg = Debug|Win32 + {709E9DEC-CDB2-4383-8B2D-10631EA06774}.Debug.Build.0 = Debug|Win32 + {709E9DEC-CDB2-4383-8B2D-10631EA06774}.Release.ActiveCfg = Release|Win32 + {709E9DEC-CDB2-4383-8B2D-10631EA06774}.Release.Build.0 = Release|Win32 + {709E9DEC-CDB2-4383-8B2D-10631EA06774}.Web-Release.ActiveCfg = Release|Win32 + {709E9DEC-CDB2-4383-8B2D-10631EA06774}.Web-Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution Index: coord.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/coord.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** coord.h 16 Sep 2004 01:40:17 -0000 1.22 --- coord.h 21 Oct 2004 12:11:10 -0000 1.23 *************** *** 35,39 **** class cUORxTarget; ! class Coord_cl { public: --- 35,39 ---- class cUORxTarget; ! class WPEXPORT Coord_cl { public: Index: dragdrop.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/dragdrop.cpp,v retrieving revision 1.248 retrieving revision 1.249 diff -C2 -d -r1.248 -r1.249 *** dragdrop.cpp 17 Oct 2004 01:20:19 -0000 1.248 --- dragdrop.cpp 21 Oct 2004 12:11:10 -0000 1.249 *************** *** 560,577 **** { dynamic_cast<P_PLAYER>( pChar )->onTradeStart( dynamic_cast<P_PLAYER>( pOtherChar ), pItem ); - // Check if we're already trading, - // if not create a new window - /* - P_ITEM tradeWindow = pChar->atLayer( cBaseChar::TradeWindow ); - //if( !tradeWindow ) - // tradeWindow = Trade->tradestart( client->socket(), pOtherChar ); - socket->bounceItem( pItem, BR_NO_REASON ); - socket->sysMessage( "Trading is disabled" ); - return; - tradeWindow->addItem( pItem, false, false ); - pItem->setPos( Coord_cl(rand() % 60, rand() % 60, 9) ); - pItem->removeFromView( false ); - pItem->update(); - */ return; } --- 560,563 ---- Index: territories.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/territories.h,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** territories.h 1 Oct 2004 19:43:56 -0000 1.32 --- territories.h 21 Oct 2004 12:11:19 -0000 1.33 *************** *** 116,119 **** --- 116,123 ---- return flags_ & 0x1000; } + bool isNoHousing( void ) const + { + return flags_ & 0x2000; + } QString guardOwner( void ) const { *************** *** 141,144 **** --- 145,149 ---- flags_ &= ~0x0001; } + void setNoMark( bool data ) { *************** *** 225,228 **** --- 230,240 ---- flags_ &= ~0x1000; } + void setNoHousing( bool data ) + { + if ( data ) + flags_ |= 0x2000; + else + flags_ &= ~0x2000; + } virtual void processNode( const cElement* Tag ); Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** ChangeLog 21 Oct 2004 00:19:41 -0000 1.121 --- ChangeLog 21 Oct 2004 12:11:10 -0000 1.122 *************** *** 3,7 **** Wolfpack 12.9.13 Beta (CVS) - Fixed meditation skillcheck in mana regeneration code. - - Added the <haircolor> NPC definition tag to dye the currently equipped hair/beard (both the same color). Wolfpack 12.9.12 Beta (18. October 2004) --- 3,6 ---- *************** *** 66,69 **** --- 65,69 ---- - Empty context menus are no longer send to the client. - Added the onCheckSecurity event for housing. + - Wrote the multi placement checks and exported them to python. Wolfpack 12.9.11 Beta (26. September 2004) Index: basics.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basics.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** basics.cpp 12 Oct 2004 23:59:28 -0000 1.42 --- basics.cpp 21 Oct 2004 12:11:10 -0000 1.43 *************** *** 48,61 **** #endif /*! Returns a random number between \a nLowNum and \a nHighNum. */ ! int RandomNum( int nLowNum, int nHighNum ) ! { ! if ( nHighNum - nLowNum + 1 ) ! return ( ( rand() % ( nHighNum - nLowNum + 1 ) ) + nLowNum ); ! else ! return nLowNum; } --- 48,65 ---- #endif + #include "mersennetwister.h" + + static MTRand mtrand; + /*! Returns a random number between \a nLowNum and \a nHighNum. */ ! int RandomNum(int nLowNum, int nHighNum) { ! if (nLowNum > nHighNum) { ! std::swap(nLowNum, nHighNum); ! } ! int diff = (nHighNum - nLowNum) + 1; ! return nLowNum + (mtrand.randInt() % diff); } *************** *** 66,78 **** float RandomFloatNum( float nLowNum, float nHighNum ) { ! if ( nHighNum - nLowNum + 1 ) ! { ! float number = nLowNum; ! number += rand() % static_cast<int>( ceil( nHighNum ) - ceil( nLowNum ) + 1 ); // Integer part ! number += ( float ) rand() / ( float ) 0x7FFFFFFF; ! return number; ! } ! else ! return nLowNum; } --- 70,75 ---- float RandomFloatNum( float nLowNum, float nHighNum ) { ! float diff = nHighNum - nLowNum; ! return nLowNum + mtrand.rand() * diff; } Index: multi.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/multi.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** multi.cpp 25 Sep 2004 22:57:09 -0000 1.16 --- multi.cpp 21 Oct 2004 12:11:18 -0000 1.17 *************** *** 28,36 **** #include "multi.h" #include "definitions.h" ! #include "muls/multiscache.h" #include "world.h" #include "log.h" #include "console.h" #include "sectors.h" #include "timers.h" --- 28,39 ---- #include "multi.h" #include "definitions.h" ! #include "territories.h" #include "muls/multiscache.h" + #include "muls/maps.h" + #include "muls/tilecache.h" #include "world.h" #include "log.h" #include "console.h" + #include "basechar.h" #include "sectors.h" #include "timers.h" *************** *** 194,195 **** --- 197,496 ---- } } + + bool cMulti::canPlace(const Coord_cl &pos, unsigned short multiid, QPtrList<cUObject> &moveOut, unsigned short yard) { + MultiDefinition *multi = MultiCache::instance()->getMulti(multiid); + + if (!multi) { + return false; + } + + moveOut.setAutoDelete(false); + + // Get the boundaries and build a list sorted by x,y + int left = multi->getLeft(); + int right = multi->getRight(); + int bottom = multi->getBottom(); + int top = multi->getTop(); + int height = multi->getHeight(); + int width = multi->getWidth(); + + QValueList<Coord_cl> borderList; // a list of points around the foundation that need to be clear of impassables + QValueList<Coord_cl> yardList; // a list of points in the yard (front/back of the house that needs to be clear) + + for ( int x = 0; x < width; ++x) { + for ( int y = 0; y < height; ++y) { + Coord_cl point = pos + Coord_cl(x + left, y + top); + bool hasBase = false; // Has this multi tile a base below the floor? + + // See if there are any tiles at that position + const QValueVector<multiItem_st> &multiItems = multi->itemsAt(x + left, y + top); + + if (multiItems.size() == 0) { + continue; // Skip this tile since there are no items here + } + + cTerritory *region = Territories::instance()->region(point); + if (region && region->isNoHousing()) { + return false; // No housing is allowed in this region + } + + // Collect data for the intersect checks + StaticsIterator statics = Maps::instance()->staticsIterator(point); + RegionIterator4Items items(point, 0); + int top, bottom; + unsigned short landId; + Maps::instance()->mapTileSpan(point, landId, bottom, top); + + // Check every tile of the multi at the current position + // The following algorithm is more or less a ripoff of RunUOs idea. + for (int i = 0; i < multiItems.size(); ++i) { + multiItem_st multiItem = multiItems[i]; + tile_st tile = TileCache::instance()->getTile(multiItem.tile); + + // Calculcate the spawn of the tile + int itemBottom = point.z + multiItem.z; + // if the tile is a surface, someone has to be able to stand on it. + int itemTop = itemBottom + tile.height + (((tile.flag2 & 0x02) != 0) ? 16 : 0); + + // There is special handling for floor tiles + bool baseTile = multiItem.z == 0 && (tile.flag1 & 0x10) != 0; + bool isHovering = true; // This tile has not yet something to "stand" on + + if (baseTile) + hasBase = true; + + // Does the multi item intersect a land-tile? + if ((itemTop < top && itemTop >= bottom) || (itemBottom < top && itemBottom >= bottom)) { + return false; + } + + // Since houses can only be built on land and not on items, it's enough to check for + // a solid foundation here + if (pos.z != bottom || pos.z != top) { + return false; + } + + // Check if the multi item is interfering with a static tile at the same position + statics.reset(); + while (!statics.atEnd()) { + const staticrecord &staticTile = (statics++).data(); + tile_st staticInfo = TileCache::instance()->getTile(staticTile.itemid); + + int staticBottom = staticTile.zoff; + int staticTop = staticBottom + staticInfo.height; + + // The tile intersects a static tile + if ((itemTop < staticTop && itemTop >= staticBottom) + || (itemBottom < staticTop && itemBottom >= staticBottom)) + { + bool impassable = (staticInfo.flag1 & 0x40) != 0; + bool background = (staticInfo.flag1 & 0x01) != 0; + bool surface = (staticInfo.flag2 & 0x02) != 0; + + // A normally blocking tile is intersecting our multi + if (impassable || (!background && surface)) { + return false; + } + } + } + + // Do the same check (as above) with movable items, but make sure that movable items + // are moved out of the house + for (items.Begin(); !items.atEnd(); items++) { + P_ITEM pItem = items.GetData(); + tile_st itemInfo = TileCache::instance()->getTile(pItem->id()); + + int dynamicBottom = pItem->pos().z; + int dynamicTop = dynamicBottom + itemInfo.height; + + // Only handle the tile if it is intersecting the multi + if ((itemTop < dynamicTop && itemTop >= dynamicBottom) + || (itemBottom < dynamicTop && itemBottom >= dynamicBottom)) + { + // Move the item out of the multi space if possible + if ((pItem->movable() == 0 && itemInfo.weight != 255) || pItem->movable() == 1) { + moveOut.append(pItem); + } else { + bool impassable = (itemInfo.flag1 & 0x40) != 0; + bool background = (itemInfo.flag1 & 0x01) != 0; + bool surface = (itemInfo.flag2 & 0x02) != 0; + + // A normally blocking tile is intersecting our multi + if (impassable || (!background && surface)) { + return false; + } + } + } + } + + // Moves mobiles inside the multi out to the ban location + RegionIterator4Chars chars(point, 0, true); + while (!chars.atEnd()) { + const cUObject *pChar = (chars++).GetData(); + // Move them ALWAYS out, they could be trapped by the castle otherwise (or other strange multi forms) + moveOut.append(pChar); + } + + // To keep roads house free, here's a specialized check for roads + if ((landId >= 0x71 && landId <= 0x8c) || + (landId >= 0x14c && landId <= 0x14f) || + (landId >= 0x161 && landId <= 0x174) || + (landId >= 0x1f0 && landId <= 0x1f3) || + (landId >= 0x26e && landId <= 0x279) || + (landId >= 0x27e && landId <= 0x281) || + (landId >= 0x324 && landId <= 0x3ac) || + (landId >= 0x597 && landId <= 0x5a6) || + (landId >= 0x637 && landId <= 0x63a) || + (landId >= 0x67d && landId <= 0x6a0) || + (landId >= 0x7ae && landId <= 0x7b1) || + (landId >= 0x442 && landId <= 0x479) || + (landId >= 0x501 && landId <= 0x510) || + (landId >= 0x009 && landId <= 0x015) || + (landId >= 0x150 && landId <= 0x15c)) + { + return false; // Road Blocked + } + + // For houses (they have a base you know...) + // we collect another list of points around the house that need to be checked + if (hasBase) { + int xOffset, yOffset; + + // We have to do two loops since the yard size does play a role here + // but not for the border + for (xOffset = -1; xOffset <= 1; ++xOffset) { + for (yOffset = -yard; yOffset <= yard; ++yOffset) { + Coord_cl pos = point + Coord_cl(xOffset, yOffset); + + if (!yardList.contains(pos)) { + yardList.push_back(pos); // Put this point into the yard checklist if it's not there + } + } + } + + for (xOffset = -1; xOffset <= 1; ++xOffset) { + for (yOffset = -1; yOffset <= 1; ++yOffset) { + Coord_cl pos = point + Coord_cl(xOffset, yOffset); + + // Only do the following if the current tiles position differs from the + // check position. + if (xOffset != 0 || yOffset != 0) { + // The border list should not contain tiles that are actually below the multis + // floor and hence not visible and covered by a walkable multi tile. + // So what we do here is check if within 8 z units of the multis floor there is a + // walkable tile above the border tile + int multiX = x + xOffset; // Offset to the upper left corner of the multi + int multiY = y + yOffset; // Offset to the upper left corner of the multi + bool found = false; // Assume there is no such tile + + // Only do this check if the to-be-checked tile is really within the multi + // boundaries + if (multiX >= 0 && multiY >= 0 && multiX < width && multiY < height) { + // Get the multi tiles at the to-check position + const QValueVector<multiItem_st> &tiles = multi->itemsAt(multiX + left, multiY + right); + QValueVector<multiItem_st>::const_iterator it; + for (it = tiles.begin(); it != tiles.end(); ++it) { + if (it->z > 8) { + continue; // Skip the tile if its above the base (2nd floor etc.) + } + + // Get the tiledata info for this tile if it's below z8 + tile_st tileInfo = TileCache::instance()->getTile(it->tile); + bool surface = (tileInfo.flag2 & 0x02) != 0; + + if (tileInfo.height == 0 && surface) { + found = true; + break; + } + } + + // We found a tile that we could stand on. So it's not neccesary to check + // that the house stands on something walkable here. + if (found) { + continue; + } + } + + // Add the tile to the list of border tiles. + if (!borderList.contains(pos)) { + borderList.append(pos); + } + } + } + } + } + } + } + } + + QValueList<Coord_cl>::const_iterator it; + + // Now check all the accumulated border tiles + for (it = borderList.begin(); it != borderList.end(); ++it) { + map_st mapTile = Maps::instance()->seekMap(*it); + land_st mapTileInfo = TileCache::instance()->getLand(mapTile.id); + + // Impassable map tiles are not allowed nearby + bool impassable = (mapTileInfo.flag1 & 0x40) != 0; + if (impassable) { + return false; + } + + // Get Static Tiles + StaticsIterator statics = Maps::instance()->staticsIterator(*it); + while (!statics.atEnd()) { + const staticrecord &staticItem = statics.data(); + tile_st staticInfo = TileCache::instance()->getTile(staticItem.itemid); + + bool impassable = (staticInfo.flag1 & 0x40) != 0; + bool background = (staticInfo.flag1 & 0x01) != 0; + bool surface = (staticInfo.flag2 & 0x02) != 0; + + // The tile is only of importance if it's not below the multi + if ((staticItem.zoff > ((*it).z + 2)) && (impassable || (!background && surface))) { + return false; // A normally blocking tile is intersecting our multi border + } + + statics++; + } + + // Do the same check (as above) with dynamic items + RegionIterator4Items items(*it, 0); + for (items.Begin(); !items.atEnd(); items++) { + P_ITEM pItem = items.GetData(); + tile_st itemInfo = TileCache::instance()->getTile(pItem->id()); + + // Move the item out of the multi space if possible + if ((pItem->movable() == 0 && itemInfo.weight != 255) || pItem->movable() == 1) { + continue; + } else { + if (pItem->pos().z <= ((*it).z + 2)) { + continue; // Does not interfere with the border + } + + bool impassable = (itemInfo.flag1 & 0x40) != 0; + bool background = (itemInfo.flag1 & 0x01) != 0; + bool surface = (itemInfo.flag2 & 0x02) != 0; + + // A normally blocking tile is intersecting our multi + if (impassable || (!background && surface)) { + return false; + } + } + } + } + + // The yard has to be free of any multis at that position + for (it = yardList.begin(); it != yardList.end(); ++it) { + RegionIterator4Items multis(*it); // Search for multis in the region + for (multis.Begin(); !multis.atEnd(); multis++) { + cMulti *multi = dynamic_cast<cMulti*>(multis.GetData()); + + if (multi && multi->inMulti(*it)) { + return false; // This is a simplified check but it should be sufficient. + } + } + } + + return true; + } Index: exceptions.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/exceptions.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** exceptions.h 2 Jun 2004 15:04:05 -0000 1.11 --- exceptions.h 21 Oct 2004 12:11:18 -0000 1.12 *************** *** 37,41 **** #include <qstring.h> ! class wpException : public std::exception { private: --- 37,41 ---- #include <qstring.h> ! class WPEXPORT wpException : public std::exception { private: Index: platform.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/platform.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** platform.h 14 Oct 2004 16:55:34 -0000 1.18 --- platform.h 21 Oct 2004 12:11:18 -0000 1.19 *************** *** 95,97 **** --- 95,103 ---- typedef double RF64; + #if defined WPIMPORT + #define WPEXPORT __declspec(dllimport) + #else + #define WPEXPORT __declspec(dllexport) + #endif + #endif // __PLATFORM_H__ Index: skills.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/skills.cpp,v retrieving revision 1.233 retrieving revision 1.234 diff -C2 -d -r1.233 -r1.234 *** skills.cpp 9 Oct 2004 14:28:59 -0000 1.233 --- skills.cpp 21 Oct 2004 12:11:18 -0000 1.234 *************** *** 209,213 **** pToSteal->update(); ! caught = pChar->skillValue( STEALING ) < rand() % 1001; } else --- 209,213 ---- pToSteal->update(); ! caught = pChar->skillValue( STEALING ) < RandomNum(0, 1000); } else --- NEW FILE: mersennetwister.h --- // MersenneTwister.h // Mersenne Twister random number generator -- a C++ class MTRand // Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus // Richard J. Wagner v1.0 15 May 2003 rjw...@wr... // The Mersenne Twister is an algorithm for generating random numbers. It // was designed with consideration of the flaws in various other generators. // The period, 2^19937-1, and the order of equidistribution, 623 dimensions, // are far greater. The generator is also fast; it avoids multiplication and // division, and it benefits from caches and pipelines. For more information // see the inventors' web page at http://www.math.keio.ac.jp/~matumoto/emt.html // Reference // M. Matsumoto and T. Nishimura, "Mersenne Twister: A 623-Dimensionally // Equidistributed Uniform Pseudo-Random Number Generator", ACM Transactions on // Modeling and Computer Simulation, Vol. 8, No. 1, January 1998, pp 3-30. // Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, // Copyright (C) 2000 - 2003, Richard J. Wagner // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // 1. Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // 3. The names of its contributors may not be used to endorse or promote // products derived from this software without specific prior written // permission. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // The original code included the following notice: // // When you use this, send an email to: mat...@ma... // with an appropriate reference to your work. // // It would be nice to CC: rjw...@wr... and Co...@ma... // when you write. #ifndef MERSENNETWISTER_H #define MERSENNETWISTER_H // Not thread safe (unless auto-initialization is avoided and each thread has // its own MTRand object) #include <limits.h> #include <stdio.h> #include <time.h> #include <math.h> class MTRand { // Data public: typedef unsigned long uint32; // unsigned integer type, at least 32 bits enum { N = 624 }; // length of state vector enum { SAVE = N + 1 }; // length of array for save() protected: enum { M = 397 }; // period parameter uint32 state[N]; // internal state uint32 *pNext; // next value to get from state int left; // number of values left before reload needed //Methods public: MTRand( const uint32& oneSeed ); // initialize with a simple uint32 MTRand( uint32 *const bigSeed, uint32 const seedLength = N ); // or an array MTRand(); // auto-initialize with /dev/urandom or time() and clock() // Do NOT use for CRYPTOGRAPHY without securely hashing several returned // values together, otherwise the generator state can be learned after // reading 624 consecutive values. // Access to 32-bit random numbers double rand(); // real number in [0,1] double rand( const double& n ); // real number in [0,n] double randExc(); // real number in [0,1) double randExc( const double& n ); // real number in [0,n) double randDblExc(); // real number in (0,1) double randDblExc( const double& n ); // real number in (0,n) uint32 randInt(); // integer in [0,2^32-1] uint32 randInt( const uint32& n ); // integer in [0,n] for n < 2^32 double operator()() { return rand(); } // same as rand() // Access to 53-bit random numbers (capacity of IEEE double precision) double rand53(); // real number in [0,1) // Access to nonuniform random number distributions double randNorm( const double& mean = 0.0, const double& variance = 0.0 ); // Re-seeding functions with same behavior as initializers void seed( const uint32 oneSeed ); void seed( uint32 *const bigSeed, const uint32 seedLength = N ); void seed(); protected: void initialize( const uint32 oneSeed ); void reload(); uint32 hiBit( const uint32& u ) const { return u & 0x80000000UL; } uint32 loBit( const uint32& u ) const { return u & 0x00000001UL; } uint32 loBits( const uint32& u ) const { return u & 0x7fffffffUL; } uint32 mixBits( const uint32& u, const uint32& v ) const { return hiBit(u) | loBits(v); } uint32 twist( const uint32& m, const uint32& s0, const uint32& s1 ) const { return m ^ (mixBits(s0,s1)>>1) ^ (-loBit(s1) & 0x9908b0dfUL); } static uint32 hash( time_t t, clock_t c ); }; inline MTRand::MTRand( const uint32& oneSeed ) { seed(oneSeed); } inline MTRand::MTRand( uint32 *const bigSeed, const uint32 seedLength ) { seed(bigSeed,seedLength); } inline MTRand::MTRand() { seed(); } inline double MTRand::rand() { return double(randInt()) * (1.0/4294967295.0); } inline double MTRand::rand( const double& n ) { return rand() * n; } inline double MTRand::randExc() { return double(randInt()) * (1.0/4294967296.0); } inline double MTRand::randExc( const double& n ) { return randExc() * n; } inline double MTRand::randDblExc() { return ( double(randInt()) + 0.5 ) * (1.0/4294967296.0); } inline double MTRand::randDblExc( const double& n ) { return randDblExc() * n; } inline double MTRand::rand53() { uint32 a = randInt() >> 5, b = randInt() >> 6; return ( a * 67108864.0 + b ) * (1.0/9007199254740992.0); // by Isaku Wada } inline double MTRand::randNorm( const double& mean, const double& variance ) { // Return a real number from a normal (Gaussian) distribution with given // mean and variance by Box-Muller method double r = sqrt( -2.0 * log( 1.0-randDblExc()) ) * variance; double phi = 2.0 * 3.14159265358979323846264338328 * randExc(); return mean + r * cos(phi); } inline MTRand::uint32 MTRand::randInt() { // Pull a 32-bit integer from the generator state // Every other access function simply transforms the numbers extracted here if( left == 0 ) reload(); --left; register uint32 s1; s1 = *pNext++; s1 ^= (s1 >> 11); s1 ^= (s1 << 7) & 0x9d2c5680UL; s1 ^= (s1 << 15) & 0xefc60000UL; return ( s1 ^ (s1 >> 18) ); } inline MTRand::uint32 MTRand::randInt( const uint32& n ) { // Find which bits are used in n // Optimized by Magnus Jonsson (ma...@sm...) uint32 used = n; used |= used >> 1; used |= used >> 2; used |= used >> 4; used |= used >> 8; used |= used >> 16; // Draw numbers until one is found in [0,n] uint32 i; do i = randInt() & used; // toss unused bits to shorten search while( i > n ); return i; } inline void MTRand::seed( const uint32 oneSeed ) { // Seed the generator with a simple uint32 initialize(oneSeed); reload(); } inline void MTRand::seed( uint32 *const bigSeed, const uint32 seedLength ) { // Seed the generator with an array of uint32's // There are 2^19937-1 possible initial states. This function allows // all of those to be accessed by providing at least 19937 bits (with a // default seed length of N = 624 uint32's). Any bits above the lower 32 // in each element are discarded. // Just call seed() if you want to get array from /dev/urandom initialize(19650218UL); register int i = 1; register uint32 j = 0; register int k = ( N > seedLength ? N : seedLength ); for( ; k; --k ) { state[i] = state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1664525UL ); state[i] += ( bigSeed[j] & 0xffffffffUL ) + j; state[i] &= 0xffffffffUL; ++i; ++j; if( i >= N ) { state[0] = state[N-1]; i = 1; } if( j >= seedLength ) j = 0; } for( k = N - 1; k; --k ) { state[i] = state[i] ^ ( (state[i-1] ^ (state[i-1] >> 30)) * 1566083941UL ); state[i] -= i; state[i] &= 0xffffffffUL; ++i; if( i >= N ) { state[0] = state[N-1]; i = 1; } } state[0] = 0x80000000UL; // MSB is 1, assuring non-zero initial array reload(); } inline void MTRand::seed() { // Seed the generator with an array from /dev/urandom if available // Otherwise use a hash of time() and clock() values // First try getting an array from /dev/urandom FILE* urandom = fopen( "/dev/urandom", "rb" ); if( urandom ) { uint32 bigSeed[N]; register uint32 *s = bigSeed; register int i = N; register bool success = true; while( success && i-- ) success = fread( s++, sizeof(uint32), 1, urandom ); fclose(urandom); if( success ) { seed( bigSeed, N ); return; } } // Was not successful, so use time() and clock() instead seed( hash( time(NULL), clock() ) ); } inline void MTRand::initialize( const uint32 seed ) { // Initialize generator state with seed // See Knuth TAOCP Vol 2, 3rd Ed, p.106 for multiplier. // In previous versions, most significant bits (MSBs) of the seed affect // only MSBs of the state array. Modified 9 Jan 2002 by Makoto Matsumoto. register uint32 *s = state; register uint32 *r = state; register int i = 1; *s++ = seed & 0xffffffffUL; for( ; i < N; ++i ) { *s++ = ( 1812433253UL * ( *r ^ (*r >> 30) ) + i ) & 0xffffffffUL; r++; } } inline void MTRand::reload() { // Generate N new values in state // Made clearer and faster by Matthew Bellew (mat...@ho...) register uint32 *p = state; register int i; for( i = N - M; i--; ++p ) *p = twist( p[M], p[0], p[1] ); for( i = M; --i; ++p ) *p = twist( p[M-N], p[0], p[1] ); *p = twist( p[M-N], p[0], state[0] ); left = N, pNext = state; } inline MTRand::uint32 MTRand::hash( time_t t, clock_t c ) { // Get a uint32 from t and c // Better than uint32(x) in case x is floating point in [0,1] // Based on code by Lawrence Kirby (fr...@ge...) static uint32 differ = 0; // guarantee time-based seeds will change uint32 h1 = 0; unsigned char *p = (unsigned char *) &t; for( size_t i = 0; i < sizeof(t); ++i ) { h1 *= UCHAR_MAX + 2U; h1 += p[i]; } uint32 h2 = 0; p = (unsigned char *) &c; for( size_t j = 0; j < sizeof(c); ++j ) { h2 *= UCHAR_MAX + 2U; h2 += p[j]; } return ( h1 + differ++ ) ^ h2; } #endif // MERSENNETWISTER_H // Change log: // // v0.1 - First release on 15 May 2000 // - Based on code by Makoto Matsumoto, Takuji Nishimura, and Shawn Cokus // - Translated from C to C++ // - Made completely ANSI compliant // - Designed convenient interface for initialization, seeding, and // obtaining numbers in default or user-defined ranges // - Added automatic seeding from /dev/urandom or time() and clock() // - Provided functions for saving and loading generator state // // v0.2 - Fixed bug which reloaded generator one step too late // // v0.3 - Switched to clearer, faster reload() code from Matthew Bellew // // v0.4 - Removed trailing newline in saved generator format to be consistent // with output format of built-in types // // v0.5 - Improved portability by replacing static const int's with enum's and // clarifying return values in seed(); suggested by Eric Heimburg // - Removed MAXINT constant; use 0xffffffffUL instead // // v0.6 - Eliminated seed overflow when uint32 is larger than 32 bits // - Changed integer [0,n] generator to give better uniformity // // v0.7 - Fixed operator precedence ambiguity in reload() // - Added access for real numbers in (0,1) and (0,n) // // v0.8 - Included time.h header to properly support time_t and clock_t // // v1.0 - Revised seeding to match 26 Jan 2002 update of Nishimura and Matsumoto // - Allowed for seeding with arrays of any length // - Added access for real numbers in [0,1) with 53-bit resolution // - Added access for real numbers from normal (Gaussian) distributions // - Increased overall speed by optimizing twist() // - Doubled speed of integer [0,n] generation // - Fixed out-of-range number generation on 64-bit machines // - Improved portability by substituting literal constants for long enum's // - Changed license from GNU LGPL to BSD Index: territories.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/territories.cpp,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** territories.cpp 9 Oct 2004 14:29:00 -0000 1.57 --- territories.cpp 21 Oct 2004 12:11:19 -0000 1.58 *************** *** 160,163 **** --- 160,165 ---- else if ( childNode->name() == "noentermessage" ) setNoEnterMessage( true ); + else if ( childNode->name() == "nohousing" ) + setNoHousing( true ); } } Index: server.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/server.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** server.cpp 16 Oct 2004 18:19:40 -0000 1.33 --- server.cpp 21 Oct 2004 12:11:18 -0000 1.34 *************** *** 493,497 **** d->time = getNormalizedTime(); - srand( d->time ); } --- 493,496 ---- Index: multi.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/multi.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** multi.h 19 Aug 2004 01:22:52 -0000 1.10 --- multi.h 21 Oct 2004 12:11:18 -0000 1.11 *************** *** 63,66 **** --- 63,68 ---- virtual ~cMulti(); + // This static function can be used to check if the given multi can be placed at the given position + static bool canPlace(const Coord_cl &pos, unsigned short multiid, QPtrList<cUObject> &moveOut, unsigned short yard = 5); static void buildSqlString(const char *objectid, QStringList &fields, QStringList &tables, QStringList &conditions); Index: server.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/server.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** server.h 24 Sep 2004 04:47:37 -0000 1.6 --- server.h 21 Oct 2004 12:11:18 -0000 1.7 *************** *** 58,62 **** \brief A server component. */ ! class cComponent { private: --- 58,62 ---- \brief A server component. */ ! class WPEXPORT cComponent { private: |