Update of /cvsroot/wpdev/xmlscripts/scripts/skills
In directory sc8-pr-cvs1:/tmp/cvs-serv31082/skills
Modified Files:
__init__.py anatomy.py animallore.py animaltaming.py
armslore.py begging.py detectinghidden.py evaluatingintel.py
hiding.py inscription.py itemid.py peacemaking.py
provocation.py spiritspeak.py stealth.py tasteid.py
tracking.py
Removed Files:
evaluateintelligence.py
Log Message:
Changed scripts to resemble changes in wolfpack.registerglobal and wolfpack.registercommand
Added barebone for new magic system.
Index: __init__.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/__init__.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** __init__.py 19 Feb 2003 21:15:54 -0000 1.1
--- __init__.py 23 Sep 2003 12:17:39 -0000 1.2
***************
*** 0 ****
--- 1,21 ----
+
+ import wolfpack
+ from wolfpack.consts import *
+
+ skills = {}
+
+ def register( id, handler ):
+ if skills.has_key( id ):
+ raise Exception, "Duplicate Skill: " + str( id )
+
+ skills[ id ] = handler
+
+ def onLoad():
+ wolfpack.registerglobal( EVENT_SKILLUSE, "skills" )
+
+ def onSkillUse( char, skill ):
+ if skills.has_key( skill ):
+ skills[ skill ]( char, skill )
+ return 1
+
+ return 0
Index: anatomy.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/anatomy.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** anatomy.py 23 Apr 2003 11:43:18 -0000 1.7
--- anatomy.py 23 Sep 2003 12:17:39 -0000 1.8
***************
*** 8,11 ****
--- 8,12 ----
from wolfpack.consts import *
import wolfpack
+ import skills
from wolfpack.time import *
from math import floor
***************
*** 13,22 ****
ANATOMY_DELAY = 5000
- # Register as a global script
- def onLoad():
- wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.anatomy" )
-
# Button for Anatomy pressed on skill gump
! def onSkillUse( char, skill ):
# We only handle anatomy
if skill != ANATOMY:
--- 14,19 ----
ANATOMY_DELAY = 5000
# Button for Anatomy pressed on skill gump
! def anatomy( char, skill ):
# We only handle anatomy
if skill != ANATOMY:
***************
*** 84,85 ****
--- 81,85 ----
socket.clilocmessage( msgId2, "", 0x3b2, 3, target.char )
+ # Register as a global script
+ def onLoad():
+ skills.register( ANATOMY, anatomy )
Index: animallore.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/animallore.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** animallore.py 23 Apr 2003 11:43:18 -0000 1.10
--- animallore.py 23 Sep 2003 12:17:39 -0000 1.11
***************
*** 10,21 ****
from wolfpack.time import *
from wolfpack.gumps import cGump
ANIMALLORE_DELAY = 5000
! # Register as a global script
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.animallore" )
!
! def onSkillUse( char, skill ):
if skill != ANIMALLORE:
return 0
--- 10,18 ----
from wolfpack.time import *
from wolfpack.gumps import cGump
+ import skills
ANIMALLORE_DELAY = 5000
! def animallore( char, skill ):
if skill != ANIMALLORE:
return 0
***************
*** 225,226 ****
--- 222,225 ----
char.settag( 'skill_delay', cur_time + ANIMALLORE_DELAY )
+ def onLoad():
+ skills.register( ANIMALLORE, animallore )
Index: animaltaming.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/animaltaming.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** animaltaming.py 16 Jun 2003 16:01:02 -0000 1.7
--- animaltaming.py 23 Sep 2003 12:17:39 -0000 1.8
***************
*** 8,11 ****
--- 8,12 ----
from wolfpack.consts import *
from wolfpack.time import *
+ import skills
import wolfpack
import whrandom
***************
*** 24,33 ****
TAMING_DELAY = 10000
- # Register as a global script
- def onLoad():
- wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.animaltaming" )
-
# Button for AnimalTaming pressed on skill gump
! def onSkillUse( char, skill ):
# We only handle animaltaming
if skill != TAMING:
--- 25,30 ----
TAMING_DELAY = 10000
# Button for AnimalTaming pressed on skill gump
! def animaltaming( char, skill ):
# We only handle animaltaming
if skill != TAMING:
***************
*** 224,225 ****
--- 221,225 ----
if char.hastag( 'angry' ):
char.deltag( 'angry' )
+
+ def onLoad():
+ skills.register( TAMING, animaltaming )
Index: armslore.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/armslore.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** armslore.py 23 Apr 2003 11:43:18 -0000 1.6
--- armslore.py 23 Sep 2003 12:17:39 -0000 1.7
***************
*** 10,20 ****
from wolfpack.time import *
import wolfpack
ARMSLORE_DELAY = 5000
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.armslore" )
!
! def onSkillUse( char, skill ):
# only handle armslore
if skill != ARMSLORE:
--- 10,18 ----
from wolfpack.time import *
import wolfpack
+ import skills
ARMSLORE_DELAY = 5000
! def armslore( char, skill ):
# only handle armslore
if skill != ARMSLORE:
***************
*** 74,75 ****
--- 72,75 ----
return 0
+ def onLoad():
+ skills.register( ARMSLORE, armslore )
Index: begging.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/begging.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** begging.py 23 Apr 2003 11:43:18 -0000 1.6
--- begging.py 23 Sep 2003 12:17:39 -0000 1.7
***************
*** 10,13 ****
--- 10,14 ----
from wolfpack.time import *
import wolfpack
+ import skills
# from UO Stratics:
***************
*** 26,33 ****
BEGGING_DELAY = 5000
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.begging" )
!
! def onSkillUse( char, skill ):
if skill != BEGGING:
return 0
--- 27,31 ----
BEGGING_DELAY = 5000
! def begging( char, skill ):
if skill != BEGGING:
return 0
***************
*** 112,113 ****
--- 110,113 ----
char.socket.clilocmessage( 500404, "", 0x3b2, 3, npc )
+ def onLoad():
+ skills.register( BEGGING, begging )
\ No newline at end of file
Index: detectinghidden.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/detectinghidden.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** detectinghidden.py 23 Apr 2003 11:43:18 -0000 1.4
--- detectinghidden.py 23 Sep 2003 12:17:39 -0000 1.5
***************
*** 10,13 ****
--- 10,14 ----
from wolfpack.time import *
import wolfpack
+ import skills
# UOSS : All dungeons can spawn the following traps at random locations: Floor saw trap, floor spike trap, poison gas trap and exploding mushroom trap.
***************
*** 23,30 ****
DETECTHIDDEN_DELAY = 5000
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.detectinghidden" )
!
! def onSkillUse( char, skill ):
# only handle detect hidden
if skill != DETECTINGHIDDEN:
--- 24,28 ----
DETECTHIDDEN_DELAY = 5000
! def detectinghidden( char, skill ):
# only handle detect hidden
if skill != DETECTINGHIDDEN:
***************
*** 131,132 ****
--- 129,132 ----
self.update()
+ def onLoad():
+ skills.register( DETECTINGHIDDEN, detectinghidden )
\ No newline at end of file
Index: evaluatingintel.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/evaluatingintel.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** evaluatingintel.py 23 Apr 2003 11:43:18 -0000 1.4
--- evaluatingintel.py 23 Sep 2003 12:17:39 -0000 1.5
***************
*** 1,32 ****
#################################################################
# ) (\_ # WOLFPACK 13.0.0 Scripts #
! # (( _/{ "-; # Created by: Viper #
# )).-' {{ ;'` # Revised by: #
# ( ( ;._ \\ ctr # Last Modification: Created #
#################################################################
!
import wolfpack
from wolfpack.consts import *
- from wolfpack.time import *
from math import floor
! EVALINT_DELAY = 5000
!
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.evaluatingintel" )
!
! def onSkillUse( char, skill ):
#Only Handle Evalint
if skill != EVALUATINGINTEL:
return 0
- if char.hastag( 'skill_delay' ):
- cur_time = servertime()
- if cur_time < char.gettag( 'skill_delay' ):
- char.socket.clilocmessage( 500118, "", 0x3b2, 3 )
- return 1
- else:
- char.deltag( 'skill_delay' )
-
char.socket.clilocmessage( 0x7A4AA, "", 0x3b2, 3 ) # What would you like to evaluate
char.socket.attachtarget( "skills.evaluatingintel.response" )
--- 1,19 ----
#################################################################
# ) (\_ # WOLFPACK 13.0.0 Scripts #
! # (( _/{ "-; # Created by: DarkStorm #
# )).-' {{ ;'` # Revised by: #
# ( ( ;._ \\ ctr # Last Modification: Created #
#################################################################
!
import wolfpack
from wolfpack.consts import *
from math import floor
+ import skills
! def evaluatingintel( char, skill ):
#Only Handle Evalint
if skill != EVALUATINGINTEL:
return 0
char.socket.clilocmessage( 0x7A4AA, "", 0x3b2, 3 ) # What would you like to evaluate
char.socket.attachtarget( "skills.evaluatingintel.response" )
***************
*** 41,53 ****
if not char.canreach( target.char, 8 ):
return 0
! cur_time = servertime()
! char.settag( 'skill_delay', cur_time + EVALINT_DELAY )
! #if target.char == char:
# Hmm, that person looks really silly.
! #char.socket.clilocmessage( 0x7A4AE, "", 0x3b2, 3, target.char )
! #return 0
if not char.checkskill( EVALUATINGINTEL, 0, 1000 ):
--- 28,41 ----
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.
! # Town Criers: 0x7A4AB He looks smart enough to remember the news. Ask him about it.
! if target.char == char:
# Hmm, that person looks really silly.
! char.socket.clilocmessage( 0x7A4AE, "", 0x3b2, 3, target.char )
! return 0
if not char.checkskill( EVALUATINGINTEL, 0, 1000 ):
***************
*** 71,72 ****
--- 59,64 ----
char.socket.clilocmessage( msgId2, "", 0x3b2, 3, target.char )
return 1
+
+ def onLoad():
+ skills.register( EVALUATINGINTEL, evaluatingintel )
+
\ No newline at end of file
Index: hiding.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/hiding.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** hiding.py 23 Apr 2003 11:43:18 -0000 1.5
--- hiding.py 23 Sep 2003 12:17:39 -0000 1.6
***************
*** 10,20 ****
from wolfpack.time import *
import wolfpack
HIDING_DELAY = 5000
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.hiding" )
!
! def onSkillUse( char, skill ):
if skill != HIDING:
return 0
--- 10,18 ----
from wolfpack.time import *
import wolfpack
+ import skills
HIDING_DELAY = 5000
! def hiding( char, skill ):
if skill != HIDING:
return 0
***************
*** 42,43 ****
--- 40,43 ----
return 1
+ def onLoad():
+ skills.register( HIDING, hiding )
Index: inscription.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/inscription.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** inscription.py 22 Apr 2003 09:28:42 -0000 1.2
--- inscription.py 23 Sep 2003 12:17:39 -0000 1.3
***************
*** 9,12 ****
--- 9,13 ----
from wolfpack.utilities import *
import wolfpack
+ import skills
# mana used when we create a scroll
***************
*** 20,29 ****
INS_EXCEPTIONAL = 750
- def onLoad():
- wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.inscription" )
-
# skill is used via the blue button on skill gump
# this will copy a book
! def onSkillUse( char, skill ):
if skill != INSCRIPTION:
return 0
--- 21,27 ----
INS_EXCEPTIONAL = 750
# skill is used via the blue button on skill gump
# this will copy a book
! def inscription( char, skill ):
if skill != INSCRIPTION:
return 0
***************
*** 394,395 ****
--- 392,396 ----
book.update()
return 1
+
+ def onLoad():
+ skills.register( INSCRIPTION, inscription )
Index: itemid.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/itemid.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** itemid.py 23 Apr 2003 11:43:18 -0000 1.4
--- itemid.py 23 Sep 2003 12:17:39 -0000 1.5
***************
*** 10,20 ****
from wolfpack.time import *
import wolfpack
ITEMID_DELAY = 5000
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.itemid" )
!
! def onSkillUse( char, skill ):
if skill != ITEMID:
return 0
--- 10,18 ----
from wolfpack.time import *
import wolfpack
+ import skills
ITEMID_DELAY = 5000
! def itemid( char, skill ):
if skill != ITEMID:
return 0
***************
*** 70,71 ****
--- 68,73 ----
return 1
+
+ def onLoad():
+ skills.register( ITEMID, itemid )
+
\ No newline at end of file
Index: peacemaking.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/peacemaking.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** peacemaking.py 23 Apr 2003 11:43:18 -0000 1.5
--- peacemaking.py 23 Sep 2003 12:17:39 -0000 1.6
***************
*** 10,22 ****
from wolfpack.utilities import *
from wolfpack.time import *
! #import skills
! from skills import *
PEACE_DELAY = 5000
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.peacemaking" )
!
! def onSkillUse( char, skill ):
if skill != PEACEMAKING:
return 0
--- 10,18 ----
from wolfpack.utilities import *
from wolfpack.time import *
! import skills
PEACE_DELAY = 5000
! def peacemaking( char, skill ):
if skill != PEACEMAKING:
return 0
***************
*** 132,133 ****
--- 128,131 ----
char.deltag( 'peacemaking' )
+ def onLoad():
+ skills.register( PEACEMAKING, peacemaking )
Index: provocation.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/provocation.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** provocation.py 24 Apr 2003 10:33:08 -0000 1.6
--- provocation.py 23 Sep 2003 12:17:39 -0000 1.7
***************
*** 10,18 ****
from math import floor
from wolfpack.utilities import *
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.provocation" )
!
! def onSkillUse( char, skill ):
# Only handle provocation
if skill != PROVOCATION:
--- 10,16 ----
from math import floor
from wolfpack.utilities import *
+ import skills
! def provocation( char, skill ):
# Only handle provocation
if skill != PROVOCATION:
***************
*** 217,218 ****
--- 215,219 ----
total /= 10.0
return total
+
+ def onLoad():
+ skills.register( PROVOCATION, provocation )
Index: spiritspeak.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/spiritspeak.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** spiritspeak.py 23 Apr 2003 11:43:18 -0000 1.4
--- spiritspeak.py 23 Sep 2003 12:17:39 -0000 1.5
***************
*** 11,23 ****
from math import floor
import random
SPSPEAK_DELAY = 5000
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.spiritspeak" )
!
! def onSkillUse( char, skill ):
if skill != SPIRITSPEAK:
return 0
socket = char.socket
--- 11,22 ----
from math import floor
import random
+ import skills
SPSPEAK_DELAY = 5000
! def spiritspeak( char, skill ):
if skill != SPIRITSPEAK:
return 0
+
socket = char.socket
***************
*** 85,86 ****
--- 84,87 ----
return 1
+ def onLoad():
+ skills.register( SPIRITSPEAK, spiritspeak )
Index: stealth.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/stealth.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** stealth.py 28 Apr 2003 05:27:38 -0000 1.1
--- stealth.py 23 Sep 2003 12:17:39 -0000 1.2
***************
*** 10,13 ****
--- 10,14 ----
from wolfpack.time import *
import wolfpack
+ import skills
STEALTH_DELAY = 5000
***************
*** 15,22 ****
MIN_HIDING = 800
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.stealth" )
!
! def onSkillUse( char, skill ):
if skill != STEALTH:
return 0
--- 16,20 ----
MIN_HIDING = 800
! def stealth( char, skill ):
if skill != STEALTH:
return 0
***************
*** 59,60 ****
--- 57,60 ----
return 1
+ def onLoad():
+ skills.register( STEALTH, stealth )
Index: tasteid.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/tasteid.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** tasteid.py 28 Aug 2003 20:47:57 -0000 1.2
--- tasteid.py 23 Sep 2003 12:17:39 -0000 1.3
***************
*** 10,13 ****
--- 10,14 ----
from wolfpack.time import *
import wolfpack
+ import skills
TASTEID_DELAY = 5000
***************
*** 18,22 ****
wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.tasteid" )
! def onSkillUse( char, skill ):
if skill != TASTEID:
return 0
--- 19,23 ----
wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.tasteid" )
! def tasteid( char, skill ):
if skill != TASTEID:
return 0
***************
*** 90,91 ****
--- 91,95 ----
char.poisoned = item.poisoned
+ def onLoad():
+ skills.register( TASTEID, tasteid )
+
\ No newline at end of file
Index: tracking.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/tracking.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** tracking.py 5 Sep 2003 20:15:29 -0000 1.1
--- tracking.py 23 Sep 2003 12:17:39 -0000 1.2
***************
*** 11,14 ****
--- 11,15 ----
from wolfpack.gumps import *
import wolfpack
+ import skills
STEALTH_DELAY = 5000
***************
*** 16,23 ****
MIN_HIDING = 800
! def onLoad():
! wolfpack.registerglobal( HOOK_CHAR, EVENT_SKILLUSE, "skills.tracking" )
!
! def onSkillUse( char, skill ):
if skill != TRACKING:
return 0
--- 17,21 ----
MIN_HIDING = 800
! def tracking( char, skill ):
if skill != TRACKING:
return 0
***************
*** 66,67 ****
--- 64,68 ----
return 1
+ def onLoad():
+ skills.register( TRACKING, tracking )
+
\ No newline at end of file
--- evaluateintelligence.py DELETED ---
|