Update of /cvsroot/wpdev/xmlscripts/scripts/weapons
In directory sc8-pr-cvs1:/tmp/cvs-serv26493
Modified Files:
blades.py
Log Message:
Lumberjacking should work a lot better now :)
Index: blades.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/weapons/blades.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** blades.py 14 Jan 2004 13:12:28 -0000 1.10
--- blades.py 14 Jan 2004 17:53:38 -0000 1.11
***************
*** 33,40 ****
item = wolfpack.finditem( args[0] )
! if not item or not item.container == char:
! char.message( "You have to have the item in your hand to use it!" )
return
!
# Corpse => Carve
# Wood => Kindling/Logs
--- 33,39 ----
item = wolfpack.finditem( args[0] )
! if not item:
return
!
# Corpse => Carve
# Wood => Kindling/Logs
***************
*** 90,94 ****
# Also allows a mace's war axe to be use. 0x13af and 0x13b0
if item.type == 1002 or item.id == 0x13af or item.id == 0x13b0:
! hack_logs( char, target.pos )
# Swords and Fencing Weapons: Get kindling
elif item.type == 1001 or item.type == 1005:
--- 89,97 ----
# Also allows a mace's war axe to be use. 0x13af and 0x13b0
if item.type == 1002 or item.id == 0x13af or item.id == 0x13b0:
! if not item or not item.container == char:
! char.message( "You must equip this item to use it on this target!" )
! return
! else:
! hack_logs( char, target.pos )
# Swords and Fencing Weapons: Get kindling
elif item.type == 1001 or item.type == 1005:
***************
*** 114,117 ****
--- 117,185 ----
return 0
+ # Delay for chopping trees and getting the logs
+ def chop_delay( time, args ):
+ char = args[0]
+ pos = args[1]
+ resource = args[2]
+ amount = args[3]
+
+ # Skill Check against LUMBERJACKING
+ if not char.checkskill( LUMBERJACKING, LUMBERJACKING_MIN_SKILL, LUMBERJACKING_MAX_SKILL ):
+ char.socket.clilocmessage( 0x7A30F, "", 0x3b2, 3, char ) # You hack at the tree for a while but fail to produce...
+ return
+
+ char.socket.clilocmessage( 0x7A312, "", 0x3b2, 3, char ) # You put some logs into your backpack
+
+ # Create an item in my pack (logs to be specific)
+ item = wolfpack.additem( "1be0" )
+ item.amount = 10
+ if not wolfpack.utilities.tobackpack( item, char ):
+ item.update()
+
+ # Create a resource item if neccesary
+ if not resource:
+ resource = wolfpack.additem( "1ea7" )
+ resource.name = 'Resource Item: logs'
+ resource.settag( 'resourcecount', str( amount - 1 ) )
+ resource.settag( 'resource', 'logs' )
+ resource.visible = 0 # GM Visible only
+ resource.moveto( pos )
+ resource.decay = 1
+ resource.decaytime = wolfpack.time.servertime() + ( LUMBERJACKING_REFILLTIME * 1000 )
+ resource.update() # Send to GMs
+ else:
+ resource.settag( 'resourcecount', amount - 1 )
+
+ return OK
+
+ # Animation Sequence
+ def chop_tree_two( time, args ):
+ char = args[0]
+ pos = args[1]
+ # Turn to our lumberjacking position
+ direction = char.directionto( pos )
+ if char.direction != direction:
+ char.direction = direction
+ char.updateflags()
+
+ # Let him hack
+ char.action( 0xd )
+ char.soundeffect( 0x13e )
+ return OK
+
+ def chop_tree_three( time, args ):
+ char = args[0]
+ pos = args[1]
+ # Turn to our lumberjacking position
+ direction = char.directionto( pos )
+ if char.direction != direction:
+ char.direction = direction
+ char.updateflags()
+
+ # Let him hack
+ char.action( 0xd )
+ char.soundeffect( 0x13e )
+ return OK
+
# HACK LOGS
def hack_logs( char, pos ):
***************
*** 132,136 ****
# Default Range for each tree is 10 to 15 Logs
! if not resource:
amount = whrandom.randint( LUMBERJACKING_MIN_LOGS, LUMBERJACKING_MAX_LOGS )
else:
--- 200,204 ----
# Default Range for each tree is 10 to 15 Logs
! if not resource:
amount = whrandom.randint( LUMBERJACKING_MIN_LOGS, LUMBERJACKING_MAX_LOGS )
else:
***************
*** 149,180 ****
# Let him hack
! char.action( 0x9 )
char.soundeffect( 0x13e )
-
- # SkillCheck against LUMBERJACKING
- if not char.checkskill( LUMBERJACKING, LUMBERJACKING_MIN_SKILL, LUMBERJACKING_MAX_SKILL ):
- char.socket.clilocmessage( 0x7A30F, "", 0x3b2, 3, char ) # You hack at the tree for a while but fail to produce...
- return
! char.socket.clilocmessage( 0x7A312, "", 0x3b2, 3, char ) # You put some logs into your backpack
!
! # Create an item in my pack (logs to be specific)
! item = wolfpack.additem( "1be0" )
! if not wolfpack.utilities.tobackpack( item, char ):
! item.update()
!
! # Create a resource item if neccesary
! if not resource:
! resource = wolfpack.additem( "1ea7" )
! resource.name = 'Resource Item: logs'
! resource.settag( 'resourcecount', str( amount - 1 ) )
! resource.settag( 'resource', 'logs' )
! resource.visible = 0 # GM Visible only
! resource.moveto( pos )
! resource.decay = 1
! resource.decaytime = wolfpack.time.servertime() + ( LUMBERJACKING_REFILLTIME * 1000 )
! resource.update() # Send to GMs
! else:
! resource.settag( 'resourcecount', amount - 1 )
# CARVE CORPSE
--- 217,227 ----
# Let him hack
! char.action( 0xd )
char.soundeffect( 0x13e )
! wolfpack.addtimer( 2000, "weapons.blades.chop_tree_two", [char, pos] )
! wolfpack.addtimer( 3500, "weapons.blades.chop_tree_three", [char, pos] )
! wolfpack.addtimer( 4000, "weapons.blades.chop_delay", [char, pos, resource, amount ] )
! return
# CARVE CORPSE
|