Update of /cvsroot/wpdev/xmlscripts/scripts/magic
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12383/magic
Modified Files:
circle1.py circle2.py circle3.py circle4.py circle5.py
circle6.py circle7.py circle8.py firefield.py nightsight.py
poisonfield.py scroll.py spell.py spellbook.py trap.py
utilities.py
Log Message:
Changed all references to "events" to "scripts"
Index: circle4.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle4.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** circle4.py 24 Aug 2004 17:18:26 -0000 1.12
--- circle4.py 25 Aug 2004 17:03:05 -0000 1.13
***************
*** 127,131 ****
# We can only recall from recall runes
! if not target.hasevent( 'magic.rune' ):
char.message(502357)
return
--- 127,131 ----
# We can only recall from recall runes
! if not target.hasscript( 'magic.rune' ):
char.message(502357)
return
***************
*** 219,223 ****
newitem.settag('dispellable_field', 1)
newitem.settag('source', char.serial)
! newitem.addevent( 'magic.firefield' )
newitem.update()
serials.append(newitem.serial)
--- 219,223 ----
newitem.settag('dispellable_field', 1)
newitem.settag('source', char.serial)
! newitem.addscript( 'magic.firefield' )
newitem.update()
serials.append(newitem.serial)
Index: nightsight.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/nightsight.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** nightsight.py 24 Aug 2004 21:31:33 -0000 1.6
--- nightsight.py 25 Aug 2004 17:03:05 -0000 1.7
***************
*** 14,18 ****
player.lightbonus = max(0, player.lightbonus - bonus)
! player.removeevent('magic.nightsight')
player.deltag('nightsight')
player.deltag('nightsight_start')
--- 14,18 ----
player.lightbonus = max(0, player.lightbonus - bonus)
! player.removescript('magic.nightsight')
player.deltag('nightsight')
player.deltag('nightsight_start')
Index: circle6.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle6.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** circle6.py 24 Aug 2004 17:18:26 -0000 1.10
--- circle6.py 25 Aug 2004 17:03:05 -0000 1.11
***************
*** 116,120 ****
# We can only mark recall runes
! if not target.hasevent( 'magic.rune' ):
char.message(501797)
return
--- 116,120 ----
# We can only mark recall runes
! if not target.hasscript( 'magic.rune' ):
char.message(501797)
return
***************
*** 220,224 ****
newitem.settag('dispellable_field', 1)
newitem.settag('strength', char.skill[self.damageskill])
! newitem.addevent( 'magic.paralyzefield' )
newitem.update()
serials.append(newitem.serial)
--- 220,224 ----
newitem.settag('dispellable_field', 1)
newitem.settag('strength', char.skill[self.damageskill])
! newitem.addscript( 'magic.paralyzefield' )
newitem.update()
serials.append(newitem.serial)
Index: spell.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/spell.py,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** spell.py 24 Aug 2004 21:31:33 -0000 1.16
--- spell.py 25 Aug 2004 17:03:05 -0000 1.17
***************
*** 40,44 ****
def callback(char, args):
! char.removeevent('magic')
# target
--- 40,44 ----
def callback(char, args):
! char.removescript('magic')
# target
***************
*** 117,121 ****
# We are already casting a spell
! if char.hasevent('magic') or (socket and socket.hastag('cast_target')):
char.socket.clilocmessage(502642)
return 0
--- 117,121 ----
# We are already casting a spell
! if char.hasscript('magic') or (socket and socket.hastag('cast_target')):
char.socket.clilocmessage(502642)
return 0
***************
*** 137,141 ****
# Precasting
! char.addevent('magic')
char.action(self.castaction)
--- 137,141 ----
# Precasting
! char.addscript('magic')
char.action(self.castaction)
Index: spellbook.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/spellbook.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** spellbook.py 24 Aug 2004 17:18:26 -0000 1.9
--- spellbook.py 25 Aug 2004 17:03:05 -0000 1.10
***************
*** 78,83 ****
# Does the Spellbook have a specific spell?
def hasspell( item, spell ):
! if item and ( item.hasevent( 'magic.spellbook' ) or item.hasevent( 'magic.necrospellbook' ) ):
! if item.hasevent( 'magic.necrospellbook' ):
spell = spell - 100
--- 78,83 ----
# Does the Spellbook have a specific spell?
def hasspell( item, spell ):
! if item and ( item.hasscript( 'magic.spellbook' ) or item.hasscript( 'magic.necrospellbook' ) ):
! if item.hasscript( 'magic.necrospellbook' ):
spell = spell - 100
***************
*** 106,110 ****
# Adds the specified spell to the specified spellbook
def addspell( item, spell ):
! if not item or not item.hasevent( 'magic.spellbook' ):
return 0
--- 106,110 ----
# Adds the specified spell to the specified spellbook
def addspell( item, spell ):
! if not item or not item.hasscript( 'magic.spellbook' ):
return 0
***************
*** 127,131 ****
# Removes the specified spell from the specified spellbook
def removespell( item, spell ):
! if not item or not item.hasevent( 'magic.spellbook' ):
return 0
--- 127,131 ----
# Removes the specified spell from the specified spellbook
def removespell( item, spell ):
! if not item or not item.hasscript( 'magic.spellbook' ):
return 0
***************
*** 151,155 ****
item = target.item
! if not item or not item.hasevent( 'magic.spellbook' ):
char.socket.sysmessage( 'You need to target a spellbook.' )
return
--- 151,155 ----
item = target.item
! if not item or not item.hasscript( 'magic.spellbook' ):
char.socket.sysmessage( 'You need to target a spellbook.' )
return
***************
*** 177,181 ****
item = target.item
! if not item or not item.hasevent( 'magic.spellbook' ):
char.socket.sysmessage( 'You need to target a spellbook.' )
return
--- 177,181 ----
item = target.item
! if not item or not item.hasscript( 'magic.spellbook' ):
char.socket.sysmessage( 'You need to target a spellbook.' )
return
Index: circle1.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle1.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** circle1.py 24 Aug 2004 17:18:25 -0000 1.11
--- circle1.py 25 Aug 2004 17:03:05 -0000 1.12
***************
*** 118,122 ****
return 0
! if target.hasevent( 'magic.nightsight' ):
if char.socket:
if char == target:
--- 118,122 ----
return 0
! if target.hasscript( 'magic.nightsight' ):
if char.socket:
if char == target:
***************
*** 136,140 ****
bonus = min(18, math.floor(18 * (char.skill[MAGERY] / 1000.0)))
! target.addevent( 'magic.nightsight' )
target.settag("nightsight", bonus)
target.settag("nightsight_start", time.minutes())
--- 136,140 ----
bonus = min(18, math.floor(18 * (char.skill[MAGERY] / 1000.0)))
! target.addscript( 'magic.nightsight' )
target.settag("nightsight", bonus)
target.settag("nightsight_start", time.minutes())
Index: scroll.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/scroll.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** scroll.py 24 Aug 2004 17:18:26 -0000 1.6
--- scroll.py 25 Aug 2004 17:03:05 -0000 1.7
***************
*** 50,54 ****
return False
! if cont.hasevent( 'magic.spellbook' ):
if spell >= 64:
char.socket.sysmessage( "Scroll with invalid spell-id: %d" % spell )
--- 50,54 ----
return False
! if cont.hasscript( 'magic.spellbook' ):
if spell >= 64:
char.socket.sysmessage( "Scroll with invalid spell-id: %d" % spell )
Index: poisonfield.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/poisonfield.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** poisonfield.py 24 Aug 2004 17:18:26 -0000 1.5
--- poisonfield.py 25 Aug 2004 17:03:05 -0000 1.6
***************
*** 30,34 ****
for item in items:
! if item.hasevent( 'magic.poisonfield' ):
level = 0
if item.hastag('level'):
--- 30,34 ----
for item in items:
! if item.hasscript( 'magic.poisonfield' ):
level = 0
if item.hastag('level'):
Index: circle3.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle3.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** circle3.py 24 Aug 2004 18:10:28 -0000 1.9
--- circle3.py 25 Aug 2004 17:03:05 -0000 1.10
***************
*** 123,127 ****
# We can only lock unlocked chests
! if target.type != 1 or target.hasevent( 'lock' ) or target.container:
char.message(501762)
return
--- 123,127 ----
# We can only lock unlocked chests
! if target.type != 1 or target.hasscript( 'lock' ) or target.container:
char.message(501762)
return
***************
*** 135,139 ****
return
! target.addevent( 'lock' )
target.settag('lock', 'magic')
--- 135,139 ----
return
! target.addscript( 'lock' )
target.settag('lock', 'magic')
***************
*** 153,157 ****
# We can only lock unlocked chests
! if not target.hasevent( 'lock' ):
char.message(503101)
return
--- 153,157 ----
# We can only lock unlocked chests
! if not target.hasscript( 'lock' ):
char.message(503101)
return
***************
*** 164,168 ****
return
! target.removeevent( 'lock' )
target.deltag('lock', 'magic')
--- 164,168 ----
return
! target.removescript( 'lock' )
target.deltag('lock', 'magic')
***************
*** 183,192 ****
# Check if there is an event handling onUse but not onTelekinesis
! for event in target.events:
! if wolfpack.hasevent(event, EVENT_TELEKINESIS):
hasevent = 1 # The object has at least one telekinesis handler
continue
! if wolfpack.hasevent(event, EVENT_USE):
if char.socket:
char.socket.clilocmessage(501857)
--- 183,192 ----
# Check if there is an event handling onUse but not onTelekinesis
! for event in target.scripts:
! if wolfpack.hasscript(event, EVENT_TELEKINESIS):
hasevent = 1 # The object has at least one telekinesis handler
continue
! if wolfpack.hasscript(event, EVENT_USE):
if char.socket:
char.socket.clilocmessage(501857)
***************
*** 206,212 ****
result = 0
! for event in target.events:
# If the event can handle onTelekinesis, call it
! if wolfpack.hasevent(event, EVENT_TELEKINESIS):
if wolfpack.callevent(event, EVENT_TELEKINESIS, (char, target)):
return
--- 206,212 ----
result = 0
! for event in target.scripts:
# If the event can handle onTelekinesis, call it
! if wolfpack.hasscript(event, EVENT_TELEKINESIS):
if wolfpack.callevent(event, EVENT_TELEKINESIS, (char, target)):
return
Index: firefield.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/firefield.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** firefield.py 24 Aug 2004 17:18:26 -0000 1.6
--- firefield.py 25 Aug 2004 17:03:05 -0000 1.7
***************
*** 27,31 ****
for item in items:
! if item.hasevent( 'magic.firefield' ):
source = None
if item.hastag('source'):
--- 27,31 ----
for item in items:
! if item.hasscript( 'magic.firefield' ):
source = None
if item.hastag('source'):
Index: circle5.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle5.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** circle5.py 24 Aug 2004 17:18:26 -0000 1.15
--- circle5.py 25 Aug 2004 17:03:05 -0000 1.16
***************
*** 301,305 ****
newitem.settag('dispellable_field', 1)
newitem.settag('level', level)
! newitem.addevent( 'magic.poisonfield' )
newitem.update()
serials.append(newitem.serial)
--- 301,305 ----
newitem.settag('dispellable_field', 1)
newitem.settag('level', level)
! newitem.addscript( 'magic.poisonfield' )
newitem.update()
serials.append(newitem.serial)
***************
*** 355,359 ****
else:
creature.tamed = 1
! creature.addevent('speech.pets')
creature.owner = char
creature.summontime = wolfpack.time.servertime() + int(char.skill[MAGERY] * 400)
--- 355,359 ----
else:
creature.tamed = 1
! creature.addscript('speech.pets')
creature.owner = char
creature.summontime = wolfpack.time.servertime() + int(char.skill[MAGERY] * 400)
Index: utilities.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/utilities.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** utilities.py 24 Aug 2004 21:31:33 -0000 1.12
--- utilities.py 25 Aug 2004 17:03:05 -0000 1.13
***************
*** 52,56 ****
char.dispel(char, 1, 'cast_delay')
! char.removeevent('magic')
if char.socket:
--- 52,56 ----
char.dispel(char, 1, 'cast_delay')
! char.removescript('magic')
if char.socket:
Index: circle8.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle8.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** circle8.py 9 Aug 2004 18:51:38 -0000 1.12
--- circle8.py 25 Aug 2004 17:03:05 -0000 1.13
***************
*** 127,131 ****
char.socket.clilocmessage(1049645)
else:
! creature.addevent('speech.pets')
creature.owner = char
creature.summontime = wolfpack.time.currenttime() + 120000
--- 127,131 ----
char.socket.clilocmessage(1049645)
else:
! creature.addscript('speech.pets')
creature.owner = char
creature.summontime = wolfpack.time.currenttime() + 120000
Index: circle7.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle7.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** circle7.py 24 Aug 2004 17:18:26 -0000 1.12
--- circle7.py 25 Aug 2004 17:03:05 -0000 1.13
***************
*** 140,144 ****
# We can only recall from recall runes
! if not target.hasevent( 'magic.rune' ):
char.message(502357)
return
--- 140,144 ----
# We can only recall from recall runes
! if not target.hasscript( 'magic.rune' ):
char.message(502357)
return
***************
*** 185,189 ****
gate.moveto(char.pos)
gate.settag('dispellable_field', 1)
! gate.addevent( 'magic.gate' )
gate.settag('target', target.gettag('location'))
gate.direction = 9
--- 185,189 ----
gate.moveto(char.pos)
gate.settag('dispellable_field', 1)
! gate.addscript( 'magic.gate' )
gate.settag('target', target.gettag('location'))
gate.direction = 9
***************
*** 197,201 ****
gate.settag('target', '%u,%u,%d,%u' % (char.pos.x, char.pos.y, char.pos.z, char.pos.map))
gate.settag('dispellable_field', 1)
! gate.addevent( 'magic.gate' )
gate.direction = 9
gate.update()
--- 197,201 ----
gate.settag('target', '%u,%u,%d,%u' % (char.pos.x, char.pos.y, char.pos.z, char.pos.map))
gate.settag('dispellable_field', 1)
! gate.addscript( 'magic.gate' )
gate.direction = 9
gate.update()
Index: trap.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/trap.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** trap.py 24 Aug 2004 17:18:26 -0000 1.6
--- trap.py 25 Aug 2004 17:03:05 -0000 1.7
***************
*** 14,18 ****
owner = wolfpack.findchar(int(item.gettag('trap_owner')))
except:
! item.removeevent( 'magic.trap' )
item.deltag('trap_type')
item.deltag('trap_damage')
--- 14,18 ----
owner = wolfpack.findchar(int(item.gettag('trap_owner')))
except:
! item.removescript( 'magic.trap' )
item.deltag('trap_type')
item.deltag('trap_damage')
***************
*** 20,24 ****
return 0
! item.removeevent( 'magic.trap' )
item.deltag('trap_type')
item.deltag('trap_damage')
--- 20,24 ----
return 0
! item.removescript( 'magic.trap' )
item.deltag('trap_type')
item.deltag('trap_damage')
Index: circle2.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle2.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** circle2.py 24 Aug 2004 18:10:28 -0000 1.10
--- circle2.py 25 Aug 2004 17:03:05 -0000 1.11
***************
*** 93,97 ****
target.settag('trap_damage', random.randint(10, 50))
target.settag('trap_type', 'magic')
! target.addevent( 'magic.trap' )
--- 93,97 ----
target.settag('trap_damage', random.randint(10, 50))
target.settag('trap_type', 'magic')
! target.addscript( 'magic.trap' )
***************
*** 110,114 ****
# Already Trapped?
! if not target.hasevent( 'magic.trap' ):
fizzle(char)
return
--- 110,114 ----
# Already Trapped?
! if not target.hasscript( 'magic.trap' ):
fizzle(char)
return
***************
*** 118,122 ****
# Remove the Trap Properties from the Item
! target.removeevent( 'magic.trap' )
target.deltag('trap_owner')
target.deltag('trap_damage')
--- 118,122 ----
# Remove the Trap Properties from the Item
! target.removescript( 'magic.trap' )
target.deltag('trap_owner')
target.deltag('trap_damage')
|