Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack/magic
In directory sc8-pr-cvs1:/tmp/cvs-serv22545/wolfpack/magic
Modified Files:
circle1.py circle3.py reactivearmor.py utilities.py
Log Message:
Updated reloading of scripts
Index: circle1.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/magic/circle1.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** circle1.py 25 Sep 2003 23:44:42 -0000 1.3
--- circle1.py 8 Oct 2003 01:35:48 -0000 1.4
***************
*** 60,68 ****
item = wolfpack.additem( random.choice( food ) )
! id = item.id
if not tobackpack( item, char ):
item.update()
! char.message( 1042695, "", " " + item.getname() )
char.soundeffect( 0x1e2 )
--- 60,68 ----
item = wolfpack.additem( random.choice( food ) )
! foodname = " " + item.getname()
if not tobackpack( item, char ):
item.update()
! char.message( 1042695, "", foodname )
char.soundeffect( 0x1e2 )
Index: circle3.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/magic/circle3.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** circle3.py 25 Sep 2003 23:44:42 -0000 1.1
--- circle3.py 8 Oct 2003 01:35:48 -0000 1.2
***************
*** 16,25 ****
statmodifier( char, target, 3, 0 )
! target.effect( 0x373a, 10, 15 )
! target.soundeffect( 0x1ea )
class Fireball ( DelayedDamageSpell ):
def __init__( self ):
! DelayedDamageSpell.__init__( self, 2 )
self.reagents = { REAGENT_BLACKPEARL: 1 }
self.mantra = 'Vas Flam'
--- 16,25 ----
statmodifier( char, target, 3, 0 )
! target.effect( 0x374a, 10, 15 )
! target.soundeffect( 0x1ea )
class Fireball ( DelayedDamageSpell ):
def __init__( self ):
! DelayedDamageSpell.__init__( self, 3 )
self.reagents = { REAGENT_BLACKPEARL: 1 }
self.mantra = 'Vas Flam'
***************
*** 31,41 ****
target.damage( DAMAGE_MAGICAL, damage, char )
def onLoad():
Bless().register( 17 )
Fireball().register( 18 )
! #MagicLock().register( 19 )
#Poison().register( 20 )
#Telekinesis().register( 21 )
! #Teleport().register( 22 )
! #Unlock().register( 23 )
! #WallOfStone().register( 24 )
--- 31,194 ----
target.damage( DAMAGE_MAGICAL, damage, char )
+ # Until containers are implemented in python,
+ # this spell is a security risk
+ #class Telekinesis( Spell ):
+ # def __init__( self ):
+ # Spell.__init__( self, 3 )
+ # self.reagents = { REAGENT_GARLIC: 1, REAGENT_SPIDERSILK: 1, REAGENT_SULFURASH: 1 }
+ # self.mantra = 'Ort Por Ylem'
+ # self.validtarget = TARGET_ITEM
+ #
+ # def target( self, char, mode, targettype, target ):
+
+ class WallOfStone( Spell ):
+ def __init__( self ):
+ Spell.__init__( self, 3 )
+ self.reagents = { REAGENT_BLOODMOSS: 1, REAGENT_GARLIC: 1 }
+ self.mantra = 'In Sanct Ylem'
+ self.validtarget = TARGET_GROUND
+
+ def target( self, char, mode, targettype, target ):
+ char.turnto( target )
+
+ if not char.cansee( target ) and not char.gm:
+ char.message( 500237 )
+ return
+
+ if not self.consumerequirements( char, mode ):
+ return
+
+ xdiff = abs( target.x - char.pos.x )
+ ydiff = abs( target.y - char.pos.y )
+
+ if xdiff > ydiff:
+ positions = [ wolfpack.coord( target.x, target.y - 1, target.z, target.map ), wolfpack.coord( target.x, target.y, target.z, target.map ), wolfpack.coord( target.x, target.y + 1, target.z, target.map ) ]
+ else:
+ positions = [ wolfpack.coord( target.x - 1, target.y, target.z, target.map ), wolfpack.coord( target.x, target.y, target.z, target.map ), wolfpack.coord( target.x + 1, target.y, target.z, target.map ) ]
+
+ # At least one spell should look fancy
+ # Calculate the Angle here
+ serials = []
+
+ char.soundeffect( 0x1f6 )
+
+ for pos in positions:
+ newitem = wolfpack.newitem( 1 )
+ newitem.id = 0x80
+ newitem.moveto( pos )
+ newitem.decay = 0 # Dont decay. TempEffect will take care of them
+ newitem.update()
+ newitem.settag( 'dispellable_field', 1 )
+ serials.append( newitem.serial )
+ wolfpack.effect( 0x376a, pos, 9, 10 )
+
+ wolfpack.addtimer( 10000, "wolfpack.magic.utilities.field_expire", serials, 1 )
+
+ class Teleport( Spell ):
+ def __init__( self ):
+ Spell.__init__( self, 3 )
+ self.reagents = { REAGENT_BLOODMOSS: 1, REAGENT_MANDRAKE: 1 }
+ self.mantra = 'Rel Por'
+ self.validtarget = TARGET_GROUND
+
+ def target( self, char, mode, targettype, target ):
+ char.turnto( target )
+
+ # Line of Sight (touch!! or else we can teleport trough windows)
+ if not char.cansee( target, 1 ) and not char.gm:
+ char.message( 500237 )
+ return
+
+ # Check if the target tile is blocked or in a multi
+ if ( not target.validspawnspot() or target.findmulti( target ) )and not char.gm:
+ char.message( 501942 )
+ return
+
+ if not self.consumerequirements( char, mode ):
+ return
+
+ source = char.pos
+
+ char.removefromview()
+ char.moveto( target )
+ char.update()
+
+ wolfpack.effect( 0x3728, source, 10, 15 )
+ wolfpack.effect( 0x3728, target, 10, 15 )
+
+ char.soundeffect( 0x1fe )
+
+
+ class MagicLock( Spell ):
+ def __init__( self ):
+ Spell.__init__( self, 3 )
+ self.reagents = { REAGENT_BLOODMOSS: 1, REAGENT_SULFURASH: 1, REAGENT_GARLIC: 1 }
+ self.mantra = 'An Por'
+ self.validtarget = TARGET_ITEM
+
+ def target( self, char, mode, targettype, target ):
+ char.turnto( target )
+
+ # We can only lock unlocked chests
+ if target.type != 1 or 'lock' in target.events or target.container:
+ char.message( 501762 )
+ return
+
+ # We cannot use this on locked down chests
+ if target.magic == 4:
+ char.message( 501761 )
+ return
+
+ if not self.consumerequirements( char, mode ):
+ return
+
+ events = target.events
+ events.append( 'lock' )
+ target.events = events
+
+ target.settag( 'lock', 'magic' )
+
+ char.message( 501763 )
+ wolfpack.effect( 0x376a, target.pos, 9, 32 )
+ target.soundeffect( 0x1fa )
+
+ class Unlock( Spell ):
+ def __init__( self ):
+ Spell.__init__( self, 3 )
+ self.reagents = { REAGENT_BLOODMOSS: 1, REAGENT_SULFURASH: 1 }
+ self.mantra = 'Ex Por'
+ self.validtarget = TARGET_ITEM
+
+ def target( self, char, mode, targettype, target ):
+ char.turnto( target )
+
+ # We can only lock unlocked chests
+ if not 'lock' in target.events:
+ char.message( 503101 )
+ return
+
+ if target.gettag( 'lock' ) != 'magic':
+ char.message( 503099 )
+ return
+
+ if not self.consumerequirements( char, mode ):
+ return
+
+ events = target.events
+ events.remove( 'lock' )
+ target.events = events
+
+ target.deltag( 'lock', 'magic' )
+
+ wolfpack.effect( 0x376a, target.pos, 9, 32 )
+ target.soundeffect( 0x1ff )
+
def onLoad():
Bless().register( 17 )
Fireball().register( 18 )
! MagicLock().register( 19 )
#Poison().register( 20 )
#Telekinesis().register( 21 )
! Teleport().register( 22 )
! Unlock().register( 23 )
! WallOfStone().register( 24 )
Index: reactivearmor.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/magic/reactivearmor.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** reactivearmor.py 25 Sep 2003 14:28:43 -0000 1.1
--- reactivearmor.py 8 Oct 2003 01:35:48 -0000 1.2
***************
*** 4,8 ****
# ReactiveArmor EventSet
# This is basically a helper to override onDamage
- # and reduce the physical damage by up to 75% and
# probably throw back damage
def onDamage( char, type, damage, source ):
--- 4,7 ----
Index: utilities.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/magic/utilities.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** utilities.py 25 Sep 2003 23:44:42 -0000 1.3
--- utilities.py 8 Oct 2003 01:35:48 -0000 1.4
***************
*** 143,144 ****
--- 143,152 ----
# Save the values in a tempeffect to remove them later
target.addtimer( duration, "wolfpack.magic.utilities.statmodifier_expire", [ stat, amount ], 1, 1, "magic_statmodifier", "wolfpack.magic.utilities.statmodifier_dispel" )
+
+ def field_expire( object, args ):
+ for serial in args:
+ item = wolfpack.finditem( serial )
+
+ if item:
+ item.delete()
+
|