def setAccept(): #set my character up MyChar = GemRB.GetVar ("Slot") ClassName = GUICommon.GetClassRowName (MyChar) #reputation AllignID = GemRB.GetPlayerStat (MyChar, IE_ALIGNMENT) TmpTable=GemRB.LoadTable ("repstart") t = TmpTable.GetValue (AllignID,0) * 10 GemRB.SetPlayerStat (MyChar, IE_REPUTATION, t) #lore, thac0, hp, and saves GemRB.SetPlayerStat (MyChar, IE_MAXHITPOINTS, 0) GemRB.SetPlayerStat (MyChar, IE_HITPOINTS, 0) LUCommon.SetupSavingThrows (MyChar) LUCommon.SetupThaco (MyChar) LUCommon.SetupLore (MyChar) LUCommon.SetupHP (MyChar) #slot 1 is the protagonist if MyChar == 1: GemRB.GameSetReputation( t ) #gold TmpTable=GemRB.LoadTable ("strtgold") t = GemRB.Roll (TmpTable.GetValue (ClassName,"ROLLS"),TmpTable.GetValue(ClassName,"SIDES"), TmpTable.GetValue (ClassName,"MODIFIER") ) GemRB.SetPlayerStat (MyChar, IE_GOLD, t*TmpTable.GetValue (ClassName,"MULTIPLIER") ) #set the base number of attacks; effects will add the proficiency bonus GemRB.SetPlayerStat (MyChar, IE_NUMBEROFATTACKS, 2) #colors GUICommon.SetColorStat (MyChar, IE_METAL_COLOR, 0x1B ) GUICommon.SetColorStat (MyChar, IE_LEATHER_COLOR, 0x16 ) GUICommon.SetColorStat (MyChar, IE_ARMOR_COLOR, 0x17 ) #does all the rest LargePortrait = GemRB.GetToken ("LargePortrait") SmallPortrait = GemRB.GetToken ("SmallPortrait") GemRB.FillPlayerInfo (MyChar, LargePortrait, SmallPortrait) #10 is a weapon slot (see slottype.2da row 10) GemRB.CreateItem (MyChar, "staf01", 10, 1, 0, 0) GemRB.SetEquippedQuickSlot (MyChar, 0) #LETS PLAY!! playmode = GemRB.GetVar ("PlayMode") GUICommon.CloseOtherWindow(None) if playmode >=0: CharGenCommon.close() if GemRB.GetVar("GUIEnhancements"): GemRB.SaveCharacter ( GemRB.GetVar ("Slot"), "gembak" ) GemRB.EnterGame() else: #show the export window GemRB.SetToken("NextScript","CharGen") GemRB.SetNextScript ("ExportFile")
def DonePress(): FileNameEditBox = ExportWindow.GetControl(7) FileName = FileNameEditBox.QueryText() Slot = GemRB.GetVar("Slot") GemRB.SaveCharacter(Slot, FileName) GUICommon.CloseOtherWindow(None) CharGenCommon.close() GemRB.SetNextScript("Start") return
def DonePress (): FileNameEditBox = ExportWindow.GetControl (7) FileName = FileNameEditBox.QueryText () Slot = GemRB.GetVar ("Slot") GemRB.SaveCharacter (Slot, FileName) ExportWindow.Close() if GameCheck.IsBG1(): CharGenCommon.close() GemRB.SetNextScript ("Start") else: GemRB.SetNextScript (GemRB.GetToken("NextScript")) return
def DonePress (): FileNameEditBox = ExportWindow.GetControl (7) FileName = FileNameEditBox.QueryText () Slot = GemRB.GetVar ("Slot") GemRB.SaveCharacter (Slot, FileName) if GameCheck.IsBG1(): GUICommon.CloseOtherWindow (None) CharGenCommon.close() GemRB.SetNextScript ("Start") else: if ExportWindow: ExportWindow.Unload () GemRB.SetNextScript (GemRB.GetToken("NextScript")) return
def setAccept(): #set my character up MyChar = GemRB.GetVar("Slot") ClassName = GUICommon.GetClassRowName(MyChar) #reputation AllignID = GemRB.GetPlayerStat(MyChar, IE_ALIGNMENT) TmpTable = GemRB.LoadTable("repstart") t = TmpTable.GetValue(AllignID, 0) * 10 GemRB.SetPlayerStat(MyChar, IE_REPUTATION, t) #lore, thac0, hp, and saves if not GemRB.GetVar("ImportedChar"): GemRB.SetPlayerStat(MyChar, IE_MAXHITPOINTS, 0) GemRB.SetPlayerStat(MyChar, IE_HITPOINTS, 0) LUCommon.SetupSavingThrows(MyChar) LUCommon.SetupThaco(MyChar) LUCommon.SetupLore(MyChar) LUCommon.SetupHP(MyChar) #slot 1 is the protagonist if MyChar == 1: GemRB.GameSetReputation(t) #gold TmpTable = GemRB.LoadTable("strtgold") t = GemRB.Roll(TmpTable.GetValue(ClassName, "ROLLS"), TmpTable.GetValue(ClassName, "SIDES"), TmpTable.GetValue(ClassName, "MODIFIER")) GemRB.SetPlayerStat(MyChar, IE_GOLD, t * TmpTable.GetValue(ClassName, "MULTIPLIER")) #set the base number of attacks; effects will add the proficiency bonus GemRB.SetPlayerStat(MyChar, IE_NUMBEROFATTACKS, 2) #colors GUICommon.SetColorStat(MyChar, IE_METAL_COLOR, 0x1B) GUICommon.SetColorStat(MyChar, IE_LEATHER_COLOR, 0x16) GUICommon.SetColorStat(MyChar, IE_ARMOR_COLOR, 0x17) #does all the rest LargePortrait = GemRB.GetToken("LargePortrait") SmallPortrait = GemRB.GetToken("SmallPortrait") GemRB.FillPlayerInfo(MyChar, LargePortrait, SmallPortrait) GemRB.SetPlayerString(MyChar, 74, 11863) #10 is a weapon slot (see slottype.2da row 10) GemRB.CreateItem(MyChar, "staf01", 10, 1, 0, 0) GemRB.SetEquippedQuickSlot(MyChar, 0) # apply class/kit abilities GUICommon.ResolveClassAbilities(MyChar, ClassName) #LETS PLAY!! playmode = GemRB.GetVar("PlayMode") GemRB.SetVar("ImportedChar", 0) GUICommon.CloseOtherWindow(None) if playmode >= 0: CharGenCommon.close() if GemRB.GetVar("GUIEnhancements"): GemRB.SaveCharacter(GemRB.GetVar("Slot"), "gembak") GemRB.EnterGame() else: #show the export window GemRB.SetToken("NextScript", "CharGen") GemRB.SetNextScript("ExportFile")
def setAccept(): #set my character up MyChar = GemRB.GetVar ("Slot") ClassName = GUICommon.GetClassRowName (MyChar) #reputation AllignID = GemRB.GetPlayerStat (MyChar, IE_ALIGNMENT) TmpTable=GemRB.LoadTable ("repstart") t = TmpTable.GetValue (AllignID,0) * 10 GemRB.SetPlayerStat (MyChar, IE_REPUTATION, t) #lore, thac0, hp, and saves GemRB.SetPlayerStat (MyChar, IE_MAXHITPOINTS, 0) GemRB.SetPlayerStat (MyChar, IE_HITPOINTS, 0) LUCommon.SetupSavingThrows (MyChar) LUCommon.SetupThaco (MyChar) LUCommon.SetupLore (MyChar) LUCommon.SetupHP (MyChar) #slot 1 is the protagonist if MyChar == 1: GemRB.GameSetReputation( t ) #gold TmpTable=GemRB.LoadTable ("strtgold") t = GemRB.Roll (TmpTable.GetValue (ClassName,"ROLLS"),TmpTable.GetValue(ClassName,"SIDES"), TmpTable.GetValue (ClassName,"MODIFIER") ) GemRB.SetPlayerStat (MyChar, IE_GOLD, t*TmpTable.GetValue (ClassName,"MULTIPLIER") ) #set the base number of attacks; effects will add the proficiency bonus GemRB.SetPlayerStat (MyChar, IE_NUMBEROFATTACKS, 2) #colors GUICommon.SetColorStat (MyChar, IE_METAL_COLOR, 0x1B ) GUICommon.SetColorStat (MyChar, IE_LEATHER_COLOR, 0x16 ) GUICommon.SetColorStat (MyChar, IE_ARMOR_COLOR, 0x17 ) #does all the rest LargePortrait = GemRB.GetToken ("LargePortrait") SmallPortrait = GemRB.GetToken ("SmallPortrait") GemRB.FillPlayerInfo (MyChar, LargePortrait, SmallPortrait) #10 is a weapon slot (see slottype.2da row 10) GemRB.CreateItem (MyChar, "staf01", 10, 1, 0, 0) GemRB.SetEquippedQuickSlot (MyChar, 0) # apply class/kit abilities IsMulti = GUICommon.IsMultiClassed (MyChar, 1) Levels = [GemRB.GetPlayerStat (MyChar, IE_LEVEL), GemRB.GetPlayerStat (MyChar, IE_LEVEL2), \ GemRB.GetPlayerStat (MyChar, IE_LEVEL3)] KitIndex = GUICommon.GetKitIndex (MyChar) if IsMulti[0]>1: #get the class abilites for each class for i in range (IsMulti[0]): TmpClassName = GUICommon.GetClassRowName (IsMulti[i+1], "class") ABTable = CommonTables.ClassSkills.GetValue (TmpClassName, "ABILITIES") if ABTable != "*" and GemRB.HasResource (ABTable, RES_2DA, 1): GUICommon.AddClassAbilities (MyChar, ABTable, Levels[i], Levels[i]) else: if KitIndex: ABTable = CommonTables.KitList.GetValue (str(KitIndex), "ABILITIES") else: ABTable = CommonTables.ClassSkills.GetValue (ClassName, "ABILITIES") if ABTable != "*" and GemRB.HasResource (ABTable, RES_2DA, 1): GUICommon.AddClassAbilities (MyChar, ABTable, Levels[0], Levels[0]) #LETS PLAY!! playmode = GemRB.GetVar ("PlayMode") GUICommon.CloseOtherWindow(None) if playmode >=0: CharGenCommon.close() if GemRB.GetVar("GUIEnhancements"): GemRB.SaveCharacter ( GemRB.GetVar ("Slot"), "gembak" ) GemRB.EnterGame() else: #show the export window GemRB.SetToken("NextScript","CharGen") GemRB.SetNextScript ("ExportFile")