Update of /cvsroot/wpdev/xmlscripts/scripts/skills
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26632/skills
Modified Files:
blacksmithing.py
Log Message:
fixes
Index: blacksmithing.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/blacksmithing.py,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -d -r1.22 -r1.23
*** blacksmithing.py 9 Oct 2004 23:30:48 -0000 1.22
--- blacksmithing.py 12 Oct 2004 10:40:01 -0000 1.23
***************
*** 46,49 ****
--- 46,52 ----
#
def checkanvilandforge(char):
+ if char.gm:
+ return True
+
# Check dynamic items.
# We should later check for statics too
***************
*** 53,62 ****
for item in items:
if item.id == 0xFAF or item.id == 0xFB0:
! anvil = 1
elif item.id == 0xFB1 or (item.id >= 0x197A and item.id <= 0x19A9):
! forge = 1
if anvil and forge:
return True
return False
--- 56,80 ----
for item in items:
if item.id == 0xFAF or item.id == 0xFB0:
! anvil = True
elif item.id == 0xFB1 or (item.id >= 0x197A and item.id <= 0x19A9):
! forge = True
if anvil and forge:
return True
+
+ # Check for static items
+ for x in range(-2, 3):
+ for y in range(-2, 3):
+ statics = wolfpack.statics(char.pos.x + x, char.pos.y + y, char.pos.map, True)
+
+ for tile in statics:
+ dispid = tile['id']
+ if dispid == 0xFAF or dispid == 0xFB0:
+ anvil = True
+ elif dispid == 0xFB1 or (dispid >= 0x197A and dispid <= 0x19A9):
+ forge = True
+
+ if anvil and forge:
+ return True
return False
***************
*** 294,303 ****
if item.maxhealth <= weaken:
player.socket.clilocmessage(500424)
item.delete()
elif player.checkskill(BLACKSMITHING, 0, 1000):
player.socket.clilocmessage(1044279)
item.maxhealth -= weaken
! item.health = item.maxhealth
item.resendtooltip()
else:
player.socket.clilocmessage(1044280)
--- 312,323 ----
if item.maxhealth <= weaken:
player.socket.clilocmessage(500424)
+ player.log("Tries to repair item %s (0x%x) and destroys it.\n" % (item.baseid, item.serial))
item.delete()
elif player.checkskill(BLACKSMITHING, 0, 1000):
player.socket.clilocmessage(1044279)
item.maxhealth -= weaken
! item.health = item.maxhealth
item.resendtooltip()
+ player.log("Repairs item %s (0x%x) and weakens it by %u points.\n" % (item.baseid, item.serial, weaken))
else:
player.socket.clilocmessage(1044280)
***************
*** 305,308 ****
--- 325,329 ----
item.health = max(0, item.health - weaken)
item.resendtooltip()
+ player.log("Fails to repair item %s (0x%x) and weakens it by %u points.\n" % (item.baseid, item.serial, weaken))
# Warn the user if we'll break the item next time
|