From: <lyn...@us...> - 2009-05-20 15:55:54
|
Revision: 6011 http://gemrb.svn.sourceforge.net/gemrb/?rev=6011&view=rev Author: lynxlupodian Date: 2009-05-20 15:55:26 +0000 (Wed, 20 May 2009) Log Message: ----------- bg2: grant and show ranger and bard skills Modified Paths: -------------- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen7.py gemrb/trunk/gemrb/GUIScripts/bg2/CharGenCommon.py gemrb/trunk/gemrb/GUIScripts/bg2/LevelUp.py gemrb/trunk/gemrb/override/bg2/clskills.2da Modified: gemrb/trunk/gemrb/GUIScripts/bg2/CharGen7.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/CharGen7.py 2009-05-19 20:40:09 UTC (rev 6010) +++ gemrb/trunk/gemrb/GUIScripts/bg2/CharGen7.py 2009-05-20 15:55:26 UTC (rev 6011) @@ -40,6 +40,26 @@ GemRB.SetPlayerStat (MyChar, StatID, Value) print "\tSkill ",str(i),": ",Value + # grant ranger and bard skills + ClassSkillsTable = GemRB.LoadTableObject ("clskills") + ClassTable = GemRB.LoadTableObject ("classes") + Class = GemRB.GetPlayerStat (MyChar, IE_CLASS) + ClassName = ClassTable.GetRowName (ClassTable.FindValue (5, Class)) + RangerSkills = ClassSkillsTable.GetValue (ClassName, "RANGERSKILL") + BardSkills = ClassSkillsTable.GetValue (ClassName, "BARDSKILL") + + Level = 1 + for skills in RangerSkills, BardSkills: + if skills == "*": + continue + SpecialSkillsTable = GemRB.LoadTableObject (skills) + for skill in range(SpecialSkillsTable.GetColumnCount ()): + skillname = SpecialSkillsTable.GetColumnName(skill) + value = SpecialSkillsTable.GetValue (str(Level), skillname) + StatID = SkillTable.GetValue (skillname, "ID") + # setting it to value is enough, but this is more modder friendly + GemRB.SetPlayerStat (MyChar, StatID, value + GemRB.GetPlayerStat (MyChar, StatID, 1)) + # weapon proficiencies # set the base number of attacks; effects will add the proficiency bonus GemRB.SetPlayerStat (MyChar, IE_NUMBEROFATTACKS, 2) Modified: gemrb/trunk/gemrb/GUIScripts/bg2/CharGenCommon.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/CharGenCommon.py 2009-05-19 20:40:09 UTC (rev 6010) +++ gemrb/trunk/gemrb/GUIScripts/bg2/CharGenCommon.py 2009-05-20 15:55:26 UTC (rev 6011) @@ -159,17 +159,19 @@ # thieving and other skills info = "" SkillTable = GemRB.LoadTableObject ("skills") - KitList = GemRB.LoadTableObject ("kitlist") - ClassTable = GemRB.LoadTableObject ("classes") + ClassSkillsTable = GemRB.LoadTableObject ("clskills") Class = GemRB.GetVar ("Class") - 1 ClassID = ClassTable.GetValue (Class, 5) Class = ClassTable.FindValue (5, ClassID) + ClassName = ClassTable.GetRowName (Class) + RangerSkills = ClassSkillsTable.GetValue (ClassName, "RANGERSKILL") + BardSkills = ClassSkillsTable.GetValue (ClassName, "BARDSKILL") # TODO also before: skill{rng,brd}.2da <-- add rangers to clskills.2da KitName = GetKitIndex (MyChar) if KitName == 0: - KitName = ClassTable.GetRowName (Class) + KitName = ClassName else: - KitName = KitList.GetValue (KitName, 0) + KitName = KitTable.GetValue (KitName, 0) if SkillTable.GetValue ("RATE", KitName) != -1: for skill in range(SkillTable.GetRowCount () - 2): @@ -178,6 +180,13 @@ value = GemRB.GetVar ("Skill " + str(skill)) if value >= 0 and available != -1: info += name + ": " + str(value) + "\n" + elif BardSkills != "*" or RangerSkills != "*": + for skill in range(SkillTable.GetRowCount () - 2): + name = GemRB.GetString (SkillTable.GetValue (skill+2, 1)) + StatID = SkillTable.GetValue (skill+2, 2) + value = GemRB.GetPlayerStat (MyChar, StatID, 1) + if value > 0: + info += name + ": " + str(value) + "\n" if info != "": info = "\n" + info + "\n" TextAreaControl.Append (8442) Modified: gemrb/trunk/gemrb/GUIScripts/bg2/LevelUp.py =================================================================== --- gemrb/trunk/gemrb/GUIScripts/bg2/LevelUp.py 2009-05-19 20:40:09 UTC (rev 6010) +++ gemrb/trunk/gemrb/GUIScripts/bg2/LevelUp.py 2009-05-20 15:55:26 UTC (rev 6011) @@ -351,7 +351,7 @@ SkillPointsLeft = 0 else: # get the skill values - # TODO: get upgrades from clskills -> skill{brd,rng} (add rangers to clskills) + # TODO: get upgrades from clskills -> skill{brd,rng} for i in range(SkillTable.GetRowCount()-2): SkillID = SkillTable.GetValue (i+2, 2) SkillValue = GemRB.GetPlayerStat (pc, SkillID, 1) Modified: gemrb/trunk/gemrb/override/bg2/clskills.2da =================================================================== --- gemrb/trunk/gemrb/override/bg2/clskills.2da 2009-05-19 20:40:09 UTC (rev 6010) +++ gemrb/trunk/gemrb/override/bg2/clskills.2da 2009-05-20 15:55:26 UTC (rev 6011) @@ -1,24 +1,24 @@ 2DA V1.0 * - DRUIDSPELL CLERICSPELL MAGESPELL STARTXP BARDSKILL THIEFSKILL LAYHANDS TURNLEVEL BOOKTYPE HATERACE ABILITIES STARTXP2 -UNUSED * * * * * * * 0 0 * * * -MAGE * * MXSPLWIZ 89000 * * * 0 1 * * 2500000 -FIGHTER * * * 89000 * * * 0 0 * CLABFI01 2500000 -CLERIC * MXSPLPRS * 89000 * * * 1 1 * CLABPR01 2500000 -THIEF * * * 89000 * SKILLS * 0 0 * CLABTH01 2500000 -BARD * * MXSPLBRD 89000 SKILLBRD * * 0 1 * CLABBA01 2500000 -PALADIN * MXSPLPAL * 89000 * * PALADIN 5 1 * CLABPA01 2500000 -FIGHTER_MAGE * * MXSPLWIZ 89000 * * * 0 1 * CLABFI01 2500000 -FIGHTER_CLERIC * MXSPLPRS * 89000 * * * 0 1 * FI01,PR01 2500000 -FIGHTER_THIEF * * * 89000 * SKILLS * 0 0 * FI01,TH01 2500000 -FIGHTER_MAGE_THIEF * * MXSPLWIZ 89000 * SKILLS * 0 1 * FI01,TH01 2500000 -DRUID MXSPLDRU * * 89000 * * * 0 1 * CLABDR01 2500000 -RANGER MXSPLRAN * * 89000 * * * 0 1 HATERACE CLABRN01 2500000 -MAGE_THIEF * * MXSPLWIZ 89000 * SKILLS * 0 1 * CLABTH01 2500000 -CLERIC_MAGE * MXSPLPRS MXSPLWIZ 89000 * * * 0 1 * CLABPR01 2500000 -CLERIC_THIEF * MXSPLPRS * 89000 * SKILLS * 0 1 * PR01,TH01 2500000 -FIGHTER_DRUID MXSPLDRU * * 89000 * * * 0 1 * FI01,DR01 2500000 -FIGHTER_MAGE_CLERIC * MXSPLPRS MXSPLWIZ 89000 * * * 0 1 * FI01,PR01 2500000 -CLERIC_RANGER MXSPLRAN MXSPLPRS * 89000 * * * 0 1 HATERACE PR01,RN01 2500000 -SORCERER * * MXSPLSRC 89000 * * * 0 2 * * 2500000 -MONK * * * 89000 * SKILLS * 0 0 * CLABMO01 2500000 + DRUIDSPELL CLERICSPELL MAGESPELL STARTXP BARDSKILL THIEFSKILL LAYHANDS TURNLEVEL BOOKTYPE HATERACE ABILITIES STARTXP2 RANGERSKILL +UNUSED * * * * * * * 0 0 * * * * +MAGE * * MXSPLWIZ 89000 * * * 0 1 * * 2500000 * +FIGHTER * * * 89000 * * * 0 0 * CLABFI01 2500000 * +CLERIC * MXSPLPRS * 89000 * * * 1 1 * CLABPR01 2500000 * +THIEF * * * 89000 * SKILLS * 0 0 * CLABTH01 2500000 * +BARD * * MXSPLBRD 89000 SKILLBRD * * 0 1 * CLABBA01 2500000 * +PALADIN * MXSPLPAL * 89000 * * PALADIN 5 1 * CLABPA01 2500000 * +FIGHTER_MAGE * * MXSPLWIZ 89000 * * * 0 1 * CLABFI01 2500000 * +FIGHTER_CLERIC * MXSPLPRS * 89000 * * * 0 1 * FI01,PR01 2500000 * +FIGHTER_THIEF * * * 89000 * SKILLS * 0 0 * FI01,TH01 2500000 * +FIGHTER_MAGE_THIEF * * MXSPLWIZ 89000 * SKILLS * 0 1 * FI01,TH01 2500000 * +DRUID MXSPLDRU * * 89000 * * * 0 1 * CLABDR01 2500000 * +RANGER MXSPLRAN * * 89000 * * * 0 1 HATERACE CLABRN01 2500000 SKILLRNG +MAGE_THIEF * * MXSPLWIZ 89000 * SKILLS * 0 1 * CLABTH01 2500000 * +CLERIC_MAGE * MXSPLPRS MXSPLWIZ 89000 * * * 0 1 * CLABPR01 2500000 * +CLERIC_THIEF * MXSPLPRS * 89000 * SKILLS * 0 1 * PR01,TH01 2500000 * +FIGHTER_DRUID MXSPLDRU * * 89000 * * * 0 1 * FI01,DR01 2500000 * +FIGHTER_MAGE_CLERIC * MXSPLPRS MXSPLWIZ 89000 * * * 0 1 * FI01,PR01 2500000 * +CLERIC_RANGER MXSPLRAN MXSPLPRS * 89000 * * * 0 1 HATERACE PR01,RN01 2500000 SKILLRNG +SORCERER * * MXSPLSRC 89000 * * * 0 2 * * 2500000 * +MONK * * * 89000 * SKILLS * 0 0 * CLABMO01 2500000 * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |