Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18281
Modified Files:
archery_butte.py bandages.py blades.py book.py
bulletinboard.py check.py cooking.py daggermenu.py door.py
environment.py figurine.py food.py gate.py guillotine.py
ingot.py key.py kindling.py lightsource.py lockpick.py
moongate.py ore.py pickaxe.py pickpocket_dip.py
Log Message:
Tweaks... looking at ways to reduce memory load.
Index: daggermenu.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/daggermenu.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** daggermenu.py 26 May 2004 13:07:19 -0000 1.8
--- daggermenu.py 9 Jul 2004 21:47:45 -0000 1.9
***************
*** 1,2 ****
--- 1,4 ----
+
+ import wolfpack
from wolfpack.gumps import cGump
Index: key.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/key.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** key.py 26 May 2004 13:07:20 -0000 1.10
--- key.py 9 Jul 2004 21:47:45 -0000 1.11
***************
*** 1,7 ****
- from wolfpack.consts import *
import wolfpack
- from wolfpack.gumps import cGump
import random
def gump_response(char, args, response):
--- 1,7 ----
import wolfpack
import random
+ from wolfpack.gumps import cGump
+ from wolfpack.consts import TINKERING
def gump_response(char, args, response):
Index: bandages.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/bandages.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** bandages.py 12 May 2004 21:46:52 -0000 1.7
--- bandages.py 9 Jul 2004 21:47:45 -0000 1.8
***************
*** 1,8 ****
import wolfpack
- from wolfpack import additem
- from wolfpack.utilities import tobackpack
- from wolfpack.consts import *
import random
def onUse( char, item ):
--- 1,8 ----
import wolfpack
import random
+ import wolfpack.utilities
+ from wolfpack.consts import HEALING, ANATOMY
+
def onUse( char, item ):
***************
*** 33,37 ****
if not bandages:
return
!
if (target.item and target.item.getoutmostchar() and target.item.getoutmostchar() != char) or not char.canreach(target.pos, 5):
char.socket.sysmessage("You can't reach that.")
--- 33,37 ----
if not bandages:
return
!
if (target.item and target.item.getoutmostchar() and target.item.getoutmostchar() != char) or not char.canreach(target.pos, 5):
char.socket.sysmessage("You can't reach that.")
***************
*** 202,206 ****
# Random Position (for now, maybe storing the original position in a tag would be good)
# Handle Weight but no Auto Stacking
! backpack.additem( item, 1, 1, 0 )
item.update()
--- 202,206 ----
# Random Position (for now, maybe storing the original position in a tag would be good)
# Handle Weight but no Auto Stacking
! backpack.wolfpack.additem( item, 1, 1, 0 )
item.update()
***************
*** 250,259 ****
# This is target independent
if baseid == 0xe21:
! item = additem( 'e20' )
! if not tobackpack( item, char ):
item.update()
elif baseid == 0xee9:
! item = additem( 'e22' )
! if not tobackpack( item, char ):
item.update()
--- 250,259 ----
# This is target independent
if baseid == 0xe21:
! item = wolfpack.additem( 'e20' )
! if not wolfpack.utilities.tobackpack( item, char ):
item.update()
elif baseid == 0xee9:
! item = wolfpack.additem( 'e22' )
! if not wolfpack.utilities.tobackpack( item, char ):
item.update()
Index: book.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/book.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** book.py 26 May 2004 13:07:19 -0000 1.10
--- book.py 9 Jul 2004 21:47:45 -0000 1.11
***************
*** 2,6 ****
import wolfpack
from wolfpack import console
! from wolfpack.consts import *
def sendPage(socket, serial, page, lines):
--- 2,6 ----
import wolfpack
from wolfpack import console
! from wolfpack.consts import LOG_ERROR
def sendPage(socket, serial, page, lines):
Index: gate.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/gate.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** gate.py 26 May 2004 13:07:19 -0000 1.6
--- gate.py 9 Jul 2004 21:47:45 -0000 1.7
***************
*** 1,7 ****
- from wolfpack.consts import *
- from wolfpack import console
- from wolfpack.gumps import *
import wolfpack
#
--- 1,7 ----
import wolfpack
+ from wolfpack.consts import LOG_ERROR
+ from wolfpack import console
+ from wolfpack.gumps import cGump
#
Index: door.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/door.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** door.py 6 Jul 2004 12:52:13 -0000 1.11
--- door.py 9 Jul 2004 21:47:45 -0000 1.12
***************
*** 9,23 ****
import wolfpack
- from wolfpack.utilities import *
# Sound constants for opening and closing a door
! SOUND_OPENWOOD = 0x00EA
! SOUND_OPENGATE = 0x00EB
! SOUND_OPENSTEEL = 0x00EC
! SOUND_OPENSECRET = 0x00ED
! SOUND_CLOSEWOOD = 0x00F1
! SOUND_CLOSEGATE = 0x00F2
! SOUND_CLOSESTEEL = 0x00F3
! SOUND_CLOSESECRET = 0x00F4
# How long does it take to close a door automatically (in ms)
--- 9,22 ----
import wolfpack
# Sound constants for opening and closing a door
! SOUND_OPENWOOD = 0xEA
! SOUND_OPENGATE = 0xEB
! SOUND_OPENSTEEL = 0xEC
! SOUND_OPENSECRET = 0xED
! SOUND_CLOSEWOOD = 0xF1
! SOUND_CLOSEGATE = 0xF2
! SOUND_CLOSESTEEL = 0xF3
! SOUND_CLOSESECRET = 0xF4
# How long does it take to close a door automatically (in ms)
Index: ingot.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/ingot.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ingot.py 26 May 2004 13:07:20 -0000 1.3
--- ingot.py 9 Jul 2004 21:47:45 -0000 1.4
***************
*** 1,3 ****
--- 1,4 ----
+ import wolfpack
from skills import mining
Index: cooking.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/cooking.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** cooking.py 26 May 2004 13:07:19 -0000 1.5
--- cooking.py 9 Jul 2004 21:47:45 -0000 1.6
***************
*** 9,13 ****
import wolfpack
import wolfpack.utilities
! from wolfpack.consts import *
import random
--- 9,13 ----
import wolfpack
import wolfpack.utilities
! from wolfpack.consts import COOKING
import random
Index: guillotine.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/guillotine.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** guillotine.py 26 May 2004 13:07:20 -0000 1.2
--- guillotine.py 9 Jul 2004 21:47:45 -0000 1.3
***************
*** 7,10 ****
--- 7,11 ----
import wolfpack
+ from wolfpack.consts import ITEMID
def onUse( char, item ):
***************
*** 16,20 ****
return 1
! if( char.checkskill( wolfpack.ITEMID, 0, 100 ) ):
# Not animated
if( item.id == 0x1230 ):
--- 17,21 ----
return 1
! if( char.checkskill( ITEMID, 0, 100 ) ):
# Not animated
if( item.id == 0x1230 ):
***************
*** 29,31 ****
item.update()
! return 1
\ No newline at end of file
--- 30,32 ----
item.update()
! return 1
Index: archery_butte.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/archery_butte.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** archery_butte.py 9 Jul 2004 10:30:25 -0000 1.9
--- archery_butte.py 9 Jul 2004 21:47:45 -0000 1.10
***************
*** 7,12 ****
import wolfpack
! from wolfpack.consts import *
! from random import choice, randrange
from combat.utilities import weaponskill
--- 7,12 ----
import wolfpack
! import random
! from wolfpack.consts import ARCHERY
from combat.utilities import weaponskill
***************
*** 134,143 ****
# 10% of destroying the ammo on failure
if( ( not char.checkskill( ARCHERY, 0, 1000 ) ) ):
! if( not randrange( 0, 9 ) ):
char.emote( "You see " + char.name + "'s poor shot destroys the " + ammoname )
else:
! char.emote( "You see " + char.name + "'s " + choice( failureText ) )
else:
! char.emote( "You see " + char.name + "'s " + choice( successText ) )
# Increase the ammo we have in the butte
--- 134,143 ----
# 10% of destroying the ammo on failure
if( ( not char.checkskill( ARCHERY, 0, 1000 ) ) ):
! if( not random.randrange( 0, 9 ) ):
char.emote( "You see " + char.name + "'s poor shot destroys the " + ammoname )
else:
! char.emote( "You see " + char.name + "'s " + random.choice( failureText ) )
else:
! char.emote( "You see " + char.name + "'s " + random.choice( successText ) )
# Increase the ammo we have in the butte
Index: lightsource.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/lightsource.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** lightsource.py 26 May 2004 13:07:20 -0000 1.6
--- lightsource.py 9 Jul 2004 21:47:45 -0000 1.7
***************
*** 8,11 ****
--- 8,13 ----
#===============================================================#
+ import wolfpack
+
# List of "burning" lightsources
burning = [ 0x9fd, 0xa02, 0xa07, 0xa0c, 0xa0f, 0xa12, 0xa15, 0xa1a, 0xa22, 0xb1a, 0xb1d, 0xb20, 0xb22, 0xb24, 0xb26, 0x142c, 0x1430, 0x1434 ]
***************
*** 95,101 ****
# This is no Light Source
else:
! return 0
! return 1
def onDropOnItem( container, item ):
--- 97,103 ----
# This is no Light Source
else:
! return False
! return True
def onDropOnItem( container, item ):
***************
*** 108,112 ****
dropper.soundeffect( 0x226, 0 )
! return 0
def onDropOnChar( char, item ):
--- 110,114 ----
dropper.soundeffect( 0x226, 0 )
! return False
def onDropOnChar( char, item ):
***************
*** 120,122 ****
dropper.soundeffect( 0x226, 0 )
! return 0
--- 122,124 ----
dropper.soundeffect( 0x226, 0 )
! return False
Index: kindling.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/kindling.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** kindling.py 26 May 2004 13:07:20 -0000 1.5
--- kindling.py 9 Jul 2004 21:47:45 -0000 1.6
***************
*** 13,17 ****
import wolfpack
import wolfpack.time
! from wolfpack.consts import *
def onUse( char, item ):
--- 13,17 ----
import wolfpack
import wolfpack.time
! from wolfpack.consts import CAMPING
def onUse( char, item ):
***************
*** 56,58 ****
item.delete()
! return 1
--- 56,58 ----
item.delete()
! return True
Index: pickpocket_dip.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/pickpocket_dip.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pickpocket_dip.py 26 May 2004 13:07:20 -0000 1.3
--- pickpocket_dip.py 9 Jul 2004 21:47:45 -0000 1.4
***************
*** 6,10 ****
#################################################################
! from wolfpack import *
# Pickpocket dips
--- 6,11 ----
#################################################################
! import wolfpack
! from wolfpack.consts import STEALING
# Pickpocket dips
***************
*** 68,72 ****
# Reset the id of a swinging dummy
def resetid( iSerial ):
! item = finditem( iSerial )
if( item ):
--- 69,73 ----
# Reset the id of a swinging dummy
def resetid( iSerial ):
! item = wolfpack.finditem( iSerial )
if( item ):
Index: environment.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/environment.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** environment.py 26 May 2004 13:07:19 -0000 1.12
--- environment.py 9 Jul 2004 21:47:45 -0000 1.13
***************
*** 2,12 ****
# like plants and oters
- from wolfpack.consts import *
- from wolfpack.utilities import tobackpack
- from wolfpack.gumps import cGump
- from math import floor
import wolfpack
import time
import random
def cotton( char, item ):
--- 2,14 ----
# like plants and oters
import wolfpack
import time
import random
+ from wolfpack.consts import COTTONPLANTS_REGROW, ANIM_ATTACK5, TINKERING, \
+ MUSICIANSHIP, LAYER_HAIR, LAYER_BEARD
+ from wolfpack.utilities import tobackpack
+ from wolfpack.gumps import cGump
+ from math import floor
+
def cotton( char, item ):
Index: bulletinboard.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/bulletinboard.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** bulletinboard.py 26 May 2004 13:07:19 -0000 1.6
--- bulletinboard.py 9 Jul 2004 21:47:45 -0000 1.7
***************
*** 1,7 ****
import wolfpack
- from wolfpack.consts import *
- from struct import unpack
import time
from math import floor
--- 1,7 ----
import wolfpack
import time
+ from wolfpack.consts import LAYER_NPCRESTOCK
+ from struct import unpack
from math import floor
Index: food.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/food.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** food.py 20 Jun 2004 20:09:54 -0000 1.5
--- food.py 9 Jul 2004 21:47:45 -0000 1.6
***************
*** 1,5 ****
import random
! from wolfpack.consts import *
from wolfpack.utilities import tobackpack
from system import poison
--- 1,5 ----
import random
! from wolfpack.consts import ANIM_FIDGET3
from wolfpack.utilities import tobackpack
from system import poison
Index: figurine.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/figurine.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** figurine.py 26 May 2004 13:07:19 -0000 1.2
--- figurine.py 9 Jul 2004 21:47:45 -0000 1.3
***************
*** 1,5 ****
import wolfpack
from wolfpack import console
! from wolfpack.consts import *
#
--- 1,5 ----
import wolfpack
from wolfpack import console
! from wolfpack.consts import SND_IDLE, ANIM_CASTDIRECTED
#
Index: lockpick.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/lockpick.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** lockpick.py 26 May 2004 13:07:20 -0000 1.3
--- lockpick.py 9 Jul 2004 21:47:45 -0000 1.4
***************
*** 1,5 ****
import wolfpack
! from wolfpack.consts import *
import random
--- 1,5 ----
import wolfpack
! from wolfpack.consts import LOCKPICKING
import random
Index: check.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/check.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** check.py 9 Jul 2004 10:30:25 -0000 1.7
--- check.py 9 Jul 2004 21:47:45 -0000 1.8
***************
*** 34,39 ****
gold.amount = min( [ value, 60000 ] )
gold.container = bankbox
-
value -= min( [ value, 60000 ] )
amount = str( value )
char.soundeffect( 0x37, 0 )
--- 34,39 ----
gold.amount = min( [ value, 60000 ] )
gold.container = bankbox
value -= min( [ value, 60000 ] )
+
amount = str( value )
char.soundeffect( 0x37, 0 )
Index: ore.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/ore.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** ore.py 2 Jul 2004 13:40:45 -0000 1.19
--- ore.py 9 Jul 2004 21:47:45 -0000 1.20
***************
*** 3,13 ****
# ~ Dreoth
- from wolfpack.consts import *
- import whrandom
import wolfpack
import skills
from skills import mining
from wolfpack.time import *
- from wolfpack.utilities import *
from random import randrange, randint
from system.lootlists import DEF_ORES # Gets BaseIDs
--- 3,13 ----
# ~ Dreoth
import wolfpack
import skills
+ import whrandom
+ import wolfpack.utilities
+ from wolfpack.consts import GRAY, MINING, SOUND_HAMMER_1
from skills import mining
from wolfpack.time import *
from random import randrange, randint
from system.lootlists import DEF_ORES # Gets BaseIDs
Index: pickaxe.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/pickaxe.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** pickaxe.py 2 Jul 2004 13:40:45 -0000 1.3
--- pickaxe.py 9 Jul 2004 21:47:45 -0000 1.4
***************
*** 6,16 ****
#################################################################
- from wolfpack.consts import *
- import whrandom
import wolfpack
import skills
! from skills.mining import *
from wolfpack.time import *
! from wolfpack.utilities import *
def onUse( char, tool ):
--- 6,16 ----
#################################################################
import wolfpack
import skills
! import whrandom
! import wolfpack.utilities
! from wolfpack.consts import GRAY, LAYER_MOUNT
from wolfpack.time import *
!
def onUse( char, tool ):
***************
*** 34,38 ****
# Is that mining tool ?
! if isminingtool( tool ):
# Where do you wish to dig?
char.socket.clilocmessage( 503033, "", GRAY)
--- 34,38 ----
# Is that mining tool ?
! if wolfpack.utilities.isminingtool( tool ):
# Where do you wish to dig?
char.socket.clilocmessage( 503033, "", GRAY)
Index: moongate.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/moongate.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** moongate.py 20 Jun 2004 13:31:09 -0000 1.11
--- moongate.py 9 Jul 2004 21:47:45 -0000 1.12
***************
*** 6,9 ****
--- 6,10 ----
#################################################################
+ import wolfpack
from wolfpack.gumps import cGump
Index: blades.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/blades.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** blades.py 7 Jul 2004 13:08:20 -0000 1.5
--- blades.py 9 Jul 2004 21:47:45 -0000 1.6
***************
*** 9,19 ****
import wolfpack
- import wolfpack.time
- from wolfpack.consts import *
- from wolfpack.utilities import *
- from skills.lumberjacking import *
- import wolfpack.utilities
- from wolfpack import settings
import whrandom
#import weapons.blades
--- 9,18 ----
import wolfpack
import whrandom
+ import skills.lumberjacking
+ from wolfpack import utilities
+ from wolfpack import settings
+ from wolfpack.consts import *
+
#import weapons.blades
***************
*** 71,84 ****
target.char.baseid = 'sheep_sheered'
target.char.update()
!
# Create Wool
wool = wolfpack.additem("df8")
wool.amount = 2
!
! if not wolfpack.utilities.tobackpack(wool, char):
wool.update()
char.socket.clilocmessage( 0x7A2E4 ) # You place the gathered wool into your backpack.
!
# Let the wool regrow (minutes)
delay = settings.getnumber('Game Speed', 'Regrow Wool Minutes', 180, 1)
--- 70,83 ----
target.char.baseid = 'sheep_sheered'
target.char.update()
!
# Create Wool
wool = wolfpack.additem("df8")
wool.amount = 2
!
! if not utilities.tobackpack(wool, char):
wool.update()
char.socket.clilocmessage( 0x7A2E4 ) # You place the gathered wool into your backpack.
!
# Let the wool regrow (minutes)
delay = settings.getnumber('Game Speed', 'Regrow Wool Minutes', 180, 1)
***************
*** 102,106 ****
treeid = target.model
! if istree(treeid):
# Axes/Polearms get Logs, Swords get kindling.
# Also allows a mace's war axe to be use. 0x13af and 0x13b0
--- 101,105 ----
treeid = target.model
! if utilities.istree(treeid):
# Axes/Polearms get Logs, Swords get kindling.
# Also allows a mace's war axe to be use. 0x13af and 0x13b0
***************
*** 141,145 ****
char.socket.clilocmessage( 0x7A305, "", 0x3b2, 3, corpse ) # You see nothing useful to carve..
return
!
if corpse.hastag('carved') or carve == '':
char.socket.clilocmessage( 0x7A305, "", 0x3b2, 3, corpse ) # You see nothing useful to carve..
--- 140,144 ----
char.socket.clilocmessage( 0x7A305, "", 0x3b2, 3, corpse ) # You see nothing useful to carve..
return
!
if corpse.hastag('carved') or carve == '':
char.socket.clilocmessage( 0x7A305, "", 0x3b2, 3, corpse ) # You see nothing useful to carve..
***************
*** 159,163 ****
item = wolfpack.additem( id )
item.amount = amount
! if not wolfpack.utilities.tocontainer( item, corpse ):
item.update()
--- 158,162 ----
item = wolfpack.additem( id )
item.amount = amount
! if not utilities.tocontainer( item, corpse ):
item.update()
***************
*** 176,180 ****
item_new = wolfpack.additem( "97a" )
item_new.amount = item.amount * 2
! if not wolfpack.utilities.tocontainer( item_new, char.getbackpack() ):
item_new.update()
item.delete()
--- 175,179 ----
item_new = wolfpack.additem( "97a" )
item_new.amount = item.amount * 2
! if not utilities.tocontainer( item_new, char.getbackpack() ):
item_new.update()
item.delete()
|