[wpdev-commits] xmlscripts/scripts figurine.py,1.4,1.5
Brought to you by:
rip,
thiagocorrea
From: Klaus M. <nad...@us...> - 2004-10-29 16:52:53
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26254/scripts Modified Files: figurine.py Log Message: implemented shrink command Index: figurine.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/figurine.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** figurine.py 28 Oct 2004 19:13:17 -0000 1.4 --- figurine.py 29 Oct 2004 16:52:30 -0000 1.5 *************** *** 1,4 **** import wolfpack ! from wolfpack import console from wolfpack.consts import SND_IDLE, ANIM_CASTDIRECTED --- 1,4 ---- import wolfpack ! from wolfpack import console, tr from wolfpack.consts import SND_IDLE, ANIM_CASTDIRECTED *************** *** 76,80 **** # def shrink(socket, command, arguments): ! pass # --- 76,116 ---- # def shrink(socket, command, arguments): ! socket.sysmessage( 'What do you want to shrink?' ) ! socket.attachtarget( 'figurine.shrinktarget', [] ) ! #pass ! ! def shrinktarget( char, args, target ): ! if not target.char: ! char.socket.sysmessage(tr('You can only shrink characters.')) ! return ! if target.char.player: ! char.socket.sysmessage(tr('You cannot shrink other players.')) ! return ! ! bodyinfo = wolfpack.bodyinfo(target.char.id) ! ! if bodyinfo['figurine'] <= 0 or bodyinfo['figurine'] >= 0x4000: ! char.socket.sysmessage(tr('You cannot shrink that.')) ! return ! ! target.char.sound(SND_IDLE) ! ! # Create a new figurine and make it newbie ! figurine = wolfpack.additem('%x' % bodyinfo['figurine']) ! figurine.newbie = True ! figurine.addscript('figurine') ! figurine.settag('pet', target.char.serial) ! figurine.color = target.char.skin ! figurine.name = target.char.name ! figurine.update() ! figurine.moveto(target.char.pos) ! #char.getbackpack().additem(figurine, True, False) # Random pos, no auto stacking ! figurine.update() ! ! target.char.removefromview() ! target.char.owner = None ! target.char.stablemaster = figurine.serial ! target.char.addscript('figurine') # This is a figurined NPC ! # |