Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12383
Modified Files:
door.py equipment.py food.py key.py keyring.py lock.py
lockpick.py potionkeg.py potions.py spiderweb.py
Log Message:
Changed all references to "events" to "scripts"
Index: door.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/door.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** door.py 24 Aug 2004 18:10:22 -0000 1.15
--- door.py 25 Aug 2004 17:03:05 -0000 1.16
***************
*** 207,211 ****
for item in container.content:
# Check if it's a key
! if item.hasevent( 'key' ) and item.hastag( 'lock' ) and int( item.gettag( 'lock' ) ) == lock:
return 1
--- 207,211 ----
for item in container.content:
# Check if it's a key
! if item.hasscript( 'key' ) and item.hastag( 'lock' ) and int( item.gettag( 'lock' ) ) == lock:
return 1
Index: equipment.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/equipment.py,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** equipment.py 12 May 2004 21:55:22 -0000 1.27
--- equipment.py 25 Aug 2004 17:03:05 -0000 1.28
***************
*** 370,377 ****
# in the eventchain somewhere. if not,
# return 1 to handle the equip event.
! events = item.events
for event in events:
! if wolfpack.hasevent(event, EVENT_WEARITEM):
result = wolfpack.callevent(event, EVENT_WEARITEM, (player, player, item, layer))
if result:
--- 370,377 ----
# in the eventchain somewhere. if not,
# return 1 to handle the equip event.
! events = item.scripts
for event in events:
! if wolfpack.hasscript(event, EVENT_WEARITEM):
result = wolfpack.callevent(event, EVENT_WEARITEM, (player, player, item, layer))
if result:
***************
*** 383,387 ****
for event in events[events.index("equipment")+1:]:
! if wolfpack.hasevent(event, EVENT_USE):
return 0
--- 383,387 ----
for event in events[events.index("equipment")+1:]:
! if wolfpack.hasscript(event, EVENT_USE):
return 0
Index: keyring.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/keyring.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** keyring.py 24 Aug 2004 18:10:23 -0000 1.5
--- keyring.py 25 Aug 2004 17:03:05 -0000 1.6
***************
*** 3,7 ****
def onDropOnItem(keyring, key):
! if not keyring.hasevent( 'keyring' ) or not key.hasevent( 'key' ):
return 0
--- 3,7 ----
def onDropOnItem(keyring, key):
! if not keyring.hasscript( 'keyring' ) or not key.hasscript( 'key' ):
return 0
***************
*** 69,73 ****
return
! if not target.item.hasevent( 'lock' ) or not target.item.hastag( 'lock' ):
char.socket.clilocmessage(501666)
return
--- 69,73 ----
return
! if not target.item.hasscript( 'lock' ) or not target.item.hastag( 'lock' ):
char.socket.clilocmessage(501666)
return
***************
*** 79,83 ****
for key in keys:
! if key.hastag('lock') and key.hasevent( 'key' ):
key_lock = str(key.gettag('lock'))
--- 79,83 ----
for key in keys:
! if key.hastag('lock') and key.hasscript( 'key' ):
key_lock = str(key.gettag('lock'))
Index: spiderweb.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/spiderweb.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** spiderweb.py 24 Aug 2004 18:10:23 -0000 1.4
--- spiderweb.py 25 Aug 2004 17:03:05 -0000 1.5
***************
*** 9,16 ****
def onCollide(char, item):
# Ignore if the character already has the event
! if char.hasevent( 'spiderweb' ):
return
! char.addevent( 'spiderweb' )
if char.socket:
char.socket.sysmessage('You are entangled in the spiderweb. You have to break free!')
--- 9,16 ----
def onCollide(char, item):
# Ignore if the character already has the event
! if char.hasscript( 'spiderweb' ):
return
! char.addscript( 'spiderweb' )
if char.socket:
char.socket.sysmessage('You are entangled in the spiderweb. You have to break free!')
***************
*** 28,32 ****
for item in items:
! if item.hasevent( 'spiderweb' ):
spiderweb = item
break
--- 28,32 ----
for item in items:
! if item.hasscript( 'spiderweb' ):
spiderweb = item
break
***************
*** 51,55 ****
return True
! char.removeevent( 'spiderweb' )
char.socket.sysmessage('You manage to break free of the spiderweb.')
return False
--- 51,55 ----
return True
! char.removescript( 'spiderweb' )
char.socket.sysmessage('You manage to break free of the spiderweb.')
return False
***************
*** 66,70 ****
for item in items:
! if item.hasevent( 'spiderweb' ):
spiderweb = item
break
--- 66,70 ----
for item in items:
! if item.hasscript( 'spiderweb' ):
spiderweb = item
break
***************
*** 82,86 ****
for target in targets:
! target.removeevent( 'spiderweb' )
return amount
--- 82,86 ----
for target in targets:
! target.removescript( 'spiderweb' )
return amount
Index: lockpick.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/lockpick.py,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** lockpick.py 24 Aug 2004 18:10:23 -0000 1.5
--- lockpick.py 25 Aug 2004 17:03:05 -0000 1.6
***************
*** 12,16 ****
char.socket.clilocmessage(500312)
else:
! if not target.item or not target.item.hasevent( 'lock' ):
char.socket.clilocmessage(502069)
elif not char.canreach(target.item, 3):
--- 12,16 ----
char.socket.clilocmessage(500312)
else:
! if not target.item or not target.item.hasscript( 'lock' ):
char.socket.clilocmessage(502069)
elif not char.canreach(target.item, 3):
***************
*** 31,35 ****
if char.checkskill(LOCKPICKING, 0, 1200):
# SUCCESS: Remove lockpick and the lock
! target.item.removeevent( 'lock' )
target.item.deltag('lock')
target.item.deltag('locked')
--- 31,35 ----
if char.checkskill(LOCKPICKING, 0, 1200):
# SUCCESS: Remove lockpick and the lock
! target.item.removescript( 'lock' )
target.item.deltag('lock')
target.item.deltag('locked')
Index: key.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/key.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** key.py 24 Aug 2004 18:10:23 -0000 1.12
--- key.py 25 Aug 2004 17:03:05 -0000 1.13
***************
*** 88,92 ****
rename_key(char,key)
! elif target.item.hasevent( 'lock' ):
if target.item.hastag('locked') and int(target.item.gettag('locked')) == 1:
target.item.deltag('locked')
--- 88,92 ----
rename_key(char,key)
! elif target.item.hasscript( 'lock' ):
if target.item.hastag('locked') and int(target.item.gettag('locked')) == 1:
target.item.deltag('locked')
***************
*** 110,114 ****
# Check if the targetted item is a key
! if not target.item or not target.item.hasevent( 'key' ):
char.socket.clilocmessage(501679)
return
--- 110,114 ----
# Check if the targetted item is a key
! if not target.item or not target.item.hasscript( 'key' ):
char.socket.clilocmessage(501679)
return
Index: potions.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/potions.py,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** potions.py 24 Aug 2004 18:10:23 -0000 1.43
--- potions.py 25 Aug 2004 17:03:05 -0000 1.44
***************
*** 380,384 ****
bonus = min(18, math.floor(18 * (char.skill[MAGERY] / 1000.0)))
! char.addevent( 'magic.nightsight' )
char.settag( 'nightsight', bonus)
char.settag( 'nightsight_start', time.minutes())
--- 380,384 ----
bonus = min(18, math.floor(18 * (char.skill[MAGERY] / 1000.0)))
! char.addscript( 'magic.nightsight' )
char.settag( 'nightsight', bonus)
char.settag( 'nightsight_start', time.minutes())
Index: potionkeg.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/potionkeg.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** potionkeg.py 24 Aug 2004 18:10:23 -0000 1.12
--- potionkeg.py 25 Aug 2004 17:03:05 -0000 1.13
***************
*** 14,18 ****
return False
! if not potionkeg.hasevent( 'potionkeg' ) or not potion.hasevent( 'potions' ):
return False
--- 14,18 ----
return False
! if not potionkeg.hasscript( 'potionkeg' ) or not potion.hasscript( 'potions' ):
return False
***************
*** 72,76 ****
return False
! if not potionkeg.hasevent( 'potionkeg' ):
return False
--- 72,76 ----
return False
! if not potionkeg.hasscript( 'potionkeg' ):
return False
Index: food.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/food.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** food.py 24 Aug 2004 18:10:23 -0000 1.13
--- food.py 25 Aug 2004 17:03:05 -0000 1.14
***************
*** 91,97 ****
def onCollide( char, item ):
if char.npc and item.baseid in farm_food and char.baseid in farm_eaters:
! if char.hasevent( 'food' ):
return True
! char.addevent( 'food' )
char.say( "*nibbles*" )
item.movable = 3
--- 91,97 ----
def onCollide( char, item ):
if char.npc and item.baseid in farm_food and char.baseid in farm_eaters:
! if char.hasscript( 'food' ):
return True
! char.addscript( 'food' )
char.say( "*nibbles*" )
item.movable = 3
***************
*** 107,111 ****
food = None
for item in items:
! if item.hasevent( 'food' ) and item.baseid in farm_food:
food = item
break
--- 107,111 ----
food = None
for item in items:
! if item.hasscript( 'food' ) and item.baseid in farm_food:
food = item
break
***************
*** 119,122 ****
char.update()
! char.removeevent('food')
return True
--- 119,122 ----
char.update()
! char.removescript('food')
return True
Index: lock.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/lock.py,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** lock.py 24 Aug 2004 18:10:23 -0000 1.12
--- lock.py 25 Aug 2004 17:03:05 -0000 1.13
***************
*** 30,35 ****
if response.button == 1:
# Prepend 'lock' to the event chain
! if not item.hasevent( 'lock' ):
! item.addevent( 'lock' )
# Set the lock id
--- 30,35 ----
if response.button == 1:
# Prepend 'lock' to the event chain
! if not item.hasscript( 'lock' ):
! item.addscript( 'lock' )
# Set the lock id
***************
*** 64,68 ****
# Remove the event from the eventlist
! item.removeevent( 'lock' )
item.resendtooltip()
--- 64,68 ----
# Remove the event from the eventlist
! item.removescript( 'lock' )
item.resendtooltip()
***************
*** 88,92 ****
# Check if the item already has a lock
! if target.item.hasevent('lock') and target.item.hastag('lock'):
gump.addBackground(id=0x2436, width=425, height=285)
--- 88,92 ----
# Check if the item already has a lock
! if target.item.hasscript('lock') and target.item.hastag('lock'):
gump.addBackground(id=0x2436, width=425, height=285)
***************
*** 164,168 ****
def searchkey(item, lock):
# It's a key.
! if item.hasevent( 'key' ) and item.hastag( 'lock' ):
if lock == str(item.gettag('lock')):
return 1
--- 164,168 ----
def searchkey(item, lock):
# It's a key.
! if item.hasscript( 'key' ) and item.hastag( 'lock' ):
if lock == str(item.gettag('lock')):
return 1
***************
*** 197,201 ****
# Only doors can be opened without unlocking them
# if the user has the key in his posession.
! if item.hasevent( 'door' ):
if searchkey(char.getbackpack(), lock):
char.socket.clilocmessage(501282)
--- 197,201 ----
# Only doors can be opened without unlocking them
# if the user has the key in his posession.
! if item.hasscript( 'door' ):
if searchkey(char.getbackpack(), lock):
char.socket.clilocmessage(501282)
|