[wpdev-commits] xmlscripts/scripts/system skillgain.py,1.16,1.17
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-10-06 20:51:20
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6921/system Modified Files: skillgain.py Log Message: gainfixes for stats Index: skillgain.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/skillgain.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** skillgain.py 4 Oct 2004 22:53:48 -0000 1.16 --- skillgain.py 6 Oct 2004 20:51:09 -0000 1.17 *************** *** 161,196 **** char.socket.updateskill(skill) - # It's not important that we actually gained the skill - # in order to gain stats by using it. - if lock == 0: - strchance = info[SKILL_STRCHANCE] - dexchance = info[SKILL_DEXCHANCE] - intchance = info[SKILL_INTCHANCE] - realstr = char.strength - char.strength2 - realdex = char.dexterity - char.dexterity2 - realint = char.intelligence - char.intelligence2 - - if (char.npc or char.strengthlock != 0) or realstr >= char.strengthcap: - strchance = 0.0 - else: - strchance /= 33.3 - - if (char.npc or char.dexteritylock != 0) or realdex >= char.dexteritycap: - dexchance = 0.0 - else: - dexchance /= 33.3 - - if (char.npc or char.intelligencelock != 0) or realint >= char.intelligencecap: - intchance = 0.0 - else: - intchance /= 33.3 - - if strchance > random(): - gainstat(char, 0) - elif dexchance > random(): - gainstat(char, 1) - elif intchance > random(): - gainstat(char, 2) - # # Called when the character gains in a skill. --- 161,164 ---- *************** *** 273,276 **** --- 241,278 ---- gainskill(char, skill, totalskills, totalcap) + lock = char.skilllock[skill] # Lock value for the skill + + # It's not important that we actually gained the skill + # in order to gain stats by using it. + if lock == 0: + strchance = info[SKILL_STRCHANCE] + dexchance = info[SKILL_DEXCHANCE] + intchance = info[SKILL_INTCHANCE] + realstr = char.strength - char.strength2 + realdex = char.dexterity - char.dexterity2 + realint = char.intelligence - char.intelligence2 + + if (char.npc or char.strengthlock != 0) or realstr >= char.strengthcap: + strchance = 0.0 + else: + strchance /= 33.3 + + if (char.npc or char.dexteritylock != 0) or realdex >= char.dexteritycap: + dexchance = 0.0 + else: + dexchance /= 33.3 + + if (char.npc or char.intelligencelock != 0) or realint >= char.intelligencecap: + intchance = 0.0 + else: + intchance /= 33.3 + + if strchance > random(): + gainstat(char, 0) + elif dexchance > random(): + gainstat(char, 1) + elif intchance > random(): + gainstat(char, 2) + # # Register our hook and load the skills.xml data. |