Pre-Levels/50
~ We select a patron an gain its spells as bonus spells at particular 
~ levels. We handle this similar to a shaman's bonus spells instead
~ of like a domain spell because we automatically get these spells
~ we need to get a list of our patron spells and modify when
~ we get them
~ We get our bonus spells as follows
~   Spell         -  Cultist   -   Witch
~ 1st level spell - 2nd level  -  2nd level
~ 2nd level spell - 6th level  -  4th level
~ 3rd level spell - 8th level  -  6th level
~ 4th level spell - 10th level -  8th level
~ 5th level spell - 12th level -  10th level
~ since we want to be done if we have not chosen a patron, but we 
~ want to add a tag to the patron, just use findchild to find
~ our chosen patron and focus on it. If no focus, we get out.
~ Afterwards, clear the focus.
perform hero.findchild[Ability,"abCategory.WitPatron & CustTaken.cHelpCul"].setfocus
doneif (state.isfocus = 0)
perform focus.assign[SpecSource.cHelpCul]
perform state.clearfocus
~ now go through the patron spells and modify for cultist use
foreach pick in hero from BaseSpell
  ~ Is the spell bootstrapped by something?
  if (eachpick.isroot <> 0) then
    ~ is it a witch patron that was selected by the cultist?
    ~ (note to self: + -> logical OR, * -> logical AND)
    if (eachpick.root.tagis[abCategory.WitPatron] * eachpick.root.tagis[CustTaken.cHelpCul] <> 0) then
     ~ modify the spell we are on
      perform eachpick.delete[Spellbook.?]
      perform eachpick.tagreplace[SpellSort.?,SpellSort.cHelpCul]
      perform eachpick.tagreplace[SpellType.?,SpellType.cHelpCul]
      perform eachpick.assign[Helper.NoPrepCnt]
      perform eachpick.tagreplace[CasterType.?,CasterType.MemAll]
      perform eachpick.assign[SecSplType.cHelpCul]
      perform eachpick.assign[SecClsAllw.cHelpCul]
      ~ adjust level we get the bonus spell
      if (eachpick.tagvalue[sLevel.?] = 1) then
        perform eachpick.tagreplace[BonusSplAt.?,BonusSplAt.2]
        perform eachpick.assign[SecClsAllw.cHelpCul]
      elseif (eachpick.tagvalue[sLevel.?] <= 5) then
        var newLvl as number
        newLvl = eachpick.tagvalue[BonusSplAt.?] + 2
        perform eachpick.delete[BonusSplAt.?]
        perform eachpick.assignstr["BonusSplAt." & newLvl]
      else
        ~ if we are above 5th level spell, hide us
        perform eachpick.assign[Hide.Spell]
        endif
      endif
    endif
  nexteach