diff --git a/TemplePlus/python/python_spell.cpp b/TemplePlus/python/python_spell.cpp index f2ec8f730..ca0c5e59c 100644 --- a/TemplePlus/python/python_spell.cpp +++ b/TemplePlus/python/python_spell.cpp @@ -1258,6 +1258,11 @@ static PyObject* PySpellStore_GetClass(PyObject* obj, void*) { static PyObject* PySpellStore_GetCasterClass(PyObject* obj, void*) { auto self = (PySpellStore*)obj; + + if (spellSys.isDomainSpell(self->spellData.classCode)) { + return PyInt_FromLong(0); + } + return PyInt_FromLong(spellSys.GetCastingClass(self->spellData.classCode)); } diff --git a/tpdatasrc/tpgamefiles/scr/tpModifiers/ultimate_magus.py b/tpdatasrc/tpgamefiles/scr/tpModifiers/ultimate_magus.py index d3aaf14fb..bc41b2685 100644 --- a/tpdatasrc/tpgamefiles/scr/tpModifiers/ultimate_magus.py +++ b/tpdatasrc/tpgamefiles/scr/tpModifiers/ultimate_magus.py @@ -224,14 +224,15 @@ def ExpandedSpellKnowledgeRadial(attachee, args, evt_obj): known_spells = attachee.spells_known - #Find all known spontaneous spells so we don't add them to the selectable spells + #Find all known spontaneous spells arcane so we don't add them to the selectable spells spontaneous_known = [] for knSp in known_spells: - if knSp.caster_class == spontaneousCastingClass: + if (knSp.caster_class == spontaneousCastingClass) and (knSp.caster_class > 0) and attachee.is_arcane_spell_class(knSp.caster_class): spontaneous_known.append(knSp.spell_enum) + #Add each arcane spell under the level that is not alreay in the spontaneous spell list for knSp in known_spells: - if knSp.spell_level <= level: + if knSp.spell_level <= level and (knSp.caster_class > 0) and attachee.is_arcane_spell_class(knSp.caster_class): if knSp.spell_enum not in spontaneous_known: spell_node = tpdp.RadialMenuEntryPythonAction(knSp, D20A_PYTHON_ACTION, expandedSpellKnowledgeEnum, level) spell_node.add_as_child(attachee, spell_level_ids[knSp.spell_level])