Update of /cvsroot/wpdev/xmlscripts/scripts/skills
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7087/skills
Modified Files:
fishing.py lumberjacking.py mining.py
Log Message:
Fixes to fishing.
Changed object timers to item.addtimer and char.addtimer
Index: mining.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/mining.py,v
retrieving revision 1.33
retrieving revision 1.34
diff -C2 -d -r1.33 -r1.34
*** mining.py 16 Jul 2004 07:09:27 -0000 1.33
--- mining.py 2 Sep 2004 00:07:08 -0000 1.34
***************
*** 45,49 ****
def mining( char, pos, tool ):
! wolfpack.addtimer( 1300, "skills.mining.domining", [ char, SOUND_MINING, tool, pos ] )
char.socket.settag( 'is_mining', ( wolfpack.time.currenttime() + miningdelay ) )
char.turnto( pos )
--- 45,49 ----
def mining( char, pos, tool ):
! char.addtimer( 1300, "skills.mining.domining", [ tool, pos ] )
char.socket.settag( 'is_mining', ( wolfpack.time.currenttime() + miningdelay ) )
char.turnto( pos )
***************
*** 137,147 ****
#Sound effect
! def domining(time, args):
! char = args[0]
! char.soundeffect(args[1])
! tool = args[2]
! pos = args[3]
socket = char.socket
! socket.deltag('is_mining')
# Recheck distance
--- 137,146 ----
#Sound effect
! def domining(char, args):
! char.soundeffect( SOUND_MINING )
! tool = args[0]
! pos = args[1]
socket = char.socket
! socket.deltag( 'is_mining' )
# Recheck distance
***************
*** 171,175 ****
if not veingem.hastag('resource_empty'):
duration = random.randint(MINING_REFILLTIME[0], MINING_REFILLTIME[1])
! wolfpack.addtimer(duration, "skills.mining.respawnvein", [veingem], 1)
veingem.settag('resource_empty', 1)
return False
--- 170,174 ----
if not veingem.hastag('resource_empty'):
duration = random.randint(MINING_REFILLTIME[0], MINING_REFILLTIME[1])
! veingem.addtimer( duration, "skills.mining.respawnvein", 1 )
veingem.settag('resource_empty', 1)
return False
***************
*** 235,239 ****
item.update()
! resourcecount = max(1, int(gem.gettag('resourcecount')))
gem.settag('resourcecount', resourcecount - 1)
--- 234,238 ----
item.update()
! resourcecount = max( 1, int( gem.gettag('resourcecount') ) )
gem.settag('resourcecount', resourcecount - 1)
***************
*** 241,246 ****
if not gem.hastag('resource_empty') and resourcecount <= 1:
delay = random.randint(MINING_REFILLTIME[0], MINING_REFILLTIME[1])
! wolfpack.addtimer(delay, "skills.mining.respawnvein", [gem], 1)
! gem.settag('resource_empty', 1)
message = ORES[resname][SUCCESSMESSAGE]
--- 240,245 ----
if not gem.hastag('resource_empty') and resourcecount <= 1:
delay = random.randint(MINING_REFILLTIME[0], MINING_REFILLTIME[1])
! gem.addtimer( delay, "skills.mining.respawnvein", 1 )
! gem.settag( 'resource_empty', 1 )
message = ORES[resname][SUCCESSMESSAGE]
***************
*** 252,257 ****
return True
! def respawnvein( time, args ):
! vein = args[0]
if vein and vein.hastag('resource_empty') and vein.gettag('resourcecount') == 0:
vein.settag('resourcecount', random.randint( MINING_ORE[0], MINING_ORE[1] ) )
--- 251,255 ----
return True
! def respawnvein( vein, args ):
if vein and vein.hastag('resource_empty') and vein.gettag('resourcecount') == 0:
vein.settag('resourcecount', random.randint( MINING_ORE[0], MINING_ORE[1] ) )
Index: fishing.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/fishing.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** fishing.py 16 Jul 2004 07:09:27 -0000 1.8
--- fishing.py 2 Sep 2004 00:07:08 -0000 1.9
***************
*** 220,224 ****
socket = char.socket
-
socket.deltag( 'is_fishing' )
--- 220,223 ----
***************
*** 254,258 ****
resource = wolfpack.additem( "1ea7" )
resource.name = 'Resource Item: fish'
! resource.settag( 'resourcecount', amount - 1 )
resource.settag( 'resource', 'fish' )
resource.visible = 0 # GM Visible only
--- 253,257 ----
resource = wolfpack.additem( "1ea7" )
resource.name = 'Resource Item: fish'
! resource.settag( 'resourcecount', int( amount - 1 ) )
resource.settag( 'resource', 'fish' )
resource.visible = 0 # GM Visible only
***************
*** 260,265 ****
pos = args[ 0 ]
resource.moveto( wolfpack.coord( int( floor( pos.x / 8 ) ) * 8, int( floor( pos.y / 8 ) ) * 8, int( pos.z - 5 ), pos.map ) )
! resource.decay = 1
! resource.decaytime = wolfpack.time.servertime() + ( random.randint(FISHING_REFILLTIME[0], FISHING_REFILLTIME[1]) )
resource.update() # Send to GMs
--- 259,265 ----
pos = args[ 0 ]
resource.moveto( wolfpack.coord( int( floor( pos.x / 8 ) ) * 8, int( floor( pos.y / 8 ) ) * 8, int( pos.z - 5 ), pos.map ) )
! resource.decay = 0
! decaytime = random.randint( FISHING_REFILLTIME[0], FISHING_REFILLTIME[1] )
! resource.addtimer( decaytime, 'skills.fishing.resourceDecayTimer', True )
resource.update() # Send to GMs
***************
*** 276,280 ****
# Otherwise try to stack it
elif not wolfpack.utilities.tobackpack( item, char ):
! item.update()
# Success!
--- 276,280 ----
# Otherwise try to stack it
elif not wolfpack.utilities.tobackpack( item, char ):
! item.update()
# Success!
***************
*** 283,284 ****
--- 283,288 ----
else:
socket.clilocmessage( 0xf61fd, "", 0x3b2, 3, 0, str(itemname) ) # You pull out an item along with a monster :
+
+ def resourceDecayTimer( resource, arguments ):
+ resource.delete()
+ return
Index: lumberjacking.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/lumberjacking.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** lumberjacking.py 16 Jul 2004 07:09:27 -0000 1.15
--- lumberjacking.py 2 Sep 2004 00:07:08 -0000 1.16
***************
*** 111,117 ****
# Delay for chopping trees and getting the logs
# Animation Sequence
! def chop_tree( time, args ):
! char = args[0]
! pos = args[1]
socket = char.socket
--- 111,116 ----
# Delay for chopping trees and getting the logs
# Animation Sequence
! def chop_tree( char, args ):
! pos = args[0]
socket = char.socket
***************
*** 155,161 ****
char.action( 0xd )
char.soundeffect( 0x13e )
! wolfpack.addtimer( 2000, "skills.lumberjacking.chop_tree", [char, pos] )
! wolfpack.addtimer( 3500, "skills.lumberjacking.chop_tree", [char, pos] )
! wolfpack.addtimer( 4000, "skills.lumberjacking.successlumberjacking", [char, pos, resource, amount, tool, resname, woodtable ] )
return
--- 154,160 ----
char.action( 0xd )
char.soundeffect( 0x13e )
! char.addtimer( 2000, "skills.lumberjacking.chop_tree", [pos] )
! char.addtimer( 3500, "skills.lumberjacking.chop_tree", [pos] )
! char.addtimer( 4000, "skills.lumberjacking.successlumberjacking", [pos, resource, amount, tool, resname, woodtable ] )
return
***************
*** 183,195 ****
char.socket.clilocmessage( 0x7A30B ) # You put some kindlings in your pack
! def successlumberjacking( time, args ):
! char = args[0]
! pos = args[1] # Target POS
! resource = args[2]
! amount = args[3]
! tool = args[4]
! resname = args[5]
! table = args[6]
socket = char.socket
# Lets make sure we stayed next to the tree
--- 182,193 ----
char.socket.clilocmessage( 0x7A30B ) # You put some kindlings in your pack
! def successlumberjacking( char, args ):
socket = char.socket
+ pos = args[0] # Target POS
+ resource = args[1]
+ amount = args[2]
+ tool = args[3]
+ resname = args[4]
+ table = args[5]
# Lets make sure we stayed next to the tree
***************
*** 256,264 ****
if not resource.hastag ('resource_empty') and int( resource.gettag( 'resourcecount' ) ) == 0:
resource.settag( 'resource_empty', 'true' )
! wolfpack.addtimer( woodrespawndelay, "skills.lumberjacking.respawnvein", [ resource ], 1 )
return True
! def respawnvein( time, args ):
! vein = args[0]
if vein.hastag ('resource_empty') and int(vein.gettag( 'resourcecount' )) == 0:
vein.settag( 'resourcecount', int( woodspawnamount ) )
--- 254,261 ----
if not resource.hastag ('resource_empty') and int( resource.gettag( 'resourcecount' ) ) == 0:
resource.settag( 'resource_empty', 'true' )
! resource.addtimer( woodrespawndelay, "skills.lumberjacking.respawnvein", True )
return True
! def respawnvein( vein, args ):
if vein.hastag ('resource_empty') and int(vein.gettag( 'resourcecount' )) == 0:
vein.settag( 'resourcecount', int( woodspawnamount ) )
|