[wpdev-commits] xmlscripts/scripts/system loot.py,1.14,1.15
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-08-10 13:44:42
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10362 Modified Files: loot.py Log Message: This fixed the lootpack bug. Index: loot.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/loot.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** loot.py 7 Jun 2004 21:53:24 -0000 1.14 --- loot.py 10 Aug 2004 13:44:33 -0000 1.15 *************** *** 2,8 **** import wolfpack from wolfpack.consts import * from wolfpack import console, utilities import random - from system.lootlists import * # Indices --- 2,8 ---- import wolfpack from wolfpack.consts import * + from system.lootlists import * from wolfpack import console, utilities import random # Indices *************** *** 464,488 **** # A pack is actually a list of lists for item in pack: ! if item[PACK_CHANCE] >= random.random(): ! if type(item[PACK_AMOUNT]) == str: ! amount = utilities.rolldice(item[PACK_AMOUNT]) else: ! amount = int(item[PACK_AMOUNT]) ! if item[PACK_STACKABLE]: ! if type(item[PACK_ITEM]) == list: ! itemid = random.choice(item[PACK_ITEM]) ! else: ! itemid = str(item[PACK_ITEM]) ! item = wolfpack.additem(itemid) item.amount = amount dropitem(item, char, corpse) else: for i in range(0, amount): ! if type(item[PACK_ITEM]) == list: ! itemid = random.choice(item[PACK_ITEM]) ! else: ! itemid = str(item[PACK_ITEM]) item = wolfpack.additem(itemid) --- 464,495 ---- # A pack is actually a list of lists for item in pack: ! packchance = item[ PACK_CHANCE ] ! packstackable = item[ PACK_STACKABLE ] ! packamount = item[ PACK_AMOUNT ] ! packitem = item[ PACK_ITEM ] ! ! ! if packchance >= random.random(): ! if type( packamount ) == str: ! amount = utilities.rolldice( packamount ) else: ! amount = int( packamount ) ! if packstackable == True: ! if type( packitem ) == list: ! itemid = random.choice( packitem ) ! elif type( packitem ) == str: ! itemid = str( packitem ) ! item = wolfpack.additem( itemid ) item.amount = amount dropitem(item, char, corpse) + else: for i in range(0, amount): ! if type( packitem ) == list: ! itemid = random.choice( packitem ) ! elif type( packitem ) == str: ! itemid = str( packitem ) item = wolfpack.additem(itemid) *************** *** 505,513 **** # Create the items for each pack for pack in packs: ! if not PACKS.has_key(pack): console.log(LOG_ERROR, "Trying to create an unknown loot pack %s.\n" % pack) continue ! ! createpack(char, killer, corpse, PACKS[pack]) # --- 512,519 ---- # Create the items for each pack for pack in packs: ! if not PACKS.has_key( pack ): console.log(LOG_ERROR, "Trying to create an unknown loot pack %s.\n" % pack) continue ! createpack( char, killer, corpse, PACKS[ pack ] ) # |