[wpdev-commits] xmlscripts/scripts figurine.py,1.3,1.4 potions.py,1.59,1.60
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-10-28 19:13:44
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30343 Modified Files: figurine.py potions.py Log Message: Shrink Index: potions.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/potions.py,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** potions.py 13 Oct 2004 22:38:29 -0000 1.59 --- potions.py 28 Oct 2004 19:13:17 -0000 1.60 *************** *** 1,3 **** --- 1,4 ---- + from wolfpack import tr import wolfpack import wolfpack.time *************** *** 7,15 **** from wolfpack.utilities import hex2dec, throwobject, energydamage, checkLoS from system import poison ! from wolfpack.consts import RED, ALCHEMY, STRENGTH_TIME, ANIM_FIDGET3, \ ! SOUND_DRINK1, SOUND_AGILITY_UP, AGILITY_TIME, POTION_GREATERHEAL_RANGE, \ ! POTION_HEAL_RANGE, POTION_LESSERHEAL_RANGE, MAGERY, \ ! POTION_LESSEREXPLOSION_RANGE, POTION_GREATEREXPLOSION_RANGE, \ ! POTION_EXPLOSION_RANGE, SOUND_STRENGTH_UP, HEAL_POT_DELAY --- 8,12 ---- from wolfpack.utilities import hex2dec, throwobject, energydamage, checkLoS from system import poison ! from wolfpack.consts import * *************** *** 41,45 **** 22: [ 1, 0, 0, 'Lesser Mana', 'A keg of Lesser Mana potions', 'potion_lessermana' ], # lesser mana 23: [ 1, 0, 0, 'Mana', 'A keg of Mana potions', 'potion_mana' ], # mana ! 24: [ 1, 0, 0, 'Greater Mana', 'A keg of Greater Mana potions', 'potion_greatermana' ] # greater mana } --- 38,43 ---- 22: [ 1, 0, 0, 'Lesser Mana', 'A keg of Lesser Mana potions', 'potion_lessermana' ], # lesser mana 23: [ 1, 0, 0, 'Mana', 'A keg of Mana potions', 'potion_mana' ], # mana ! 24: [ 1, 0, 0, 'Greater Mana', 'A keg of Greater Mana potions', 'potion_greatermana' ], # greater mana ! 25: [ True, False, True, 'Shrink', 'A keg of Shrink potions', 'potion_shrink' ], # shrink } *************** *** 58,62 **** socket = char.socket # Potions need to be on your body to use them, or in arms reach. ! if item.getoutmostchar() != char: char.message( "This potion is out of your reach..." ) return False --- 56,60 ---- socket = char.socket # Potions need to be on your body to use them, or in arms reach. ! if not char.canreach(item, -1): char.message( "This potion is out of your reach..." ) return False *************** *** 81,84 **** --- 79,85 ---- socket.sysmessage( 'You should throw this now!', RED ) socket.attachtarget( "potions.targetexplosionpotion", [ item ] ) + elif potiontype == 25: + socket.sysmessage( 'What do you want to shrink?' ) + socket.attachtarget( 'potions.shrinktarget', [ item.serial ] ) # We just drink this potion... *************** *** 626,629 **** --- 627,685 ---- return True + + # + # Shrink a char in range + # + def shrinktarget(player, arguments, target): + potion = wolfpack.finditem(arguments[0]) + if not potion or not player.canreach(potion, -1): + player.socket.sysmessage(tr('The shrink potion has to be in your backpack to use it.')) + return + + if not target.char: + player.socket.sysmessage(tr('You can only shrink pets owned by you.')) + return + + if not player.canreach(target.char, 1): + player.socket.clilocmessage(500312) + return + + if target.char.player: + player.socket.sysmessage(tr('You cannot shrink other players.')) + return + + if target.char.owner != player: + player.socket.sysmessage(tr("You don't own that creature.")) + return + + if target.char.id in [0x190, 0x191, 0x192, 0x193, 0x3db]: + player.socket.sysmessage(tr('You can only shrink animals and monsters!')) + return + + bodyinfo = wolfpack.bodyinfo(target.char.id) + + if bodyinfo['figurine'] <= 0 or bodyinfo['figurine'] >= 0x4000: + player.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.name = target.char.name + figurine.update() + player.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 + + consumePotion(player, potion) + # INVIS POTION # 502179 Your skin becomes extremely sensitive to light, changing to mirror the colors of things around you. Index: figurine.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/figurine.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** figurine.py 9 Jul 2004 21:47:45 -0000 1.3 --- figurine.py 28 Oct 2004 19:13:17 -0000 1.4 *************** *** 32,36 **** item.delete() ! pet.stablemaster = -1 pet.moveto(player.pos) pet.update() --- 32,40 ---- item.delete() ! pet.removescript('figurine') ! pet.owner = player ! pet.stablemaster = 0 ! pet.wandertype = 0 # Stay where you are... ! pet.direction = player.direction pet.moveto(player.pos) pet.update() |