Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv767
Modified Files:
wool.py
Log Message:
I updated this script.
1. Spinning wheels now animate.
2. 5 second delay to process the wool into yarn.
3. Can't use the spinning wheel while it spins.
Enjoy! :D
Index: wool.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wool.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** wool.py 8 Feb 2003 13:07:38 -0000 1.2
--- wool.py 14 Jan 2004 00:15:40 -0000 1.3
***************
*** 2,6 ****
# ) (\_ # WOLFPACK 13.0.0 Scripts #
# (( _/{ "-; # Created by: DarkStorm #
! # )).-' {{ ;'` # Revised by: #
# ( ( ;._ \\ ctr # Last Modification: Created #
#################################################################
--- 2,6 ----
# ) (\_ # WOLFPACK 13.0.0 Scripts #
# (( _/{ "-; # Created by: DarkStorm #
! # )).-' {{ ;'` # Revised by: Dreoth #
# ( ( ;._ \\ ctr # Last Modification: Created #
#################################################################
***************
*** 8,14 ****
# wool
import wolfpack
! import wolfpack.utilities
! ids = [ 0x10a4, 0x10a5, 0x1015, 0x1016, 0x101c, 0x101d, 0x1019, 0x101a ]
def onUse( char, item ):
--- 8,16 ----
# wool
import wolfpack
! from wolfpack.utilities import *
! from wolfpack.consts import *
! ids = [ 0x10a4, 0x1015, 0x101c, 0x1019 ]
! animids = [ 0x10a5, 0x1016, 0x101d, 0x101a ]
def onUse( char, item ):
***************
*** 16,24 ****
if item.getoutmostchar() != char:
char.socket.clilocmessage( 0x7A258 ) # You can't reach...
! return 1
char.socket.clilocmessage( 0x7AB7F ) # What spinning wheel do you wish to spin this on?
char.socket.attachtarget( "wool.response", [ item.serial ] )
! return 1
--- 18,26 ----
if item.getoutmostchar() != char:
char.socket.clilocmessage( 0x7A258 ) # You can't reach...
! return OK
char.socket.clilocmessage( 0x7AB7F ) # What spinning wheel do you wish to spin this on?
char.socket.attachtarget( "wool.response", [ item.serial ] )
! return OK
***************
*** 33,52 ****
if ( ( char.pos.x-target.pos.x )**2 + ( char.pos.y-target.pos.y )**2 > 4):
char.socket.clilocmessage( 0x7A247 ) # You are too far away to do that.
! return 1
if abs( char.pos.z - target.pos.z ) > 5:
char.socket.clilocmessage( 0x7A247 ) # You are too far away to do that.
! return 1
# Check target (only item targets valid)
if not target.item:
char.socket.clilocmessage( 0x7AB82 ) # Use that on a spinning wheel.
! return 1
if target.item.id in ids:
! # action
! # soundeffect
! char.action( 0x9 )
! char.soundeffect( 0x2c4 )
if ( item.amount > 1 ):
item.amount = item.amount -1
--- 35,51 ----
if ( ( char.pos.x-target.pos.x )**2 + ( char.pos.y-target.pos.y )**2 > 4):
char.socket.clilocmessage( 0x7A247 ) # You are too far away to do that.
! return OK
if abs( char.pos.z - target.pos.z ) > 5:
char.socket.clilocmessage( 0x7A247 ) # You are too far away to do that.
! return OK
# Check target (only item targets valid)
if not target.item:
char.socket.clilocmessage( 0x7AB82 ) # Use that on a spinning wheel.
! return OK
if target.item.id in ids:
!
if ( item.amount > 1 ):
item.amount = item.amount -1
***************
*** 55,64 ****
item.delete()
! item_new = wolfpack.additem( "e1d" )
! item_new.amount = 3
! if not wolfpack.utilities.tocontainer( item_new, char.getbackpack() ):
! item_new.update()
else:
char.socket.clilocmessage( 0x7AB82 ) # Use that on a spinning wheel.
! return
--- 54,108 ----
item.delete()
! # Spinning Wheel Animations
! if target.item.id == ids[0]:
! target.item.id = animids[0]
! target.item.update()
! elif target.item.id == ids[1]:
! target.item.id = animids[1]
! target.item.update()
! elif target.item.id == ids[2]:
! target.item.id = animids[2]
! target.item.update()
! elif target.item.id == ids[3]:
! target.item.id = animids[3]
! target.item.update()
+ wheel = wolfpack.finditem( target.item.serial )
+ processtime = 5000 # 5 Seconds
+ wolfpack.addtimer( processtime, "wool.ProcessTimer", [char, wheel] )
+
+ elif target.item.id in animids:
+ char.socket.sysmessage( 'This spinning wheel is currently in use.' )
+ return OK
+
else:
char.socket.clilocmessage( 0x7AB82 ) # Use that on a spinning wheel.
! return OK
!
! def ProcessTimer( time, args ):
! char = args[0]
! wheel = args[1]
! GetYarn( char, wheel )
! return OK
!
! def GetYarn( char, wheel ):
! # End the animations.
! if wheel.id == animids[0]:
! wheel.id = ids[0]
! wheel.update()
! elif wheel.id == animids[1]:
! wheel.id = ids[1]
! wheel.update()
! elif wheel.id == animids[2]:
! wheel.id = ids[2]
! wheel.update()
! elif wheel.id == animids[3]:
! wheel.id = ids[3]
! wheel.update()
!
! item_new = wolfpack.additem( 'e1d' ) # Yarn balls
! item_new.amount = 3
! if not wolfpack.utilities.tocontainer( item_new, char.getbackpack() ):
! item_new.update()
! char.socket.sysmessage( 'You put the yarn into your backpack.' )
! return OK
\ No newline at end of file
|