Esempio n. 1
0
def OnLoad():
    MyChar = GemRB.GetVar("Slot")
    GemRB.SetVar("Race", 0)  #race
    GemRB.SetPlayerStat(MyChar, IE_RACE, 0)

    CharGenCommon.DisplayOverview(2)

    return
Esempio n. 2
0
def OnLoad():
    MyChar = GemRB.GetVar("Slot")
    GemRB.SetVar("Alignment", -1)  #alignment
    GemRB.SetPlayerStat(MyChar, IE_ALIGNMENT, 0)
    GemRB.SetPlayerStat(MyChar, IE_REPUTATION, 0)

    CharGenCommon.DisplayOverview(4)

    return
Esempio n. 3
0
def OnLoad():
    GemRB.SetVar("Gender", 0)  #gender
    GemRB.SetVar("Race", 0)  #race
    GemRB.SetVar("Class", 0)  #class
    GemRB.SetVar("Class Kit", 0)  #class
    GemRB.SetVar("Alignment", -1)  #alignment

    GUICommonWindows.PortraitWindow = None

    MyChar = GemRB.GetVar("Slot")
    GemRB.CreatePlayer("charbase", MyChar | 0x8000, 0, 11)  # 11 = force bg2
    CharGenCommon.DisplayOverview(1)

    return
Esempio n. 4
0
def OnLoad():
	MyChar = GemRB.GetVar ("Slot")
	GemRB.SetVar("Class",0) #class
	GemRB.SetVar("Class Kit",0) #class kit
	GemRB.SetPlayerStat (MyChar, IE_CLASS, 0)
	GemRB.SetPlayerStat (MyChar, IE_KIT, 0)

	#reset all the levels (assigned in CharGen4)
	GemRB.SetPlayerStat (MyChar, IE_LEVEL, 0)
	GemRB.SetPlayerStat (MyChar, IE_LEVEL2, 0)
	GemRB.SetPlayerStat (MyChar, IE_LEVEL3, 0)

	CharGenCommon.DisplayOverview (3)

	return
Esempio n. 5
0
def OnLoad():
	MyChar = GemRB.GetVar ("Slot")
	AbilityTable = GemRB.LoadTable ("ability")
	AbilityCount = AbilityTable.GetRowCount ()
	
	# set all our abilites to zero
	GemRB.SetVar ("Ability -1", 0)
	GemRB.SetVar ("StrExtra", 0)
	GemRB.SetPlayerStat (MyChar, IE_STREXTRA, 0)
	for i in range(AbilityCount):
		GemRB.SetVar ("Ability "+str(i), 0)
		StatID = AbilityTable.GetValue (i, 3)
		GemRB.SetPlayerStat (MyChar, StatID, 0)

	CharGenCommon.DisplayOverview (5)

	return
Esempio n. 6
0
def OnLoad():
    CharGenCommon.DisplayOverview(7)
    return
Esempio n. 7
0
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