def DCSkillsBackPress (): """Reverts all changes to this points.""" if DCSkillsWindow: DCSkillsWindow.Unload () LUSkillsSelection.SkillsNullify () DCMainBackPress () return
def DCSkillsBackPress(): """Reverts all changes to this points.""" if DCSkillsWindow: DCSkillsWindow.Unload() DCMainWindow.ShowModal(MODAL_SHADOW_GRAY) LUSkillsSelection.SkillsNullify() DCMainBackPress() return
def unsetSkill(): import LUSkillsSelection MyChar = GemRB.GetVar("Slot") LUSkillsSelection.SkillsNullify() LUSkillsSelection.SkillsSave(MyChar)
def OnLoad(): MyChar = GemRB.GetVar ("Slot") # nullify our thieving skills LUSkillsSelection.SkillsNullify () LUSkillsSelection.SkillsSave (MyChar) # nullify our proficiencies LUProfsSelection.ProfsNullify () # nully other variables GemRB.SetVar ("HatedRace", 0) # save our previous stats: # abilities AbilityTable = GemRB.LoadTable ("ability") AbilityCount = AbilityTable.GetRowCount () # print our diagnostic as we loop (so as not to duplicate) print "CharGen6 output:" #remove all known spells and nullify the memorizable counts Spellbook.RemoveKnownSpells (MyChar, IE_SPELL_TYPE_WIZARD, 1,9, 1) Spellbook.RemoveKnownSpells (MyChar, IE_SPELL_TYPE_PRIEST, 1,7, 1) # learn divine spells if appropriate ClassName = GUICommon.GetClassRowName (MyChar) TableName = CommonTables.ClassSkills.GetValue (ClassName, "CLERICSPELL", 0) # cleric spells if TableName == "*": # only druid spells or no spells at all TableName = CommonTables.ClassSkills.GetValue (ClassName, "DRUIDSPELL", 0) ClassFlag = 0x8000 elif CommonTables.ClassSkills.GetValue (ClassName, "DRUIDSPELL", 0) != "*": # cleric and druid spells ClassFlag = 0 else: # only cleric spells ClassFlag = 0x4000 if TableName != "*": #figure out which class casts spells and use the level of the class #to setup the priest spells Levels = [GemRB.GetPlayerStat (MyChar, IE_LEVEL), \ GemRB.GetPlayerStat (MyChar, IE_LEVEL2), \ GemRB.GetPlayerStat (MyChar, IE_LEVEL3)] index = 0 IsMulti = GUICommon.IsMultiClassed (MyChar, 1) if IsMulti[0]>1: #loop through each multiclass until we come across the class that gives #divine spells; because clerics have a lower id than rangers, they should #be looked at first in Cleric/Ranger multi's, which is correct foundindex = 0 for i in range (IsMulti[0]): ClassName = GUICommon.GetClassRowName (IsMulti[i+1], "class") for table in "CLERICSPELL", "DRUIDSPELL": if CommonTables.ClassSkills.GetValue (ClassName, table) != "*": index = i foundindex = 1 break if foundindex: break #set our memorizable counts Spellbook.SetupSpellLevels (MyChar, TableName, IE_SPELL_TYPE_PRIEST, Levels[index]) #learn all our priest spells up to the level we can learn for level in range (8): if GemRB.GetMemorizableSpellsCount (MyChar, IE_SPELL_TYPE_PRIEST, level, 0) <= 0: Spellbook.LearnPriestSpells (MyChar, level, ClassFlag) break CharGenCommon.DisplayOverview (6) return