This function is designed to implement a UI-based Spell selection system, as an alternative to dialog-based Spell Selection, utilizing the Sequencer/Contingency spell selection menu to learn arcane or divine spells. Innate abilities "can" be learned this way as well, but cannot currently be tracked, and thus not supported.
I have kept the changes it makes to UI.MENU to an absolute minimum, to reduce the chances of incompatibility, but any UI mod that outright replaces UI.MENU will obviously not be compatible.
The function requires a 7-character filename and creates the following files:
Screenshots:
Not implemented, but possible:
- '%filename%.SPL' - Usable at-will innate ability to access spell menu.
- '%filename%D.SPL' - Sequencer activation subspell, activated automatically.
- '%filename%X.EFF' - Sequencer creation EFF
- '%filename%X.2DA' - Primary spell list, identical in form to the spell lists for Opcode 214 (Select Spell). If specified, the function will automatically populate the list with appropriate "default" spells (SPPR/SPWI), based on HIDESPL.2DA and the specified exclusion flag. Spells may be manually appended to the list as desired, and spell level is automatically detected and filtered by the UI. Spells omitted or removed from this list will not count towards the characters number of spells known (such as the Shaman's bonus spells).
INCLUDE ~%filepath%/SEQUENCER_MENU.TPA~
LAF CREATE_SEQUENCER_MENU
INT_VAR
tip = stringRef
// String Reference from dialog.tlk, this is the Instructions displayed in the Sequencer Screen
name = stringRef
// String Reference from dialog.tlk, this is the name of the ability used to open the Sequencer Menu
desc = stringRef
// String Reference from dialog.tlk, this is the description for the ability used to open the Sequencer Menu
class = value
// 1 for arcane, else divine, doesn't matter if using custom spell lists.
maxlevel = value
// If non-zero, only spells up to this level will be automatically added to the primary spell list.
// If zero, no spells will be added (to add them manually or use custom mutlilists).
// If omitted, default maximum is used (9 for arcane, 7 for divine).
exclude = value
// If any exclusion flags at offset 0x1e of a spell match this value, it will be excluded from the primary spell list.
multilist = value
// If non-zero, function assumes that primary spell list is instead a list of other 2da files each with their own spell lists, all of which will be made available.
// Intended for School/Sphere systems, so that each school/sphere can have it's own list, while kits would just have a list of those lists as appropriate.
// Such sub-lists 'must' have an accompanying spell of the same name.
// If "Sphere1.2da" is a list of spells, "Sphere1.spl" must exist as a spell file, though it's contents are irrelevant.
column = value
// for use with custom spelllists, column of file to use.
STR_VAR
resref = ~filename~
// 7-character or less filename for Spell Selection ability
icon = ~filename~
// Icon for Spell Selection ability
spelltable = ~filename~
// 2DA table (no extension) for Known Spells, defaults to SPLSRCKN(.2DA) or SPLSHMKN(.2DA) if not specified.
// If used, SPLSRCKN.2DA and/or SPLSHMKN.2DA will be cloned as SPLSRCKN_BACKUP.2DA and SPLSHMKN_BACKUP.2DA for future referencing,
// while the main files are zeroed out so that normal spell selection is disabled.
// The specified 2DA File must exist in game.
spelllist = ~filename~
// 2da file (no extension) with custom spell list, only spells in this file will be added, still subject to maxlevel.
// First column can contain either IDS label or RESREF of a spell
// Other columns contain either '1' (yes) or '0' (no).
// The specified 2DA File must exist in game.
title = ~string~
// String to display in main "Title" slot of Sequencer Screen, added to appropriate "L_%EE_LANGUAGE%.LUA" file.
label = ~string~
// String to display in sub "Title" slot of Sequencer Screen, added to appropriate "L_%EE_LANGUAGE%.LUA" file.
attribute = ~value/string~
// 1, STR, STRENGTH, 2, DEX, DEXTERITY, 3, CON, CONSTITUTION, 4, INT, INTELLIGENCE, 5, WIS, WISDOM, 6, CHA, CHR, CHARISMA
// Is not case sensitive. Omit if not needed.
attrtable = ~filename~
// 2DA table (no extension) with bonus/penalty to Known spells based on specified attribute.
// Format is identical to the priests bonus wisdom spell table, MXSPLWIS.2DA.
// Table can contain postive and negative values. A sufficiently large penalty can be used to prevent selecting spells at the specified attribute score.
// The specified 2DA File must exist in game.
// Omit if not needed.
END
The following will mimic the default sorcerer/shaman spell options (provided proper tra references):
OUTER_SPRINT title @293 OUTER_SPRINT action @294
LAF CREATE_SEQUENCER_MENU
INT_VAR class = 2 maxlevel = 7 exclude = 0x80000000 tip = RESOLVE_STR_REF (@295) name = RESOLVE_STR_REF (@293) desc = RESOLVE_STR_REF (@293)
STR_VAR resref = ~SPLSHMK~ icon = ~SPPR316B~ title action
END
OUTER_SPRINT title @290 OUTER_SPRINT action @291
LAF CREATE_SEQUENCER_MENU
INT_VAR class = 1 maxlevel = 9 exclude = 0x00004000 tip = RESOLVE_STR_REF (@292) name = RESOLVE_STR_REF (@290) desc = RESOLVE_STR_REF (@290)
STR_VAR resref = ~SPLSRCK~ icon = ~SPPR316B~ title action
END

- Multiclass spell learning. Currently it only reads the first-class Level, the others are accessible, but more complicated to convert to an integer.




.jpg)







