[wpdev-commits] xmlscripts/scripts/npc poison.py,1.1,1.2
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-10-27 16:38:44
|
Update of /cvsroot/wpdev/xmlscripts/scripts/npc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11185/npc Modified Files: poison.py Log Message: Possible fix for nightsight problems. Index: poison.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/npc/poison.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** poison.py 27 Oct 2004 14:06:34 -0000 1.1 --- poison.py 27 Oct 2004 16:38:35 -0000 1.2 *************** *** 2,6 **** from wolfpack.consts import * import system.poison ! impot random def onDoDamage(npc, damagetype, amount, victim): --- 2,6 ---- from wolfpack.consts import * import system.poison ! import random def onDoDamage(npc, damagetype, amount, victim): *************** *** 14,17 **** --- 14,24 ---- hit_poison_chance = npc.getintproperty('hit_poison_chance', 50) + # There is a special poison level 5 which has a 80% chance for greater and a 20% chance for deadly + if hit_poison_level == 5: + if 0.20 >= random.random(): + hit_poison_level = 3 # Deadly + else: + hit_poison_level = 2 # Greater + if hit_poison_level < 0 or hit_poison_level > 4: return amount *************** *** 22,26 **** # Check the poisoning chance if hit_poison_chance > random.randint(0, 99): ! system.poison(victim, hit_poison_level) return amount --- 29,33 ---- # Check the poisoning chance if hit_poison_chance > random.randint(0, 99): ! system.poison.poison(victim, hit_poison_level) return amount |