Thread: New Questions
View Single Post
Mathias
Senior Member
Lone Wolf Staff
 
Join Date: May 2005
Posts: 13,217

Old February 8th, 2010, 03:24 PM
Quote:
Originally Posted by Lawful_g View Post
My second question relates to the Alienist prestige class "Extra Summoning" ability, which reads as follows:

From 6th level on, an alienist gains one extra spell slot at her highest spell level. This slot can be used only for a {i}summon monster{/i} spell. As an alienist becomes able to learn higher-level spells, the extra slot migrates up to the new highest level.

I understand how to add spell slots (I think), but how do I make a script to figure out what the highest level of spells available is?
I think this is best done as secondary spells, with the appropriate summon monster spell being the only spell available at each level. Set up the secondary spells as normal.

Once that's done, you can modify the array that stores the maximum number of secondary spells the character gets at each level - cSecMax, with an eval script on the class.

cSecMax is calculated at Post-Attributes/10000, so you can run this after that time:

Code:
 
~create a variable, and start with the 9th level spells
var i as number
i = 9
 
~this variable will be set to one once we find secondary spells we can cast
var notmax as number
notmax = 0
 
~counting down from 9th level spells to 0-level spells
while (i > -1)
  ~if we've already found our highest level of spells
  ~then this level gets 0 secondary spells
  if (notmax <> 0) then
    field[cSacMax].arrayvalue[i] = 0
 
  ~if that's not the case, see if this level of spells has secondary spells
  ~if so, set notmax = 1, so that every level after this will have its 
  ~secondary spell count set to 0
  elseif (field[cSecMax].arrayvalue[i] <> 0) then
    notmax = 1
    endif
 
  ~go on to the next level of spells down
  i -= 1
  loop
Mathias is online now   #5 Reply With Quote