Update of /cvsroot/wpdev/xmlscripts/scripts/skills
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32003/skills
Modified Files:
alchemy.py anatomy.py animallore.py animaltaming.py
armslore.py begging.py blacksmithing.py bowcraft.py
carpentry.py detectinghidden.py evaluatingintel.py fishing.py
healing.py hiding.py inscription.py lumberjacking.py mining.py
Log Message:
*shrug* kinda pointless, but I was looking through scripts to see what I've forgotten to do anyways...
I should finish the potionkeg script... assuming it will let me.
Index: detectinghidden.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/detectinghidden.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** detectinghidden.py 22 Feb 2004 01:05:43 -0000 1.6
--- detectinghidden.py 9 Jul 2004 10:30:26 -0000 1.7
***************
*** 27,31 ****
# only handle detect hidden
if skill != DETECTINGHIDDEN:
! return 0
if char.socket.hastag( 'skill_delay' ):
--- 27,31 ----
# only handle detect hidden
if skill != DETECTINGHIDDEN:
! return False
if char.socket.hastag( 'skill_delay' ):
***************
*** 33,37 ****
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return 1
else:
char.socket.deltag( 'skill_delay' )
--- 33,37 ----
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return True
else:
char.socket.deltag( 'skill_delay' )
***************
*** 40,44 ****
char.socket.attachtarget( "skills.detectinghidden.response" )
! return 1
def response( char, args, target ):
--- 40,44 ----
char.socket.attachtarget( "skills.detectinghidden.response" )
! return True
def response( char, args, target ):
Index: anatomy.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/anatomy.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** anatomy.py 26 May 2004 13:07:24 -0000 1.12
--- anatomy.py 9 Jul 2004 10:30:26 -0000 1.13
***************
*** 18,22 ****
# We only handle anatomy
if skill != ANATOMY:
! return 0
socket = char.socket
--- 18,22 ----
# We only handle anatomy
if skill != ANATOMY:
! return False
socket = char.socket
***************
*** 26,30 ****
if cur_time < socket.gettag( 'skill_delay' ):
socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return 1
else:
socket.deltag( 'skill_delay' )
--- 26,30 ----
if cur_time < socket.gettag( 'skill_delay' ):
socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return True
else:
socket.deltag( 'skill_delay' )
***************
*** 34,38 ****
socket.attachtarget( "skills.anatomy.response" )
! return 1
def response( char, args, target ):
--- 34,38 ----
socket.attachtarget( "skills.anatomy.response" )
! return True
def response( char, args, target ):
Index: bowcraft.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/bowcraft.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** bowcraft.py 16 May 2004 22:04:23 -0000 1.13
--- bowcraft.py 9 Jul 2004 10:30:26 -0000 1.14
***************
*** 20,29 ****
def onUse(player, item):
if not checktool(player, item):
! return 1
menu = findmenu('BOWCRAFT')
if menu:
menu.send(player, [item.serial])
! return 1
#
--- 20,29 ----
def onUse(player, item):
if not checktool(player, item):
! return True
menu = findmenu('BOWCRAFT')
if menu:
menu.send(player, [item.serial])
! return True
#
***************
*** 32,41 ****
def checktool(char, item, wearout = 0):
if not item:
! return 0
# Has to be in our posession
if item.getoutmostchar() != char:
char.socket.clilocmessage(500364)
! return 0
# We do not allow "invulnerable" tools.
--- 32,41 ----
def checktool(char, item, wearout = 0):
if not item:
! return False
# Has to be in our posession
if item.getoutmostchar() != char:
char.socket.clilocmessage(500364)
! return False
# We do not allow "invulnerable" tools.
***************
*** 43,47 ****
char.socket.clilocmessage(1044038)
item.delete()
! return 0
if wearout:
--- 43,47 ----
char.socket.clilocmessage(1044038)
item.delete()
! return False
if wearout:
***************
*** 50,58 ****
char.socket.clilocmessage(1044038)
item.delete()
! return 0
else:
item.settag('remaining_uses', uses - 1)
! return 1
#
--- 50,58 ----
char.socket.clilocmessage(1044038)
item.delete()
! return False
else:
item.settag('remaining_uses', uses - 1)
! return True
#
***************
*** 70,74 ****
def getexceptionalchance(self, player, arguments):
if not self.skills.has_key(BOWCRAFT):
! return 0
minskill = self.skills[BOWCRAFT][0]
--- 70,74 ----
def getexceptionalchance(self, player, arguments):
if not self.skills.has_key(BOWCRAFT):
! return False
minskill = self.skills[BOWCRAFT][0]
***************
*** 131,135 ****
if not checktool(player, wolfpack.finditem(arguments[0])):
! return 0
return CraftItemAction.make(self, player, arguments, nodelay)
--- 131,135 ----
if not checktool(player, wolfpack.finditem(arguments[0])):
! return False
return CraftItemAction.make(self, player, arguments, nodelay)
Index: evaluatingintel.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/evaluatingintel.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** evaluatingintel.py 26 May 2004 13:07:25 -0000 1.9
--- evaluatingintel.py 9 Jul 2004 10:30:26 -0000 1.10
***************
*** 17,21 ****
#Only Handle Evalint
if skill != EVALUATINGINTEL:
! return 0
if char.socket.hastag( 'skill_delay' ):
--- 17,21 ----
#Only Handle Evalint
if skill != EVALUATINGINTEL:
! return False
if char.socket.hastag( 'skill_delay' ):
***************
*** 23,27 ****
if cur_time < char.socket.gettag( 'skill_delay' ):
socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return 1
else:
char.socket.deltag( 'skill_delay' )
--- 23,27 ----
if cur_time < char.socket.gettag( 'skill_delay' ):
socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return True
else:
char.socket.deltag( 'skill_delay' )
***************
*** 29,33 ****
char.socket.clilocmessage( 0x7A4AA, "", 0x3b2, 3 ) # What would you like to evaluate
char.socket.attachtarget( "skills.evaluatingintel.response" )
! return 1
def response( char, args, target ):
--- 29,33 ----
char.socket.clilocmessage( 0x7A4AA, "", 0x3b2, 3 ) # What would you like to evaluate
char.socket.attachtarget( "skills.evaluatingintel.response" )
! return True
def response( char, args, target ):
***************
*** 36,44 ****
# It looks smarter than a rock, but dumber than a piece of wood
char.socket.clilocmessage( 0x7A4AC, "", 0x3b2, 3, target.item )
! return 0
if not char.canreach( target.char, 8 ):
# No Cliloc when failing LoS or Distance Check
! return 0
# Vendors: 0x7A4AD That person could probably calculate the cost of what you buy from them.
--- 36,44 ----
# It looks smarter than a rock, but dumber than a piece of wood
char.socket.clilocmessage( 0x7A4AC, "", 0x3b2, 3, target.item )
! return False
if not char.canreach( target.char, 8 ):
# No Cliloc when failing LoS or Distance Check
! return False
# Vendors: 0x7A4AD That person could probably calculate the cost of what you buy from them.
***************
*** 48,52 ****
# Hmm, that person looks really silly.
char.socket.clilocmessage( 0x7A4AE, "", 0x3b2, 3, target.char )
! return 0
cur_time = servertime()
--- 48,52 ----
# Hmm, that person looks really silly.
char.socket.clilocmessage( 0x7A4AE, "", 0x3b2, 3, target.char )
! return False
cur_time = servertime()
***************
*** 55,59 ****
if not char.checkskill( EVALUATINGINTEL, 0, 1000 ):
char.socket.clilocmessage( 0xFD756, "", 0x3b2, 3, target.char )
! return 0
IntRatio = float( 100.0 / target.char.intelligence )
--- 55,59 ----
if not char.checkskill( EVALUATINGINTEL, 0, 1000 ):
char.socket.clilocmessage( 0xFD756, "", 0x3b2, 3, target.char )
! return False
IntRatio = float( 100.0 / target.char.intelligence )
***************
*** 72,76 ****
char.socket.clilocmessage( msgId, "", 0x3b2, 3, target.char )
char.socket.clilocmessage( msgId2, "", 0x3b2, 3, target.char )
! return 1
def onLoad():
--- 72,76 ----
char.socket.clilocmessage( msgId, "", 0x3b2, 3, target.char )
char.socket.clilocmessage( msgId2, "", 0x3b2, 3, target.char )
! return True
def onLoad():
Index: begging.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/begging.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** begging.py 26 May 2004 13:07:24 -0000 1.12
--- begging.py 9 Jul 2004 10:30:26 -0000 1.13
***************
*** 27,31 ****
def begging( char, skill ):
if skill != BEGGING:
! return 0
if char.socket.hastag( 'skill_delay' ):
--- 27,31 ----
def begging( char, skill ):
if skill != BEGGING:
! return False
if char.socket.hastag( 'skill_delay' ):
***************
*** 33,37 ****
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return 1
else:
char.socket.deltag( 'skill_delay' )
--- 33,37 ----
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return True
else:
char.socket.deltag( 'skill_delay' )
***************
*** 42,46 ****
char.socket.attachtarget( "skills.begging.response" )
! return 1
def response( char, args, target ):
--- 42,46 ----
char.socket.attachtarget( "skills.begging.response" )
! return True
def response( char, args, target ):
***************
*** 103,105 ****
def onLoad():
! skills.register( BEGGING, begging )
\ No newline at end of file
--- 103,105 ----
def onLoad():
! skills.register( BEGGING, begging )
Index: lumberjacking.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/lumberjacking.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** lumberjacking.py 2 Jul 2004 13:40:46 -0000 1.13
--- lumberjacking.py 9 Jul 2004 10:30:26 -0000 1.14
***************
*** 1,7 ****
- from wolfpack.consts import *
- import whrandom
import wolfpack
import skills
from wolfpack.time import *
from wolfpack.utilities import *
--- 1,7 ----
import wolfpack
+ import whrandom
import skills
+ from wolfpack.consts import *
from wolfpack.time import *
from wolfpack.utilities import *
***************
*** 267,269 ****
else:
return False
-
--- 267,268 ----
Index: carpentry.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/carpentry.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** carpentry.py 16 May 2004 22:04:23 -0000 1.17
--- carpentry.py 9 Jul 2004 10:30:26 -0000 1.18
***************
*** 14,23 ****
def checktool(char, item, wearout = 0):
if not item:
! return 0
# Has to be in our posession
if item.getoutmostchar() != char:
char.socket.clilocmessage(500364)
! return 0
# We do not allow "invulnerable" tools.
--- 14,23 ----
def checktool(char, item, wearout = 0):
if not item:
! return False
# Has to be in our posession
if item.getoutmostchar() != char:
char.socket.clilocmessage(500364)
! return False
# We do not allow "invulnerable" tools.
***************
*** 25,29 ****
char.socket.clilocmessage(1044038)
item.delete()
! return 0
if wearout:
--- 25,29 ----
char.socket.clilocmessage(1044038)
item.delete()
! return False
if wearout:
***************
*** 32,40 ****
char.socket.clilocmessage(1044038)
item.delete()
! return 0
else:
item.settag('remaining_uses', uses - 1)
! return 1
#
--- 32,40 ----
char.socket.clilocmessage(1044038)
item.delete()
! return False
else:
item.settag('remaining_uses', uses - 1)
! return True
#
***************
*** 43,52 ****
def onUse(char, item):
if not checktool(char, item):
! return 1
menu = findmenu('CARPENTRY')
if menu:
menu.send(char, [item.serial])
! return 1
#
--- 43,52 ----
def onUse(char, item):
if not checktool(char, item):
! return True
menu = findmenu('CARPENTRY')
if menu:
menu.send(char, [item.serial])
! return True
#
***************
*** 65,69 ****
# Only works if this item requires carpentry
if not self.skills.has_key(CARPENTRY):
! return 0
minskill = self.skills[CARPENTRY][0]
--- 65,69 ----
# Only works if this item requires carpentry
if not self.skills.has_key(CARPENTRY):
! return False
minskill = self.skills[CARPENTRY][0]
***************
*** 125,129 ****
if not checktool(player, wolfpack.finditem(arguments[0])):
! return 0
return CraftItemAction.make(self, player, arguments, nodelay)
--- 125,129 ----
if not checktool(player, wolfpack.finditem(arguments[0])):
! return False
return CraftItemAction.make(self, player, arguments, nodelay)
***************
*** 154,158 ****
def getsubmaterial1used(self, player, arguments):
if not player.hastag('blacksmithing_ore'):
! return 0
else:
material = int(player.gettag('blacksmithing_ore'))
--- 154,158 ----
def getsubmaterial1used(self, player, arguments):
if not player.hastag('blacksmithing_ore'):
! return False
else:
material = int(player.gettag('blacksmithing_ore'))
***************
*** 160,164 ****
return material
else:
! return 0
#
--- 160,164 ----
return material
else:
! return False
#
Index: fishing.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/fishing.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** fishing.py 18 May 2004 02:47:31 -0000 1.6
--- fishing.py 9 Jul 2004 10:30:26 -0000 1.7
***************
*** 36,45 ****
if char.itemonlayer( LAYER_MOUNT ):
socket.clilocmessage( 0x7A4EB, "", 0x3b2, 3 ) # You can't fish while riding!
! return 1
# Are we already fishing?
if socket.hastag( 'is_fishing' ) and socket.gettag( 'is_fishing' ) > wolfpack.time.servertime():
socket.clilocmessage( 0x7A4EC, "", 0x3b2, 3 ) # You are already fishing.
! return 1
iserial = item.serial
--- 36,45 ----
if char.itemonlayer( LAYER_MOUNT ):
socket.clilocmessage( 0x7A4EB, "", 0x3b2, 3 ) # You can't fish while riding!
! return True
# Are we already fishing?
if socket.hastag( 'is_fishing' ) and socket.gettag( 'is_fishing' ) > wolfpack.time.servertime():
socket.clilocmessage( 0x7A4EC, "", 0x3b2, 3 ) # You are already fishing.
! return True
iserial = item.serial
***************
*** 49,60 ****
if hand1 and hand1.serial != item.serial:
socket.clilocmessage( 502641, "", 0x3b2, 3 ) # Must equip this item to use it!
! return 1
elif hand2 and hand2.serial != item.serial:
socket.clilocmessage( 502641, "", 0x3b2, 3 ) # Must equip this item to use it!
! return 1
else:
socket.clilocmessage( 0x7A4EE, "", 0x3b2, 3 ) # What water do you want to fish in?
socket.attachtarget( "skills.fishing.response" )
! return 1
def response( char, args, target ):
--- 49,60 ----
if hand1 and hand1.serial != item.serial:
socket.clilocmessage( 502641, "", 0x3b2, 3 ) # Must equip this item to use it!
! return True
elif hand2 and hand2.serial != item.serial:
socket.clilocmessage( 502641, "", 0x3b2, 3 ) # Must equip this item to use it!
! return True
else:
socket.clilocmessage( 0x7A4EE, "", 0x3b2, 3 ) # What water do you want to fish in?
socket.attachtarget( "skills.fishing.response" )
! return True
def response( char, args, target ):
Index: armslore.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/armslore.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** armslore.py 22 Jun 2004 12:05:30 -0000 1.11
--- armslore.py 9 Jul 2004 10:30:26 -0000 1.12
***************
*** 20,24 ****
# only handle armslore
if skill != ARMSLORE:
! return 0
if char.socket.hastag( 'skill_delay' ):
--- 20,24 ----
# only handle armslore
if skill != ARMSLORE:
! return False
if char.socket.hastag( 'skill_delay' ):
***************
*** 26,30 ****
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return 1
else:
char.socket.deltag( 'skill_delay' )
--- 26,30 ----
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return True
else:
char.socket.deltag( 'skill_delay' )
***************
*** 33,37 ****
char.socket.attachtarget( "skills.armslore.response" )
! return 1
def response( char, args, target ):
--- 33,37 ----
char.socket.attachtarget( "skills.armslore.response" )
! return True
def response( char, args, target ):
***************
*** 44,52 ****
if not char.canreach( item, 4 ):
char.socket.clilocmessage( 0x7A27F, "", 0x3b2, 3 )
! return 0
if not char.distanceto( item ) < 5:
char.socket.clilocmessage( 0x7A27E, "", 0x3b2, 3 )
! return 0
if isweapon( item ) or isarmor( item ) or isshield( item ):
--- 44,52 ----
if not char.canreach( item, 4 ):
char.socket.clilocmessage( 0x7A27F, "", 0x3b2, 3 )
! return False
if not char.distanceto( item ) < 5:
char.socket.clilocmessage( 0x7A27E, "", 0x3b2, 3 )
! return False
if isweapon( item ) or isarmor( item ) or isshield( item ):
***************
*** 55,59 ****
if not char.checkskill( ARMSLORE, 0, 1000 ):
char.socket.clilocmessage( 0x7A281, "", 0x3b2, 3 )
! return 0
char.socket.clilocmessage( 0x103319, "", 0x3b2, 3 )
--- 55,59 ----
if not char.checkskill( ARMSLORE, 0, 1000 ):
char.socket.clilocmessage( 0x7A281, "", 0x3b2, 3 )
! return False
char.socket.clilocmessage( 0x103319, "", 0x3b2, 3 )
***************
*** 93,112 ****
arm_id = max( 0, min( int( armor / 5 ), 7 ) )
char.socket.clilocmessage( 1038295 + arm_id )
! return 1
else:
char.socket.clilocmessage( 0x7A280, "", 0x3b2, 3 )
! return 0
else:
if not char.canreach( target.char, 4 ):
char.socket.clilocmessage( 0x7A27F, "", 0x3b2, 3 )
! return 0
if not char.distanceto ( target.char ) < 5:
char.socket.clilocmessage( 0x7A27E, "", 0x3b2, 3 )
! return 0
char.socket.clilocmessage( 0x7A280, "", 0x3b2, 3 )
! return 0
def onLoad():
--- 93,112 ----
arm_id = max( 0, min( int( armor / 5 ), 7 ) )
char.socket.clilocmessage( 1038295 + arm_id )
! return True
else:
char.socket.clilocmessage( 0x7A280, "", 0x3b2, 3 )
! return False
else:
if not char.canreach( target.char, 4 ):
char.socket.clilocmessage( 0x7A27F, "", 0x3b2, 3 )
! return False
if not char.distanceto ( target.char ) < 5:
char.socket.clilocmessage( 0x7A27E, "", 0x3b2, 3 )
! return False
char.socket.clilocmessage( 0x7A280, "", 0x3b2, 3 )
! return False
def onLoad():
Index: blacksmithing.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/blacksmithing.py,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** blacksmithing.py 26 May 2004 13:07:24 -0000 1.19
--- blacksmithing.py 9 Jul 2004 10:30:26 -0000 1.20
***************
*** 58,64 ****
if anvil and forge:
! return 1
! return 0
#
--- 58,64 ----
if anvil and forge:
! return True
! return False
#
***************
*** 67,76 ****
def checktool(char, item, wearout = 0):
if not item:
! return 0
# Has to be in our posession
if item.getoutmostchar() != char:
char.socket.clilocmessage(500364)
! return 0
# We do not allow "invulnerable" tools.
--- 67,76 ----
def checktool(char, item, wearout = 0):
if not item:
! return False
# Has to be in our posession
if item.getoutmostchar() != char:
char.socket.clilocmessage(500364)
! return False
# We do not allow "invulnerable" tools.
***************
*** 78,82 ****
char.socket.clilocmessage(1044038)
item.delete()
! return 0
# See if we have another tool equipped
--- 78,82 ----
char.socket.clilocmessage(1044038)
item.delete()
! return False
# See if we have another tool equipped
***************
*** 84,88 ****
if equipped and equipped != item:
char.socket.clilocmessage(1048146)
! return 0
if wearout:
--- 84,88 ----
if equipped and equipped != item:
char.socket.clilocmessage(1048146)
! return False
if wearout:
***************
*** 91,99 ****
char.socket.clilocmessage(1044038)
item.delete()
! return 0
else:
item.settag('remaining_uses', uses - 1)
! return 1
#
--- 91,99 ----
char.socket.clilocmessage(1044038)
item.delete()
! return False
else:
item.settag('remaining_uses', uses - 1)
! return True
#
***************
*** 102,115 ****
def onUse(char, item):
if not checktool(char, item):
! return 1
if not checkanvilandforge(char):
char.socket.clilocmessage(1044267)
! return 1
menu = findmenu('BLACKSMITHING')
if menu:
menu.send(char, [item.serial])
! return 1
#
--- 102,115 ----
def onUse(char, item):
if not checktool(char, item):
! return True
if not checkanvilandforge(char):
char.socket.clilocmessage(1044267)
! return True
menu = findmenu('BLACKSMITHING')
if menu:
menu.send(char, [item.serial])
! return True
#
***************
*** 128,132 ****
# Only works if this item requires blacksmithing
if not self.skills.has_key(BLACKSMITHING):
! return 0
minskill = self.skills[BLACKSMITHING][0]
--- 128,132 ----
# Only works if this item requires blacksmithing
if not self.skills.has_key(BLACKSMITHING):
! return False
minskill = self.skills[BLACKSMITHING][0]
***************
*** 217,224 ****
if not checkanvilandforge(player):
player.socket.clilocmessage(1044267)
! return 0
if not checktool(player, wolfpack.finditem(arguments[0])):
! return 0
return CraftItemAction.make(self, player, arguments, nodelay)
--- 217,224 ----
if not checkanvilandforge(player):
player.socket.clilocmessage(1044267)
! return False
if not checktool(player, wolfpack.finditem(arguments[0])):
! return False
return CraftItemAction.make(self, player, arguments, nodelay)
***************
*** 388,392 ****
def getsubmaterial1used(self, player, arguments):
if not player.hastag('blacksmithing_ore'):
! return 0
else:
material = int(player.gettag('blacksmithing_ore'))
--- 388,392 ----
def getsubmaterial1used(self, player, arguments):
if not player.hastag('blacksmithing_ore'):
! return False
else:
material = int(player.gettag('blacksmithing_ore'))
***************
*** 394,398 ****
return material
else:
! return 0
#
--- 394,398 ----
return material
else:
! return False
#
***************
*** 401,405 ****
def getsubmaterial2used(self, player, arguments):
if not player.hastag('blacksmithing_scales'):
! return 0
else:
material = int(player.gettag('blacksmithing_scales'))
--- 401,405 ----
def getsubmaterial2used(self, player, arguments):
if not player.hastag('blacksmithing_scales'):
! return False
else:
material = int(player.gettag('blacksmithing_scales'))
***************
*** 407,411 ****
return material
else:
! return 0
#
--- 407,411 ----
return material
else:
! return False
#
Index: hiding.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/hiding.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** hiding.py 26 May 2004 13:07:25 -0000 1.9
--- hiding.py 9 Jul 2004 10:30:26 -0000 1.10
***************
*** 16,20 ****
def hiding( char, skill ):
if skill != HIDING:
! return 0
if char.socket.hastag( 'skill_delay' ):
--- 16,20 ----
def hiding( char, skill ):
if skill != HIDING:
! return False
if char.socket.hastag( 'skill_delay' ):
***************
*** 22,26 ****
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return 1
else:
char.socket.deltag( 'skill_delay' )
--- 22,26 ----
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return True
else:
char.socket.deltag( 'skill_delay' )
***************
*** 39,43 ****
char.socket.settag( 'skill_delay', cur_time + HIDING_DELAY )
! return 1
def onLoad():
--- 39,43 ----
char.socket.settag( 'skill_delay', cur_time + HIDING_DELAY )
! return True
def onLoad():
Index: mining.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/mining.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -d -r1.30 -r1.31
*** mining.py 29 May 2004 01:45:31 -0000 1.30
--- mining.py 9 Jul 2004 10:30:26 -0000 1.31
***************
*** 6,16 ****
#################################################################
- from wolfpack.consts import *
- from wolfpack import console
import wolfpack
import skills
from wolfpack.time import *
from wolfpack.utilities import ismountainorcave, tobackpack
! import random
#mining calling from pickaxe.py and shovel.py
--- 6,17 ----
#################################################################
import wolfpack
import skills
+ import random
+ from wolfpack.consts import *
from wolfpack.time import *
+ from wolfpack import console
from wolfpack.utilities import ismountainorcave, tobackpack
!
#mining calling from pickaxe.py and shovel.py
***************
*** 47,51 ****
char.turnto( pos )
char.action( ANIM_ATTACK3 )
! return 1
def createoregem(pos):
--- 48,52 ----
char.turnto( pos )
char.action( ANIM_ATTACK3 )
! return True
def createoregem(pos):
***************
*** 91,95 ****
socket = char.socket
if not socket:
! return 0
pos = target.pos
--- 92,96 ----
socket = char.socket
if not socket:
! return False
pos = target.pos
***************
*** 99,103 ****
# That is too far away
socket.clilocmessage( 500446, "", GRAY )
! return 1
tool = args[0]
--- 100,104 ----
# That is too far away
socket.clilocmessage( 500446, "", GRAY )
! return True
tool = args[0]
***************
*** 108,112 ****
# You can't mine that.
socket.clilocmessage( 501863, "", GRAY )
! return 1
#Find tile by it's position if we haven't model
--- 109,113 ----
# You can't mine that.
socket.clilocmessage( 501863, "", GRAY )
! return True
#Find tile by it's position if we haven't model
***************
*** 118,122 ****
# You can't mine there.
socket.clilocmessage( 501862, "", GRAY )
! return 1
#Find tile by it's model
--- 119,123 ----
# You can't mine there.
socket.clilocmessage( 501862, "", GRAY )
! return True
#Find tile by it's model
***************
*** 127,136 ****
else:
socket.clilocmessage( 501862, "", GRAY ) # You can't mine there.
! return 1
else:
! return 0
! return 1
#Sound effect
--- 128,137 ----
else:
socket.clilocmessage( 501862, "", GRAY ) # You can't mine there.
! return True
else:
! return False
! return True
#Sound effect
***************
*** 146,155 ****
#if not char.canreach(pos, MINING_MAX_DISTANCE):
# socket.clilocmessage(501867)
! # return 0
veingem = getvein(socket, pos)
if not veingem or not veingem.hastag('resourcecount'):
! return 0
# 50% chance to dig up primary resource,
--- 147,156 ----
#if not char.canreach(pos, MINING_MAX_DISTANCE):
# socket.clilocmessage(501867)
! # return False
veingem = getvein(socket, pos)
if not veingem or not veingem.hastag('resourcecount'):
! return False
# 50% chance to dig up primary resource,
***************
*** 171,180 ****
wolfpack.addtimer(duration, "skills.mining.respawnvein", [veingem], 1)
veingem.settag('resource_empty', 1)
! return 0
# You loosen some rocks but fail to find any usable ore.
if char.skill < reqskill:
socket.clilocmessage(501869)
! return 0
chance = max(0, char.skill[MINING] - ORES[resname][MINSKILL]) / 1000.0
--- 172,181 ----
wolfpack.addtimer(duration, "skills.mining.respawnvein", [veingem], 1)
veingem.settag('resource_empty', 1)
! return False
# You loosen some rocks but fail to find any usable ore.
if char.skill < reqskill:
socket.clilocmessage(501869)
! return False
chance = max(0, char.skill[MINING] - ORES[resname][MINSKILL]) / 1000.0
***************
*** 183,187 ****
if not skills.checkskill(char, MINING, chance):
socket.clilocmessage(501869)
! return 0
# Digs up the large ore.
--- 184,188 ----
if not skills.checkskill(char, MINING, chance):
socket.clilocmessage(501869)
! return False
# Digs up the large ore.
***************
*** 209,213 ****
socket.clilocmessage(1044038) # You have worn out your tool!
! return 1
def successmining(char, gem, resname, size):
--- 210,214 ----
socket.clilocmessage(1044038) # You have worn out your tool!
! return True
def successmining(char, gem, resname, size):
***************
*** 248,252 ****
else:
char.socket.sysmessage(unicode(message))
! return 1
def respawnvein( time, args ):
--- 249,253 ----
else:
char.socket.sysmessage(unicode(message))
! return True
def respawnvein( time, args ):
***************
*** 255,257 ****
vein.settag('resourcecount', random.randint(MINING_ORE[0], MINING_ORE[1]))
vein.deltag('resource_empty')
! return 1
--- 256,258 ----
vein.settag('resourcecount', random.randint(MINING_ORE[0], MINING_ORE[1]))
vein.deltag('resource_empty')
! return True
Index: inscription.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/inscription.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** inscription.py 4 Jul 2004 12:44:05 -0000 1.5
--- inscription.py 9 Jul 2004 10:30:26 -0000 1.6
***************
*** 19,31 ****
def checktool(char, item, wearout=0):
if not item:
! return 0
if item.getoutmostchar() != char:
char.socket.clilocmessage(500364)
! return 0
# use this for a Siege-style shard
#if not item.hastag('remaining_uses'):
# char.socket.clilocmessage(1044038)
# item.delete()
! # return 0
#if wearout:
# uses = int(item.gettag('remaining_uses'))
--- 19,31 ----
def checktool(char, item, wearout=0):
if not item:
! return False
if item.getoutmostchar() != char:
char.socket.clilocmessage(500364)
! return False
# use this for a Siege-style shard
#if not item.hastag('remaining_uses'):
# char.socket.clilocmessage(1044038)
# item.delete()
! # return False
#if wearout:
# uses = int(item.gettag('remaining_uses'))
***************
*** 33,57 ****
# char.socket.clilocmessage(1044038)
# item.delete()
! # return 0
# else:
# item.settag('remaining_uses', uses - 1)
! return 1
# skill is used via the blue button on skill gump - copy a book
def inscription(char, skill):
if skill != INSCRIPTION:
! return 0
char.socket.sysmessage("copying a book is not implemented yet")
! return 1
# skill is used via a scribe's pen
def onUse(char, item):
#if not checktool(char, item):
! # return 1
# send makemenu
menu = findmenu('INSCRIPTION')
if menu:
menu.send(char, [item.serial])
! return 1
class InscriptionMenu(CraftMenu):
--- 33,57 ----
# char.socket.clilocmessage(1044038)
# item.delete()
! # return False
# else:
# item.settag('remaining_uses', uses - 1)
! return True
# skill is used via the blue button on skill gump - copy a book
def inscription(char, skill):
if skill != INSCRIPTION:
! return False
char.socket.sysmessage("copying a book is not implemented yet")
! return True
# skill is used via a scribe's pen
def onUse(char, item):
#if not checktool(char, item):
! # return True
# send makemenu
menu = findmenu('INSCRIPTION')
if menu:
menu.send(char, [item.serial])
! return True
class InscriptionMenu(CraftMenu):
***************
*** 61,65 ****
self.allowrepair = 0
self.gumptype = 0xce123456
!
def loadMenu( id, parent = None ):
definition = wolfpack.getdefinition(WPDT_MENU, id)
--- 61,65 ----
self.allowrepair = 0
self.gumptype = 0xce123456
!
def loadMenu( id, parent = None ):
definition = wolfpack.getdefinition(WPDT_MENU, id)
***************
*** 132,139 ****
# FIXME : exceptional / success chance
def getexceptionalchance(self, player, args):
! return 0
def getsuccesschance(self, player, args):
! return 0
def checkmaterial(self, player, args, silent=0):
--- 132,139 ----
# FIXME : exceptional / success chance
def getexceptionalchance(self, player, args):
! return False
def getsuccesschance(self, player, args):
! return False
def checkmaterial(self, player, args, silent=0):
***************
*** 151,160 ****
# recall rune
#elif '1f14' in baseids or '1f15' in baseids or '1f16' in baseids or '1f17' in baseids:
! return 0
! return 1
def make(self, player, args, nodelay=0):
if not checktool(player, wolfpack.finditem(args[0]), 0):
! return 0
# spell scrolls
# FIXME : spell no. is not correct
--- 151,160 ----
# recall rune
#elif '1f14' in baseids or '1f15' in baseids or '1f16' in baseids or '1f17' in baseids:
! return False
! return True
def make(self, player, args, nodelay=0):
if not checktool(player, wolfpack.finditem(args[0]), 0):
! return False
# spell scrolls
# FIXME : spell no. is not correct
***************
*** 171,175 ****
self.parent.send(player, args)
player.socket.sysmessage(self.noticestr)
! return 0
if player.mana < self.mana:
player.socket.clilocmessage(1044380)
--- 171,175 ----
self.parent.send(player, args)
player.socket.sysmessage(self.noticestr)
! return False
if player.mana < self.mana:
player.socket.clilocmessage(1044380)
***************
*** 177,181 ****
self.noticestr = ''
self.parent.send(player, args)
! return 0
if player.socket.hastag('craftmenu_crafting'):
player.socket.clilocmessage(500119)
--- 177,181 ----
self.noticestr = ''
self.parent.send(player, args)
! return False
if player.socket.hastag('craftmenu_crafting'):
player.socket.clilocmessage(500119)
***************
*** 183,190 ****
self.noticestr = ''
self.parent.send(player, args)
! return 0
if not self.checkmaterial(player, args):
self.parent.send(player, args)
! return 0
player.mana = player.mana - self.mana
self.consumematerial(player, args, 0)
--- 183,190 ----
self.noticestr = ''
self.parent.send(player, args)
! return False
if not self.checkmaterial(player, args):
self.parent.send(player, args)
! return False
player.mana = player.mana - self.mana
self.consumematerial(player, args, 0)
***************
*** 206,210 ****
self.noticestr = 'Not implemented yet'
self.parent.send(player, args)
! return 0
def onLoad():
--- 206,210 ----
self.noticestr = 'Not implemented yet'
self.parent.send(player, args)
! return False
def onLoad():
Index: animaltaming.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/animaltaming.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** animaltaming.py 2 Jun 2004 15:03:05 -0000 1.14
--- animaltaming.py 9 Jul 2004 10:30:26 -0000 1.15
***************
*** 31,35 ****
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return 1
else:
char.socket.deltag( 'skill_delay' )
--- 31,35 ----
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return True
else:
char.socket.deltag( 'skill_delay' )
***************
*** 38,46 ****
char.socket.clilocmessage( 502789, "", 0x3b2, 3 )
char.socket.attachtarget("skills.animaltaming.response")
! return 1
def response(char, args, target):
dotame(char, target.char)
! return 1
def dotame(char, totame):
--- 38,46 ----
char.socket.clilocmessage( 502789, "", 0x3b2, 3 )
char.socket.attachtarget("skills.animaltaming.response")
! return True
def response(char, args, target):
dotame(char, target.char)
! return True
def dotame(char, totame):
Index: healing.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/healing.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** healing.py 26 May 2004 13:07:25 -0000 1.3
--- healing.py 9 Jul 2004 10:30:26 -0000 1.4
***************
*** 43,57 ****
char.socket.clilocmessage( 500948, "", 0x3b2, 3 )
char.socket.attachtarget( "skills.healing.response" )
! return 1
def response( char, args, target ):
if not target.char:
char.socket.clilocmessage( 500970, "", 0x3b2, 3 )
! return 1
# will be added : a golem would not healed by bandages
# count bandage
if not char.countresource( 0x0e21 ):
! return 1
anatomy = char.skill[ ANATOMY ]
--- 43,57 ----
char.socket.clilocmessage( 500948, "", 0x3b2, 3 )
char.socket.attachtarget( "skills.healing.response" )
! return True
def response( char, args, target ):
if not target.char:
char.socket.clilocmessage( 500970, "", 0x3b2, 3 )
! return True
# will be added : a golem would not healed by bandages
# count bandage
if not char.countresource( 0x0e21 ):
! return True
anatomy = char.skill[ ANATOMY ]
***************
*** 63,72 ****
if char == target.char:
#char.socket.clilocmessage()
! return 1
if healing >= RES_HEALING and anatomy >= RES_ANATOMY:
res_char( char, target.char, healing, anatomy )
else:
char.socket.clilocmessage( 1049656, "", 0x3b2, 3 )
! return 1
if target.char.poisoned:
if healing >= CURE_HEALING and anatomy >= CURE_ANATOMY:
--- 63,72 ----
if char == target.char:
#char.socket.clilocmessage()
! return True
if healing >= RES_HEALING and anatomy >= RES_ANATOMY:
res_char( char, target.char, healing, anatomy )
else:
char.socket.clilocmessage( 1049656, "", 0x3b2, 3 )
! return True
if target.char.poisoned:
if healing >= CURE_HEALING and anatomy >= CURE_ANATOMY:
***************
*** 74,78 ****
#else:
#char.socket.clilocmessage()
! return 1
# calc total heal amount : used formula from UOSS
--- 74,78 ----
#else:
#char.socket.clilocmessage()
! return True
# calc total heal amount : used formula from UOSS
Index: alchemy.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/alchemy.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** alchemy.py 26 May 2004 13:07:24 -0000 1.4
--- alchemy.py 9 Jul 2004 10:30:25 -0000 1.5
***************
*** 14,23 ****
def checktool(char, item, wearout = 0):
if not item:
! return 0
# Has to be in our posession
if item.getoutmostchar() != char:
char.socket.clilocmessage(1044263)
! return 0
# We do not allow "invulnerable" tools.
--- 14,23 ----
def checktool(char, item, wearout = 0):
if not item:
! return False
# Has to be in our posession
if item.getoutmostchar() != char:
char.socket.clilocmessage(1044263)
! return False
# We do not allow "invulnerable" tools.
***************
*** 25,29 ****
char.socket.clilocmessage(1044038)
item.delete()
! return 0
if wearout:
--- 25,29 ----
char.socket.clilocmessage(1044038)
item.delete()
! return False
if wearout:
***************
*** 32,40 ****
char.socket.clilocmessage(1044038)
item.delete()
! return 0
else:
item.settag('remaining_uses', uses - 1)
! return 1
#
--- 32,40 ----
char.socket.clilocmessage(1044038)
item.delete()
! return False
else:
item.settag('remaining_uses', uses - 1)
! return True
#
***************
*** 43,52 ****
def onUse(char, item):
if not checktool(char, item):
! return 1
menu = findmenu('ALCHEMY')
if menu:
menu.send(char, [item.serial])
! return 1
#
--- 43,52 ----
def onUse(char, item):
if not checktool(char, item):
! return True
menu = findmenu('ALCHEMY')
if menu:
menu.send(char, [item.serial])
! return True
#
***************
*** 63,67 ****
#
def getexceptionalchance(self, player, arguments):
! return 0
#
--- 63,67 ----
#
def getexceptionalchance(self, player, arguments):
! return False
#
***************
*** 98,102 ****
if not checktool(player, wolfpack.finditem(arguments[0])):
! return 0
return CraftItemAction.make(self, player, arguments, nodelay)
--- 98,102 ----
if not checktool(player, wolfpack.finditem(arguments[0])):
! return False
return CraftItemAction.make(self, player, arguments, nodelay)
Index: animallore.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/animallore.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** animallore.py 30 May 2004 13:22:41 -0000 1.17
--- animallore.py 9 Jul 2004 10:30:26 -0000 1.18
***************
*** 16,20 ****
def animallore( char, skill ):
if skill != ANIMALLORE:
! return 0
if char.socket.hastag( 'skill_delay' ):
--- 16,20 ----
def animallore( char, skill ):
if skill != ANIMALLORE:
! return False
if char.socket.hastag( 'skill_delay' ):
***************
*** 22,26 ****
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return 1
else:
char.socket.deltag( 'skill_delay' )
--- 22,26 ----
if cur_time < char.socket.gettag( 'skill_delay' ):
char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
! return True
else:
char.socket.deltag( 'skill_delay' )
***************
*** 29,33 ****
char.socket.attachtarget( "skills.animallore.response" )
! return 1
def response( char, args, target ):
--- 29,33 ----
char.socket.attachtarget( "skills.animallore.response" )
! return True
def response( char, args, target ):
***************
*** 42,46 ****
if not char.canreach( target.char, 13 ):
return # no msg sent when you fail los check on OSI, wonder why...
!
if target.char.mintaming >= 1100 and not target.char.tamed:
if char.skill[ ANIMALLORE ] == 1000:
--- 42,46 ----
if not char.canreach( target.char, 13 ):
return # no msg sent when you fail los check on OSI, wonder why...
!
if target.char.mintaming >= 1100 and not target.char.tamed:
if char.skill[ ANIMALLORE ] == 1000:
|