Update of /cvsroot/wpdev/xmlscripts/scripts/commands
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31477/commands
Modified Files:
cast.py skill.py skillinfo.py stat.py travel.py
Log Message:
New documentation and a long overdue wolfpack.consts cleanup
Index: skill.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/skill.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** skill.py 26 May 2004 13:07:21 -0000 1.2
--- skill.py 2 Jul 2004 13:40:45 -0000 1.3
***************
*** 34,58 ****
socket.sysmessage( usage )
socket.sysmessage( example )
! return OK
else:
socket.sysmessage( usage )
socket.sysmessage( example )
! return OK
# Uknown skill name ?
if not skill in skillnamesids:
socket.clilocmessage( 500156, "", YELLOW, NORMAL ) # Invalid skill
! return OK
# Accept 0 >= value <= 1000 skill value only. 1200 maximum - with power scrolls only
elif value < 0 or value > 1000:
socket.clilocmessage( 1005632, "", YELLOW, NORMAL ) # Skill values range from 0 - 1000.
! return OK
socket.clilocmessage( 503403, "", YELLOW, NORMAL ) # Select the body.
socket.attachtarget( "commands.skill.callback", [ skill, value ] )
! return OK
def callback( char, args, target ):
--- 34,58 ----
socket.sysmessage( usage )
socket.sysmessage( example )
! return True
else:
socket.sysmessage( usage )
socket.sysmessage( example )
! return True
# Uknown skill name ?
if not skill in skillnamesids:
socket.clilocmessage( 500156, "", YELLOW, NORMAL ) # Invalid skill
! return True
# Accept 0 >= value <= 1000 skill value only. 1200 maximum - with power scrolls only
elif value < 0 or value > 1000:
socket.clilocmessage( 1005632, "", YELLOW, NORMAL ) # Skill values range from 0 - 1000.
! return True
socket.clilocmessage( 503403, "", YELLOW, NORMAL ) # Select the body.
socket.attachtarget( "commands.skill.callback", [ skill, value ] )
! return True
def callback( char, args, target ):
***************
*** 62,66 ****
if not target.char:
socket.clilocmessage( 500931, "", YELLOW, NORMAL ) # Invalid mobile
! return OK
# Is target not your own char ?
--- 62,66 ----
if not target.char:
socket.clilocmessage( 500931, "", YELLOW, NORMAL ) # Invalid mobile
! return True
# Is target not your own char ?
***************
*** 68,77 ****
if target.char.rank >= char.rank:
socket.clilocmessage( 1005213, "", YELLOW, NORMAL ) # You can't do that
! return OK
# check for rank
#if target.char.rank >= char.rank and not char == target.char:
# socket.sysmessage( "You are not very skilled, are you?" )
! # return OK
--- 68,77 ----
if target.char.rank >= char.rank:
socket.clilocmessage( 1005213, "", YELLOW, NORMAL ) # You can't do that
! return True
# check for rank
#if target.char.rank >= char.rank and not char == target.char:
# socket.sysmessage( "You are not very skilled, are you?" )
! # return True
***************
*** 80,84 ****
target.char.skill[ skillnamesids[ skill.lower() ] ] = value
! return OK
def onLoad():
--- 80,84 ----
target.char.skill[ skillnamesids[ skill.lower() ] ] = value
! return True
def onLoad():
Index: travel.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/travel.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** travel.py 8 Apr 2004 19:04:50 -0000 1.1
--- travel.py 2 Jul 2004 13:40:45 -0000 1.2
***************
*** 21,25 ****
char = socket.player
sendGump( char, 0 )
! return OK
def onLoad():
--- 21,25 ----
char = socket.player
sendGump( char, 0 )
! return True
def onLoad():
Index: stat.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/stat.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** stat.py 26 May 2004 13:07:21 -0000 1.2
--- stat.py 2 Jul 2004 13:40:45 -0000 1.3
***************
*** 35,60 ****
socket.sysmessage( usage )
socket.sysmessage( example )
! return OK
else:
socket.sysmessage( usage )
socket.sysmessage( example )
! return OK
# Uknown stat name ?
! if not stat in statnames:
socket.clilocmessage( 3000380, "", YELLOW, NORMAL ) # I Accept
! socket.sysmessage( str( statnames ) )
! return OK
# Accept 10 >= value <= 125 only.
elif value < 0 or value > 125:
socket.clilocmessage( 1005628, "", YELLOW, NORMAL ) # Stats range between 10 and 125
! return OK
socket.clilocmessage( 503403, "", YELLOW, NORMAL ) # Select the body.
socket.attachtarget( "commands.stat.callback", [ stat, value ] )
! return OK
def callback( char, args, target ):
--- 35,60 ----
socket.sysmessage( usage )
socket.sysmessage( example )
! return True
else:
socket.sysmessage( usage )
socket.sysmessage( example )
! return True
# Uknown stat name ?
! if not stat in STATNAMES:
socket.clilocmessage( 3000380, "", YELLOW, NORMAL ) # I Accept
! socket.sysmessage( str( STATNAMES ) )
! return True
# Accept 10 >= value <= 125 only.
elif value < 0 or value > 125:
socket.clilocmessage( 1005628, "", YELLOW, NORMAL ) # Stats range between 10 and 125
! return True
socket.clilocmessage( 503403, "", YELLOW, NORMAL ) # Select the body.
socket.attachtarget( "commands.stat.callback", [ stat, value ] )
! return True
def callback( char, args, target ):
***************
*** 64,73 ****
if not target.char:
socket.clilocmessage( 500931, "", YELLOW, NORMAL ) # Invalid mobile
! return OK
# Is target not your own char ?
if not char == target.char:
socket.clilocmessage( 1005213, "", YELLOW, NORMAL ) # You can't do that
! return OK
( stat, value ) = args
--- 64,73 ----
if not target.char:
socket.clilocmessage( 500931, "", YELLOW, NORMAL ) # Invalid mobile
! return True
# Is target not your own char ?
if not char == target.char:
socket.clilocmessage( 1005213, "", YELLOW, NORMAL ) # You can't do that
! return True
( stat, value ) = args
***************
*** 81,86 ****
else:
socket.clilocmessage( 3000380, "", YELLOW, NORMAL ) # I Accept
! socket.sysmessage( str( statnames ) )
! return OK
socket.clilocmessage( 1005630, "", YELLOW, NORMAL ) # Your stats have been adjusted.
--- 81,86 ----
else:
socket.clilocmessage( 3000380, "", YELLOW, NORMAL ) # I Accept
! socket.sysmessage( str( STATNAMES ) )
! return True
socket.clilocmessage( 1005630, "", YELLOW, NORMAL ) # Your stats have been adjusted.
***************
*** 88,92 ****
char.updatestats()
! return OK
def onLoad():
--- 88,92 ----
char.updatestats()
! return True
def onLoad():
Index: skillinfo.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/skillinfo.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** skillinfo.py 26 May 2004 13:07:21 -0000 1.2
--- skillinfo.py 2 Jul 2004 13:40:45 -0000 1.3
***************
*** 30,34 ****
newcap = int(floor(float(response.text[0x2000 | skill]) * 10))
except:
! player.socket.sysmessage('You have entered invalid values for %s.' % skillnames[skill])
return
--- 30,34 ----
newcap = int(floor(float(response.text[0x2000 | skill]) * 10))
except:
! player.socket.sysmessage('You have entered invalid values for %s.' % SKILLNAMES[skill])
return
***************
*** 38,42 ****
if oldvalue != newvalue or oldcap != newcap:
message = "Changed %s for character 0x%x to value %u [%d] and cap %u [%d].\n"
! message = message % (skillnames[skill], target.serial, newvalue, newvalue - oldvalue, newcap, newcap - oldcap)
player.log(LOG_MESSAGE, message)
player.socket.sysmessage(message)
--- 38,42 ----
if oldvalue != newvalue or oldcap != newcap:
message = "Changed %s for character 0x%x to value %u [%d] and cap %u [%d].\n"
! message = message % (SKILLNAMES[skill], target.serial, newvalue, newvalue - oldvalue, newcap, newcap - oldcap)
player.log(LOG_MESSAGE, message)
player.socket.sysmessage(message)
***************
*** 98,102 ****
break
! skillname = skillnames[skill]
skillname = skillname[0].upper() + skillname[1:]
--- 98,102 ----
break
! skillname = SKILLNAMES[skill]
skillname = skillname[0].upper() + skillname[1:]
Index: cast.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/commands/cast.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** cast.py 26 May 2004 13:07:21 -0000 1.2
--- cast.py 2 Jul 2004 13:40:45 -0000 1.3
***************
*** 19,23 ****
castSpell( socket.player, args, 1 )
! return OK
def onLoad():
--- 19,23 ----
castSpell( socket.player, args, 1 )
! return True
def onLoad():
|