2 # GemRB - Infinity Engine Emulator
3 # Copyright (C) 2003-2004 The GemRB Project
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 # character generation, mage spells (GUICG7)
22 from GUIDefines
import *
23 from ie_stats
import *
26 import LUSpellSelection
29 KitTable
= GemRB
.LoadTable("magesch")
30 Slot
= GemRB
.GetVar ("Slot")
31 Class
= GemRB
.GetPlayerStat (Slot
, IE_CLASS
)
32 TableName
= CommonTables
.ClassSkills
.GetValue(Class
, 2)
34 # make sure we have a correct table
36 # sorcerer's need their known not max table
37 TableName
= "SPLSRCKN"
40 KitIndex
= GUICommon
.GetKitIndex (Slot
)
42 KitValue
= KitTable
.GetValue(KitIndex
- 21, 3)
46 KitValue
= 0x4000 # we only need it for the spells, so this is ok
50 # open up the spell selection window
51 # remember, it is pc, table, level, diff, kit, chargen
52 IsMulti
= GUICommon
.IsMultiClassed (Slot
, 1)
53 Level
= GemRB
.GetPlayerStat (Slot
, IE_LEVEL
)
55 for i
in range (1, IsMulti
[0]):
56 if CommonTables
.ClassSkills
.GetValue (IsMulti
[i
], 2, 0) != "*":
57 Level
= GemRB
.GetPlayerStat (Slot
, IE_LEVEL2
+i
-1)
59 GUICommon
.SetupSpellLevels(Slot
, TableName
, IE_SPELL_TYPE_WIZARD
, 1)
60 LUSpellSelection
.OpenSpellsWindow (Slot
, TableName
, Level
, Level
, KitValue
, 1,False)